Recovery Through Rommon Mode
- The switch: prompt or rommon mode indicates that the switch has not booted up completely and requires the user to complete the boot process.
- The error loading flash :< image> message indicates that the switch failed to load an image due to a corrupt or missing image. The image may have been deleted by the user but not replaced. A boot variable may not have been set correctly.
- Normally, the switch attempts to automatically boot the next valid image in the Flash file system with a console session open, you should see an error message similar to the following:
       Error loading                    “flash: c2950−i6q4l2−mz.121−12c.EA1.bin”
Solution
1)Â Â Â We should follow the below command before start XMODEM option.
       Bits per second: 9600
       Data bits: 8
       Parity: None
       Stop bits: 1
       Flow control: None
2)   Issues the ‘flash_init’ command
        During the normal boot process, the Flash file system is automatically initialized. Use this command to manually     Â
       Initialize the Flash file system
       If the Flash has already initialized, you see the following:
       Switch: flash_init
       Initializing Flash…
       The flash is already initialized.
       If the Flash has not initialized, you see the following:
       Switch: flash_init
       Initializing Flash…
       flashfs[0]: 21 files, 2 directories
       flashfs[0]: 0 orphaned files, 0 orphaned directories
       flashfs[0]: Total bytes: 7741440
       flashfs[0]: Bytes used: 4499456
       flashfs[0]: Bytes available: 3241984
       flashfs[0]: flashfs fsck took 7 seconds.
       done initializing flash.
       Boot Sector Filesystem (bs:) installed, fsid: 3
       Parameter Block Filesystem (pb:) installed, fsid: 4
3)Â Â Â Â Issue the load_helper command
       Use the load_helper boot loader command to load and initialize one or more helper images, which extend or patch the functionality of the boot loader. The load_helper command searches for loadable files only if the HELPER environment variable is set. Filenames and directory names are case sensitive.
       Load any boot helper images, as shown below.
       Switch: load_helper
       Switch:
4)Â Â Â Issue the dir flash: command
       Command to view the contents of the Flash file system.
   Â
       If there are no IOS image files or image directories in flash: you see the following:
       switch: dir flash:
       Directory of flash:/
       2 −rwx 5 <date> private−config.text
       3 −rwx 110 <date> info
       4 −rwx 976 <date> vlan.dat
       6 −rwx 286 <date> env_vars
       26 −rwx 1592 <date> config.text
      8 drwx 1088 <date> html
       19 −rwx 110 <date> info.ver
       4393472 bytes available (3347968 bytes used)
       −−− No IOS images or image directories exist in Flash……..|
       In this case no IOS is available in flash then we must follow step-5 we should recover IOS through XMODEM.
       If there is still an image in Flash, you see the following output:
       Switch: dir flash:
       Directory of flash:/
       3 −rwx 2888547 <date> c2950−i6q4l2−mz.121−13.EA1.bin
       4 −rwx 976 <date> vlan.dat
       6 drwx 832 <date> html
       22 −rwx 110 <date> info
       23 −rwx 110 <date> info.ver
       25 −rwx 38 <date> env_vars
       3132928 bytes available (4608512 bytes used)
       Issue the boot command in order to try to recover the switch. Before you issue the boot command, verify where the Cisco IOS image is stored in the Flash directory. If IOS stored in flash directory then execute as per below command.
       Boot flash: c2950−i6q4l2−mz.121−13.EA1/ c2950−i6q4l2−mz.121−13.EA1.bin
       In above output no directory is present for .bin file. So we can execute boot command or boot flash: c2950−i6q4l2−mz.121−13.EA1.bin
       In some router we can get at rommon moe and get error as per below
       rommon 1 >dir flash:
       device does not contain a valid magic number
       dir: cannot open device “flash:”
       This error messages display in the console output, when the Flash is empty or the file system is corrupted. Copy a valid image on the Flash. In this case also we should follow xmodem recovery procedure.
5)Â Â Â Xmodem Recover Procedure:
       First execute below command then
       Switch:   copy xmodem: flash:c2955−i6q4l2−mz.121−13.EA1.bin
       After enter the command start the below session.
6)Â Â Â Â Verify
       Issue the show version command in order to verify the current version of software that you run.
       Issue the dir flash: filename command in order to display the Cisco IOS image (.bin file) on a
       Issue the show boot command
       If we get no boot variable set then we must define the boot variable by issuing below command
       (Config)# boot system flash: filename command.