For anyone working in Cisco IOS world knows the pain when an IOS gets deleted from flash by mistake or the IOS image on the flash gets corrupt. The device keeps on booting to a state known as ROMMON. The usual XMODEM procedure is painfully long. The IOS image copy process can take more than 9 hours - if the file is around 25 MB.
To put the IOS back into the switch using USB can be pretty quick. I have done this in under an hour. Here is how to do it.
I am using Catalyst 2960X in my example below.
First make sure your IOS device has a USB port. If it does, we need a format a USB flash drive in a way IOS recognizes it. The file format has to be FAT16 (or FAT).
Note: FAT32 and FAT-EX are not supported by the Cisco IOS devices.
The USB drive has to be smaller or equal to 2 GB. If you don't have a USB drive smaller than 2 GB, follow this.
Here are the options I checked on when I formatted my USB drive to FAT on my Windows PC. Don't do Quick Format.
After formatting, put the IOS image on the USB drive. Now power on the switch or router. It would come to the ROMMON state.
Insert the USB flash drive in the USB port. Make sure that switch is able to see the IOS image on the USB. Issue the command dir usbflash0:
Now enter boot usbflash0:c2960x-universalk9-mz.152-7.E2.bin so the the switch boots using the image on the USB.
For some reason, my switch came back to ROMMON after this above step as well - which it shouldn't have. So I had to repeat the above step once again. After the next time it came up fine.
Now the flash doesn't have a valid IOS image. We need to copy the image on the switch's flash.
I copied it by making the laptop as the FTP server. I use Filezilla. I gave my PC IP address of 10.10.10.2/24
int vlan 1
ip address 10.10.10.1 255.255.255.0
ip ftp username cisco
ip ftp password cisco
Control Panel >> Network and Internet >> Network Connections >> Ethernet >> Properties >> Internet Protocol Version 4 (TCP/IPv4)
Make sure you are able to ping each other (from switch ping 10.10.10.2 and from laptop ping 10.10.10.1)
Once both PC and switch have IP connectivity, issue the command:
copy ftp: flash:
Provide the IP Address of FTP server (10.10.10.2 - in my example) and file name (c2960x-universalk9-mz.152-7.E2.bin - in my example)
Make sure you get the exclamations (!), and not the dots (.). If you get dots, that means either there isn't IP connectivity or (T)FTP server is not properly setup.
Issue dir to make sure that you see the IOS bin file in the switch's flash.
Make sure the config register is the right value before reloading by issuing sh ver
Reload the switch by reload command. Enter no to saving the config - this is so that on the boot, you get a fresh install of IOS.
Hopefully this will save you time just like it did to me and you can avoid xmodem IOS transfer.
1/9/2023 08:29:55 am
Thanks so much for this!
Leave a Reply.
Saad is a Senior Collaboration Engineer. He is CCIE x 3 (Collaboration, R&S and Data Center)