Its possible that over time or when uploading new firmware to a switch the firmware that the switch is using to boot will become corrupt, in this case you will be left at a “switch:” prompt and will need to recover the IOS on the device. Below are the steps to do that assuming that you already have a known working USB drive formatted in FAT 16 which is able to Boot IOS images and is loaded with the one you need and that image is also validated as working.
One thing to note that if you had to manually get to the ‘switch:’ prompt because it was stuck in a boot loop make sure you boot up to the image version that was last working on the device because if it has to do a microcode update it will reboot at the end of that process and get stuck back into the boot loop and you will have to preform these steps twice to fully boot.
First you will need to make sure Flash is initialized:
1 2 3 |
switch: flash_init Initializing Flash... ...The flash is already initialized. |
Validate your image is on your flashdrive:
1 2 3 4 5 6 7 8 9 |
switch: dir usbflash0: Directory of usbflash0:/ 1 -rw- 0 <date> c3750e-universalk9-mz.122-55.SE3.bin 2 -rw- 7757 <date> config.text 3 -rw- 0 <date> vlan.dat 4 drw- 0 <date> c3750e-universalk9-mz.122-55.SE3 1034715136 bytes available (38731776 bytes used) |
Boot to an image on the USB drive:
1 2 3 4 5 |
switch: boot usbflash0:/c3750e-universalk9-mz.122-55.SE3/c3750e-universalk9-mz.122-55.SE3.bin Loading "usbflash0:/c3750e-universalk9-mz.122-55.SE3/c3750e-universalk9-mz.122-55.SE3.bin"...@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
At this point just wait until the image is fully loaded and you can login, as long as your configuration file did not get corrupt it should be loaded with the same config.
Once logged in copy the image you need from the flash drive to the internal flash memory of the switch:
1 2 3 4 5 6 7 |
3750xSWITCH#copy usbflash0:/c3750e-universalk9-mz.122-55.SE3.bin flash: Destination filename [c3750e-universalk9-mz.122-55.SE3.bin]? Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 14587929 bytes copied in 33.554 secs (434760 bytes/sec) 3750xSWITCH# |
Run an MD5 checksum on the image on the USB drive and the image on the internal Flash storage and make sure they match:
1 2 3 4 5 6 7 8 9 10 11 |
3750xSWITCH# verify /md5 usbflash0:/c3750e-universalk9-mz.122-55.SE3.bin ................................................................................. ..................................Done! verify /md5 (usbflash0:/c3750e-universalk9-mz.122-55.SE3.bin) = 22a14c3d2d671b66fb301075bf072fce 3750xSWITCH# verify /md5 flash:/c3750e-universalk9-mz.122-55.SE3.bin 22a14c3d2d671b66fb301075bf072fce ................................................................................. ..................................Done! Verified (flash:/c3750e-universalk9-mz.122-55.SE3.bin) = 22a14c3d2d671b66fb301075bf072fce 3750xSWITCH# |
At this point we know we have a good image sitting on the internal flash.
Lastly make sure that the boot variable is set to the name of your image that you just copied to the switch
1 2 3 |
3750xSWITCH# show boot | include BOOT BOOT path-list : flash:/c3750e-universalk9-mz.122-55.SE3.bin 3750xSWITCH# |
if it is not you can set it properly with the command “boot system flash:/path/to/image.bin” with ‘/path/to/image.bin’ being the path to your image on your switch.
Now reboot the switch and it will use your image you copied and should boot up with no problems.