chapter09186a00800c6c63.html#xtocid23
Content 5.2 Managing the Cisco File System 5.2.6 Managing IOS images using Xmodem If the IOS image in flash has been erased or corrupted, the IOS may need to be restored from the ROM monitor mode (ROMmon). In many of the Cisco hardware architectures, the ROMmon mode is identified from the rommon 1 > prompt.This first step in this process is to identify why the IOS image did not load from flash. This could be due to a corrupt or missing image. The flash should be examined with the dir flash: command. If an image is located that appears to be valid, an attempt should be made to boot from that image. This is done using boot flash: command. For example if the image name was “c2600-is-mz.121-5”, the command would be: rommon 1>boot flash:c2600-is-mz.121-5 If the router properly boots, then there are a couple of items that need to be examined to determine why the router booted to the ROMmon instead of using IOS from flash. First, use the show version command to check the configuration register to ensure that it is configured for the default boot sequence. If the configuration register value is correct, use the show startup-config command to see if there is a boot system command instructing the router to use the IOS for ROM monitor. If the router will not properly boot from the image or there is no IOS image, a new IOS will need to be downloaded. The IOS file may be recovered using either Xmodem to restore the image through the console, or downloading the image using TFTP from the ROMmon mode. Download using Xmodem from ROMmon
To restore the IOS through the console, the local PC needs to have a copy of the IOS file to restore and a terminal emulation program such as HyperTerminal. The IOS can be restored using the default console speed of 9600 bps. The baud rate can be changed to 115200 bps to speed up the download. The console speed can be changed from ROMmon mode using the confreg command. After entering the confreg command, the router will prompt for the various parameters that can be changed. When prompted “change console baud rate? y/n [n]:” selecting y will provide a prompt to select the new speed. After changing the console speed and restarting the router into the ROMmon mode, the terminal session (at 9600) should be terminated and a new session started at 115200 bps to match the console speed. The Xmodem command can be used from the ROMmon mode to restore the IOS software image from the PC. The format of the command is xmodem -c image_file_name. For example, to restore an IOS image file with the name “c2600-is-mz.122-10a.bin”, type the command: xmodem -c c2600-is-mz.122-10a.bin The -c instructs the Xmodem process to use Cyclic Redundancy Check (CRC) for error checking during the download. The router will prompt not to begin the transfer and present a warning message. The warning message informs that the bootflash will be erased and asks to confirm continuing. When the process is continued, the router will then prompt to start the transfer. Now the Xmodem transfer needs to be started from the terminal emulator. In HyperTerminal, select Transfer > Send File. Then in the Send File popup specify the image name/location, select Xmodem as the protocol, and start the transfer. During the transfer, the Sending File popup will display the status of the transfer. Once the transfer is complete a message appears indicating that flash is being erased. This is followed by the “Download Complete!” message. Before restarting the router, the console speed needs to be set back to 9600 and the config register back to 0x2102. Enter the command config-register 0x2102 at the privileged EXEC prompt. While the router is rebooting, the 115200 bps terminal session needs to be ended and a 9600 bps session begun. Lab Activity Lab Exercise: Password Recovery Procedures In this lab, the students will gain access to a router with an unknown privileged mode (enable) password. Lab Activity Lab Exercise: Managing IOS Images with ROMmon and Xmodem In this lab, the students will recover a Cisco 1700 series router using ROM monitor (ROMmon) (rommon >) due to a missing or corrupt IOS boot flash image. Web Links Loading and Maintaining System Images http://www.cisco.com/en/US/products/sw/ iosswrel/ps1835/products_configuration_guide_ chapter09186a00800c6c63.html#xtocid41
Content 5.2 Managing the Cisco File System 5.2.7 Environment variables The IOS can also be restored from a TFTP session. Downloading the image using TFTP from ROMmon is the fastest way to restore an IOS image to the router. This is done by setting environmental variables and then using the tftpdnld command.Since the ROMmon has very limited functions, no configuration file is loaded during boot. The router therefore has no IP or interface configuration. The environmental variables provide a minimal configuration to allow for the TFTP of the IOS. The ROMmon TFTP transfer works only on the first LAN port so a simple set of IP parameters are set for this interface. To set a ROMmon environment variable, the variable name is typed, then the equal sign (=), and the value for the variable (VARIABLE_NAME=value). For example, to set the IP address to 10.0.0.1, type IP_ADDRESS=10.0.0.1 at the ROMmon prompt. Note: All variable names are case sensitive. The minimum variables required to use tftpdnld are: To check the ROMmon environment variables, the set command can be used. Once the variables are set for the IOS download, the tftpdnld command is entered with no arguments. The ROMmon will echo the variables and then a confirmation prompt will appear with a warning that this will erase the flash. As each datagram of the IOS file is received, a “!” will be displayed. When the complete IOS file has been received, the flash will be erased and the new IOS image file written. Appropriate messages will be displayed as the process is completed. When the new image is written into flash and the ROMmon prompt is displayed, the router can be restarted by typing i. The router should now boot from the new IOS image in flash. Web Links Loading and Maintaining System Images http://www.cisco.com/en/US/products/sw/ iosswrel/ ps1835/ products_configuration_ guide_ chapter09186a00800c6c63.html#xtocid30
Content 5.2 Managing the Cisco File System 5.2.8 File system verification There are several commands that can be used to verify the router file system. One of those is the show version command. The show version command can be used to check the current image and the total amount of flash. It also verifies two other items concerning loading the IOS. It identifies the source of the IOS image that the router used to boot and displays the configuration register. The boot field setting of the configuration register can be examined to determine from where the router is to load the IOS. If these do not agree, there may be a corrupt or missing IOS image in flash or there may be boot system commands in the startup configuration.The show flash command can also be used to verify the file system. This command is used to identify IOS image(s) in flash as well as the amount of flash that is available. This command is often used to confirm that there is ample space to store a new IOS image. As previously mentioned, the configuration file may contain boot system commands. These commands can be used to identify the source of the desired IOS boot image. Multiple boot system commands may be used to create a fallback sequence