Recovering from a corrupt IOS image

From Peter Pap's Technowiki
Jump to: navigation, search

This is a bit of nastiness! You have a switch that refuses to boot. When you watch what's happening on the console you see errors like this:

 Error loading "flash:c3750-k9-mz.122-44.se2.bin"
 
 Interrupt within 5 seconds to abort boot process.
 Boot process failed...
 
 switch:

You have a corrupt IOS image! Download a new one from the Cisco website! To recover you will need Microsoft Windows HyperTerminal to perform an xmodem transfer of a new IOS image to the switch (obviously you can use other terminal emulators etc, but you'll get no help from me :-). This method has been tested with a Cisco 3750G. You can see more specific info for different switch models here.


1. Connect to the switch with HyperTerminal with these the settings:

 Baud: 9600
 Data bits: 8
 Parity: None
 Stop bits: 1
 Flow control: None

2. If the switch is not already at the switch: prompt, remove the power cord. Hold down the MODE button on the front of the switch and re-insert the power cord. Wait until the SYST light is flashing away and let go of the MODE button.

3. You should be at the switch: prompt. Type the following commands:

 switch: flash_init
 switch: load_helper

4. List the contents of the switches flash memory.

 switch: dir flash:
 Directory of flash:/
 
 2    -rwx  10761792  <date>               c3750-k9-mz.122-44.se2.bin
 3    -rwx  676       <date>               vlan.dat
 4    -rwx  7807      <date>               config.backup
 83   -rwx  98        <date>               private-config.text
 86   -rwx  1048      <date>               multiple-fs
 
 5113856 bytes available (10885120 bytes used)

5. If there is no room in flash for another IOS image, delete the old one:

 switch: delete flash:c3750-k9-mz.122-44.se2.bin
 Are you sure you want to delete "flash:c3750-k9-mz.122-44.se2.bin": yes

6. To speed the xmodem transfer up, change the Baud rate of the switch

 switch: set BAUD 115200

You will lose access to the console, but a restart of the HyperTerminal session with a new Baud rate of 115200 will fix this!

NOTE: if you don't do this, it will take literally hours! You can change it back later.

7. At the switch: prompt, begin the xmodem transfer of the new IOS image:

 switch: copy xmodem: flash:imagefilename
 Begin the Xmodem or Xmodem-1K transfer now...
 CCC

8. From HyperTerminal:

 a. Choose Transfer > Send File.
 b. Choose the Xmodem protocol in the Send File dialog box and click Browse in order to select the IOS image (.bin file) that you downloaded from Cisco.
 c. Click Send in order to begin the Xmodem transfer.

When it's complete you should see something like:

 ............................................................................
 File "xmodem:" successfully copied to "flash:c2955-i6q4l2-mz.121-13.EA1.bin"

If you get an error message, do the transfer again!


9. Boot off the new IOS image:

 switch: boot flash:imagefilename

Assuming it boot correctly, the switch should now be ready to configure as if it were a new switch.

10. Once you've finished the basic config, enter Enable mode and set the switch to use the new IOS version by default

 switch# config t
 switch(config)# no boot system flash:oldflashimage
 switch(config)# boot system flash:newflashimage
 switch(config)# exit
 switch# wr mem

The switch is now ready for advanced configuration :-)