When offered an old Cisco 1921 router I lept at the chance of learning to configure one outside a emulator such as Cisco Packet Tracer – not just configuring routing in theory from the software terminal but actually the process of booting the image and the pitfalls that might exist.
I immediately ran into some interesting problems – how do I even boot it into a usable state?
Upon turning it on (thankfully it did actually turn on) and finding a usb cable for the console port, I eagerly attached a serial session in PuTTY and logged on – only to be met with a boot error of failing to read the image stored on the internal flash memory and instead booting to ROMMON – which after a cursory google – was stored on internal readonly and for selecting the image to boot and failure recovery.
I mused it probably had a usb port on the back (it did) and that I could probably boot an image off of that, and maybe even copy it over to usbflash0
I found a usb stick – copied a Cisco 1921 image onto it and slammed it home, deftly whipping out the plug I restarted the router and eagerly waited for it to boot into my new image.
After a 5 minute wait all I got was a Read Error:
rommon 1> dir usbflash1:
fnuhcd5200OpenPipe ERROR opening PIpe CVMX
*** TLB (Load/Fetch) Exception ***
Access address = 0x26
PC = 0x8090f0c0, SP = 0x80902dc0, RA = 0x8090f560
Cause Reg = 0x80000008, Status Reg = 0x504080e3
This was interesting – I’d just assumed it would read Fat32 – and this was a pretty huge disk I’d found in my office drawer, a USB 3.0 Sandisk 32GB – perhaps it might be a little bit too new for this router to understand?
So, after looking with not a lot of confidence for a 1GB or less USB drive – and baulking at the idea of paying £400 for a “Cisco approved drive” – I came up with the idea of formatting the drives I did have as FAT16 and some small partition in the region of 255MB or less.
Pretty simple on windows, be careful to select your USB not your PCs hard drives!
DISKPART> LIST VOLUME
DISKPART> SELECT VOLUME D
DISKPARK> CLEAN
DISKPART> CREATE PARTITION PRIMARY SIZE=255
DISPART> FORMAT FS=FAT
This gave me a drive advertising as 255MB on Fat16, simple enough for the usb handler on the router to understand right?
Apparently not – at least the error message changed – but still no read success. Maybe it was something to do with the USB chip on the usbdrive, maybe that was too new?
I dug out a much older HP branded 8GB USB drive – and repeated the process – formatted it as FAT16 100MB and restarted the router.
rommon 8> dir usbflash1:
fnuhcd5200OpenPipe ERROR opening PIpe CVMX
*** TLB (Load/Fetch) Exception ***
Access address = 0x26
PC = 0x8090f0c0, SP = 0x80902dc0, RA = 0x8090f560
Cause Reg = 0x80000008, Status Reg = 0x504080e3
Bam, the drive failed to load, at this point I was considering hitting ebay and finding the oldest and smallest usb drive I could see.
But I had a thought, what if it’s some combination of seating the drive properly and repeatedly prodding rommon to try again – plenty of race conditions that are solved by retrying the same step.
First I tried giving the usb drive a tap to solidly seat it noticing the drive slot had a lot of wiggle room to it. Then I tried running rommon 19> in dir usbflash1:
repeatedly.
Suddenly I noticed the error message had changed, rather than a unhandled exception it was a handled return from presumably stderror or stdout – this sounds to me like an improvement from read error to handled fault.
I tried the process of giving it a tap and then running rommon 21> dir usbflash1:
again, and then suddenly, the drive was reading correctly! It listed the Cisco IOS with no error messages.
With a deft copy of the printed IOS image, we were away, and the router booted the image. (not the image used, just for illustration)
boot usbflash1:c1900-universalk9-mz.SPA.158-3.M7.bin
Just goes to show, if your USB port doesn’t work, do a bit of percussive maintenance, give it a tap, a wiggle and run the read/load device command a few times!