Managing Flash Cards on SRP Modules

Each SRP module contains a flash card that stores system files. On the E120 and E320 routers, each SRP module can have an additional flash card; the second card is reserved for the storage of core dumps.

In this documentation, the flash card on the primary SRP module is referred to as the primary flash card; the flash card on the redundant SRP module is referred to as the redundant flash card.

If you have two SRP modules installed in a router, you can use flash cards of different capacities on the SRP modules. The effective capacity of the higher-capacity flash card equals that of the lower-capacity flash card.

Flash Features

The software contains a number of features that optimize the way the router restores its configuration if it is shut down improperly:

Flash Features on the E120 Router and the E320 Router

The E120 and E320 routers can have a second flash card installed with its SRP modules. Device names are reserved for the E120 and E320 routers flash card slots: disk0, disk1, standby-disk0, and standby-disk1. For backward compatibility, you can use the name standby, which is equivalent to standby-disk0. You can use the second card (disk1 or standby-disk1) only for storage of core dump (.dmp) files. When the a card is installed and mounted as disk1 or standby-disk1, all .dmp files are automatically stored on this card. You must use the card mounted as disk0 or standby-disk0 for all other file types. Core dump files are stored on disk0 or standby-disk0 only when a second card is not installed.

The copy, dir, delete, and rename commands all recognize the device names, as in the following examples. Disk1 and standby-disk1 accept only dump files. This means that you can copy only .dmp files to the second disk, delete only .dmp files from the second disk, and rename only .dmp files on the second disk.

host1#copy reset05.dmp server2:reset05.dmp
host1#copy disk0:051802.dmp server2:reset05.dmp
host1#delete disk1:reset05.dmp
host1#delete standby:reset05.dmp
host1#delete standby-disk0:reset05.dmp
host1#delete standby-disk1:reset05.dmp
host1#rename standby-disk1:foo.dmp standby-disk1:bar.dmp
host1#rename foo.dmp /outgoing/bar.dmp
host1#dir
Please wait...
active/standby file systems are synchronized
   unshared                                                             in
     file                   size         size         date (UTC)        use
--------------            ---------    --------   -------------------   ---
disk0:reboot.hty             654336      654336   03/01/2005 16:08:28
disk0:system.log               3644        3644   11/30/2004 20:48:18
disk0:special.rel         159256660    61695156   02/18/2005 10:31:48
disk0:lm4_12.dmp          344200394   344200394   02/12/2005 12:12:12
standby-disk0:lm4_13.dmp  344200394   344200394   02/13/2005 13:13:13
disk1:lm4_14.dmp          344200394   344200394   02/14/2005 14:14:14
standby-disk1:lm4_15.dmp  344200394   344200394   02/15/2005 15:15:15
disk0:boston.scr                833         833   02/22/2005 17:46:18
disk0:bulkstats.scr             170         170   02/13/2006 17:34:30
ram:bulkstats1.sts              737         737   03/07/2006 09:07:52
              Disk capacity
              -------------
          Capacity      Free      Reserved
Device    (bytes)      (bytes)    (bytes)
------   ----------   ---------   --------
disk0:   1025482752   342066375   68157440
ram:        5767168     5734400          0

Because the device names are reserved, if you upgrade from a release where you previously used those names for remote hostnames, an error message appears when you try to use that remote hostname:

%ambiguous file name, reserved disk device name "disk1" must be removed from host table

 

To prevent corruption of flash cards, always issue the halt command before you remove an SRP module. See Removing an SRP Module. Issue the halt command before you remove a flash card installed as disk 0 or standby disk 0. Flash cards installed and mounted as disk1 or standby disk1 can be safely removed by issuing the no mount command for the card and then ejecting the card. Always reboot the router using the rebooting procedure. See Booting the System . Do not reboot the router by switching it off and on.

Installing and Removing Flash Cards

For information about replacing flash cards, see the Installing Modules chapter in the ERX Hardware Guide, or the Installing Modules chapter in the E120 and E320 Hardware Guide.

Before you remove the second flash card (disk1) on the SRP 120 module or the SRP 320 module, you must first unmount the card with the no mount command. This command causes the file system to reject all subsequent requests for opening files on the flash card and closes all open files. When this is accomplished, the disk is marked as safely unmounted and a status message indicates that is safe to eject the disk. A status message is displayed when you issue the mount or no mount command:

mount

Synchronizing Flash Cards

Note: The information in this section does not apply to the ERX310 router, which does not support SRP module redundancy.

When the router contains two SRP modules, the contents of the modules’ flash cards need to be synchronized. Synchronization prevents the redundant flash card from overwriting saved files on the primary flash card if the primary SRP module fails and the redundant SRP module takes control.

By default, autosynchronization is enabled on the router. Autosynchronization runs as a background process every 5 minutes, tracking changes in image, configuration, and script files, and keeping the two SRP modules synchronized. You can also synchronize the SRP modules manually by issuing the synchronize command.

Before synchronization, the router does the following:

Depending on the outcome of the space verification, the router proceeds as follows:

If an SRP synchronization is in progress or has failed and the router is recovering, the router prevents the redundant SRP module from taking the primary role while the primary is rebooting and for 30 seconds after the primary module has rebooted. These conditions prevent a redundant SRP module with corrupted or missing files from becoming the primary and overwriting files or directories on the primary module.

synchronize

Synchronizing Flash Cards of Different Capacities

