How Update Cisco Router using USB Drive

If you have a Cisco IOS Router or Switch that you need to update via USB, you’re in the right place.

Copying your firmware image to your Cisco Router or Switch from a USB thumb drive is totally possible, provided you jump through a few hoops.

Namely, you need format your thumb drive using the FAT (FAT 16) file system which only supports partitions up to 4GB in size. This means we need to create a 4GB partition on your USB drive it’s over 4GB in size (most are these days).

Let’s review the steps, using a Windows 11 computer, and get you on your way to updating your router. These steps will be applicable to any Cisco IOS-XR router and IOS or IOS-XE switch.

How to Format USB Drive for Use with Cisco IOS Router

The first step to updating your router is to set up a USB drive so that your router can read it. Make sure the thumb drive you use is free of any data you wish to keep because we are going to format (erase the content of) the drive.

For this example I’m going to use a 16GB Kingston DataTraveler USB2.0 drive.

Formatting Via Windows

  1. Plug your drive into your computer
  2. Open command prompt as an admin.
  3. Enter the following command to launch diskpart:
    diskpart
  4. List out the disks attached to your computer using the following command:
    list disk
  5. Find the number in the first column for your usb drive and enter the following command:
    select disk disknumber
  6. Create a partition on that disk (your usb drive) by entering the following command:
    create part primary size=4000
  7. Set the new 4GB partition as active by entering the command:
    active
  1. Open file explorer and right click on your usb drive and click format. You should now see FAT as an option in the File system drop down.
  2. Select FAT in the file system dropdown, give your drive a volume label, and click Start to format the drive.
  3. Your drive is now ready to use so you can go ahead and copy over your firmware file.

If you want to see the above steps in action, here is my command prompt output:

C:\WINDOWS\system32>diskpart

DISKPART> list disk

Disk ###  Status         Size     Free     Dyn  Gpt

--------  -------------  -------  -------  ---  ---

Disk 0    Online          238 GB      0 B        *

Disk 1    Online           14 GB      0 B

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> create part primary size=4000

DiskPart succeeded in creating the specified partition.

DISKPART> active

DiskPart marked the current partition as active.

DISKPART>

And here is what my Format screen for the drive looked like after running the above commands:

Screenshot showing format usb fat cisco router

Sometimes you have to fiddle with the ‘part primary size‘. In my command above I used size=4000. If that doesn’t work try smaller increments such as size=3700 or size=3400 and so on.

Formatting Via the Router Itself

Some USB drives just will still not work even after formatting via Windows. For these, I’ve had luck formatting from the router itself. To do this:

Step 1. Plug the usb drive into your router

Step 2. Access the terminal prompt and enter the ‘format usbflash0:‘ command:

NPGR#format usbflash0:
Format operation may take a while. Continue? [confirm]
Format operation will destroy all data in "usbflash0:".  Continue? [confirm]
  
Primary Partition created...Size 1328 MB
  
Drive communication & 1st Sector Write OK...
  
Format: All system sectors written. OK...
  
Format: Total sectors in formatted partition: 2719712
Format: Total bytes in formatted partition: 1392492544
Format: Operation completed successfully.
  
Format of usbflash0 complete

Step 3. Remove the USB drive from the router, plug it into your computer, copy files, and return USB to the router.

If that doesn’t work, you may just need to find another USB drive. Some simply won’t work with Cisco hardware.

How to Update a Cisco IOS Router using a USB Drive

Now that we have our properly formatted usb drive we can proceed with updating our router. In this example I’m going to update a Cisco 2921 router using the IOS image c2900-universalk9-mz.SPA.157-3.M3.bin. When following these instructions replace c2900-universalk9-mz.SPA.157-3.M3.bin with your own firmware file name.

  1. Copy your firmware image to your usb drive using your computer.
  2. Plug the usb drive into your router. You should see usbflash0: has been inserted in the terminal prompt.
  3. Run the following command to copy the IOS image into the router’s flash:
    copy usbflash0:c2900-universalk9-mz.SPA.157-3.M3.bin flash0: c2900-universalk9-mz.SPA.157-3.M3.bin
  4. Verify your file is in flash by running the command:
    dir flash0:
  5. Tell the router to boot to the new image by running the following commands:
    conf t boot system flash0 c2900-universalk9-mz.SPA.157-3.M3.bin exit copy run start

    Also, if you’ve previously configured your router to boot to a specific IOS file you’ll need to remove that line from your config before reloading the device. To see what all is in your boot config run the following command:

    show run | begin boot

    Find any erroneous boot system commands and remove them using the “no” command followed by the erroneous config line like so:

    conf t no boot system flash0 oldconfigfilename.bin copy run start
  6. Reload your router to boot to the new image by running the following command:
    reload
  7. Once the router is booted back up, go ahead and delete the old firmware image from the flash by running:
    delete /recursive /force flash0:c2900-universalk9-mz.SPA.156-2.M2.bin

And that’s it. Very simple, yet tedious, process!

I should add, the name of your router or switches internal flash may differ from mine. Some devices uses flash:, flash0:, and even bootflash:. So be sure to check which syntax your device needs. You can find this out by running the following command and looking for the name under the Prefixes column:

show file systems

Hopefully this tutorial was helpful and saved you some time and heartache!

Recommended Tool: ManageEngine OpManager

  • Multi-vendor Network Monitoring
  • Simple Installation & Setup
  • Intuitive UI
  • Complete Visibility
  • Intelligent Detections
  • Easy Resolutions

Leave a Reply

Your email address will not be published. Required fields are marked *