A colleague of mine just called, having done an “erase flash” on a 3750. He did this because there was only 16MB of flash on the switch and therefore not enough room for two images at the same time. What he didn’t expect was that the switch would subsequently reboot and end up in bootloader mode with no software on it…
So here’s what we did. I thought I’d write this up because I found it a bit difficult locating the information on Cisco.com.
The software for these switches comes as a .tar file. Tar is an old Unix file archive type – it actually stands for “tape archive” and was used for archiving things to tape. The .tar file contains the .bin image that the switch needs to boot, and some other stuff (for Cisco View Device Manager etc). When the switch is running normally, you’d use the command “archive download-sw tftp://<ipaddress>/<filename>” – this command copies the .tar file over and extracts it onto the filesystem.
However when you’re stuck in bootloader mode, there’s no such command. So we need to do something different:
1. Use Winzip (or similar) to extract the .bin file from the .tar file on your computer.
2. Connect to the switch using Hyperterminal at 9600 baud, 8 N 1.
3. You should see a prompt that says “switch:”. This is the bootloader mode. If you don’t see that, either you’re booted up, and you don’t need these instructions, your switch is properly broken, or you’ve got your terminal settings wrong. Try power-cycling the Catalyst while holding the “Mode” button on the front in to get the bootloader.
4. Now downloading the .bin file at 9600 baud is going to take a loooong time (about 2 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 start to get funny characters in Hyperterminal because its baud rate and the Catalyst’s are now mis-matched.
5. Close Hyperterminal and re-connect using 115200 baud instead. You should get intelligible stuff on the screen once more.
6. Type “flash_init” to initialise the filesystem. (In our case, this wasn’t necessary)
7. Type “load_helper” to load any helper files (in our case there weren’t any since we’d just wiped the flash).
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 Hyperterminal click Transfer | 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, you’d better set the console baud rate back to 9600, otherwise you or someone else will be really confused when they next try to use it. 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.