Cisco Switch IOS Recovery

If your Cisco switch flash memory has become corrupt or you have accidentally erased it (read: delete /force /recursive flash:*) and then powered cycled your switch, you may be stuck in boot-loader mode. In short, your switch does not have a internal operating system (IOS) to load.

To recover your switch and restore the IOS you will need to download the latest IOS release from www.cisco.com and extract the .bin file from the tarball (.tar) file using 7-Zip, WinZip or your preferred compression application.

The following process will guide you through the IOS recovery and restore process:

1. Use 7-Zip to extract the .bin file from the .tar file on your local computer.

2. Connect to the switch using Tera Term using connection parameters: 9600 baud, 8 N 1.

3. You should see a prompt that says “switch:”. This means you are in boot loader mode.

4. Downloading the .bin file from your computer to the switch at 9600 baud will take a long time (around 3 hours), so we will change the baud rate of the console port temporarily. Enter the command “set BAUD 115200″. After you enter this command, you will see strange characters in Tera Term because its baud rate and the switches are now miss-matched.

5. Close Tera Term and re-connect using 115200 baud instead. You should see the switch: prompt again.

6. Type “flash_init” to initialize the filesystem.

7. Type “load_helper” to load any helper files.

8. Tell the switch to expect a file by Xmodem, and put it on the flash: “copy xmodem: flash:<filename.bin>” The filename should be the same as what you extracted from the .tar file.

9. In Tera Term click Send File. In the dialogue box, make sure the protocol is XModem and put in the location of your .bin file. Click “Send” and you should see the process start.

10. Once that’s done, issue the command “boot flash:<filename.bin>” and the IOS will load up.

11. When the switch has booted, you may want to install the full .tar file in the correct manner using the “archive” command.

12. Check that you can reboot OK without ending up in the bootloader again.

13. Finally, set the console baud rate back to 9600. Go back into the bootloader by power-cycling the switch and holding down the “Mode” button. Enter the command “set BAUD 9600″ Then type “reset” to reboot the switch.