If the capacity of the primary flash card is equal to or smaller than that of the redundant flash card, the router copies all the files from the primary flash card to the redundant flash card. However, if the capacity of the primary flash card exceeds that of the redundant flash card, the router creates a hidden synchronization reserve file on the primary flash card, provided enough space is available for the file.

The purpose of the synchronization file is to prevent the creation of data that cannot fit on the redundant flash card. The file contains no useful data, and does not appear when you view the files in NVS. The size of the file is equal to the difference in capacities of the two flash cards. For example, if the primary flash card has a capacity of 224 MB, and the redundant flash card has a capacity of 220 MB, the size of the synchronization file is 4 MB, and only 220 MB of space is available on the primary flash card.

If the primary flash card does not have enough space to create the synchronization reserve file, the synchronize command fails, and you see a warning message on the console. To resolve this issue, either delete unwanted files from the primary flash card or replace the redundant flash card with a higher-capacity flash card.

Disabling Autosynchronization

If autosynchronization is enabled while you are copying long scripts or installing new software releases, it detects a disparity between the modules during the middle of the process. This feature causes significant unnecessary synchronization, resulting in prolonged copy times.

If you have installed a redundant SRP module, perform the following steps before copying long scripts:

  1. Turn off autosynchronization with the disable-autosync command.
  2. Perform the installation or copy the script.
  3. Reenable autosynchronization with the no disable-autosync command.
  4. Manually synchronize the modules with the synchronize command.

Refer to the commands and guidelines in the previous section and in the sections that follow.

disable-autosync

Validating and Recovering Redundant SRP File Integrity

Note: The information in this section does not apply to the ERX310 router, which does not support SRP module redundancy.

Even when flash cards on the primary and redundant SRP modules are synchronized, differences can exist in the content of files that reside on the primary flash card and the redundant flash card. You can use the flash-disk compare command to detect these differences so you can validate and, if necessary, recover the file integrity of the redundant SRP module.

The flash-disk compare command validates only those files that are synchronized between the primary and redundant SRP modules. It does not compare files that are normally excluded from the synchronization process, such as log files and core dump files. The command uses a simple checksum error detection algorithm to compare the contents of a file residing on the flash card of the primary SRP module with the contents of the same file residing on the flash card of the redundant SRP module.

To validate and recover redundant SRP file integrity:

  1. Ensure that the file systems on the primary flash card and the redundant flash card are synchronized. (See Synchronizing Flash Cards for details.)
  2. Issue the flash-disk compare command, specifying whether to perform the checksum validation for all files in NVS or only for configuration files.
    host1#flash-disk compare all host1#flash-disk compare configuration

    The flash-disk compare configuration command, which validates only configuration files, excludes larger files such as software releases and scripts from the validation process. As a result, this command takes less time to complete than the flash-disk compare all command, which validates all NVS files.

  3. Review the flash-disk compare output to determine whether any files failed the checksum validation.

    If the flash-disk compare command detects differences in the content of one or more files, the router reports a checksum test failure.

  4. If one or more files failed the checksum validation, determine whether the corrupted files reside on the primary SRP module or on the redundant SRP module.
  5. If the corrupted file resides on the primary SRP module, issue the srp switch command to force a switch from the primary SRP module to the redundant SRP module.

    This action ensures that the error-free version of the file will be on the SRP module that takes control after the switch.

  6. Issue the synchronize command with the low-level-check keyword to force the router to:
    • Validate all files in NVS (when you use the all keyword) or only configuration files in NVS (when you use the configuration keyword).
    • Synchronize all files that failed the checksum test during the flash-disk compare command, as well as any other unsynchronized files.
      host1#synchronize low-level-check all host1#synchronize low-level-check configuration

      This action resolves any file discrepancies between the primary and redundant SRP modules and restore SRP file integrity.

      Note: Both the flash-disk compare and synchronize low-level-check commands perform CPU-intensive processing that can take several minutes to complete. For best results, do not run these commands simultaneously on the same router. In addition, do not run multiple instances of the flash-disk-compare command simultaneously on the same router.

flash-disk compare

synchronize

Reformatting the Primary Flash Card

You can reformat the primary flash card. To do so:

  1. Access Boot mode.
    1. From Privileged Exec mode, enter the reload command. Information about the reloading process is displayed.
    2. When the countdown begins, press the mb key sequence (case-insensitive).

      The CLI enters Boot mode (:boot## prompt). If you do not press the mb key sequence, the reloading process continues and returns the CLI to the normal User Exec mode.

  2. Issue the flash-disk initialize command.

flash-disk initialize

Copying the Image on the Primary SRP Module

Note: The information in this section does not apply to the ERX310 router, which does not support SRP module redundancy.

You can copy the contents of NVS on the primary SRP module to a spare flash card. To do so:

  1. Access Boot mode.
    1. From Privileged Exec mode, enter the reload command. Information about the reloading process is displayed.
    2. When the countdown begins, press the mb key sequence (case-insensitive).

      This CLI enters Boot mode (:boot## prompt).
      If you do not press the mb key sequence, the reloading process continues and returns the CLI to the normal User Exec mode.

  2. Issue the flash-disk duplicate command.
  3. Follow the instructions on the screen. When prompted, insert the original or spare flash card in the primary SRP module.

flash-disk duplicate

Scanning Flash Cards

You can find both structural errors in the data in NVS and physical errors in the flash card. You can also remove files with errors, and attempt to repair structural or physical errors.

check-disk

flash-disk scan

Monitoring Flash Cards

Use the show nvs command to monitor the status of NVS on the primary SRP module. Use the show flash command to view information about the flash card.

show flash

show nvs