cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3623
Views
10
Helpful
13
Replies

Cisco Router IOS backup and restore

prince.p
Level 1
Level 1

Hi Friends

I have taken Cisco IOS backup using TFTP server, using the command

Copy flash tftp

 

Now i need to restore the backup IOS file again from TFTP server to flash.

but my flash drive is not having enough space.

so if i delete current IOS file in flash memory and reload the router, will my router will go into end stage or anything else i need to do for restoring IOS from TFTP to flash.

 

 

1 Accepted Solution

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

If you delete the IOS image and reload you will end up in ROMMON. Save yourself the pain. 

 

If you want to restore another image to the router, delete the current one, TFTP the replacement onto the flash, change the boot variable and reload.

 

!
delete flash:<old_image>
!
copy tftp://<tftp_server>/<new_image>  flash:
!
conf t
boot system flash:<new_image>
exit
!
wr mem
reload
!

 

cheers,

Seb.

View solution in original post

13 Replies 13

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

If you delete the IOS image and reload you will end up in ROMMON. Save yourself the pain. 

 

If you want to restore another image to the router, delete the current one, TFTP the replacement onto the flash, change the boot variable and reload.

 

!
delete flash:<old_image>
!
copy tftp://<tftp_server>/<new_image>  flash:
!
conf t
boot system flash:<new_image>
exit
!
wr mem
reload
!

 

cheers,

Seb.

balaji.bandi
Hall of Fame
Hall of Fame

Sure adding @Seb Rupik - make sure you do not reboot the device after delete the old IOS, check the new IOS copied and check the MD5, before reloading.

 

Suggest to connect console cable in case any unexpected outcomes to mitigate the issue.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Joseph W. Doherty
Hall of Fame
Hall of Fame
"Now i need to restore the backup IOS file again from TFTP server to flash."

(being curious) - why? Reason I ask, unless something has happened to your IOS on flash, you shouldn't need to reload it into flash.

BTW, you didn't note what model router you're using, but some very old Cisco router models require you to "compress" flash, after deleting files, to re-obtain usable space.

Also BTW, if your intended IOS image is the only or first (or others not found) image in flash, you don't need to the boot system flash command.

Lastly, if you're trying to load a newer (or possibly additional features) IOS image, be aware some images are just too large for the installed flash in the device.

jessieo
Level 1
Level 1

Hello!

I have a Cisco Catalyst 4948E-F and 4900M in my environment and I have been trying to backup their IOS files.

I succeeded in backup the configuration and vlan.dat files using TFTP server but I am unable to backup the IOS files in both switches.

I get the following error message each time I run the copy bootflash tftp command.

%Error writing tftp://192.168.xx.xx/cat4500e-entservicesk9-mz.152-2.E2.bin (Timed out)..

I am sure there isn't the problem of connectivity or firewall because I am able to backup the configuration and vlan.dat files.

Any idea what the problem might be?

 

Thank you.

Hello,

 

the IOS image you are sending is rather large. Which TFTP server are you using ? Try and reduce the tftp blocksize on your switch to the lowest value possible, or try different values:

 

4948E(config)#ip tftp blocksize 512

 

Is the TFTP server logging anything when you are transferring the file ?

Hello George,

Thank you for responding!

I am using a software called blackjumbodog. 

Before I reduce the blocksize, I would like to know what the current blocksize is. What is the command for this please?

 

Is the TFTP server logging anything when you are transferring the file ?

I am not sure if this is the answer to your question, but after every failed attempt to backup, I can see that the IOS image is partly copied to the directory specified.

Hello,

 

unfortunately there is no command to show the current TFTP blocksize. It will only show up in the running configuration (at the end).

 

I would try different blocksizes, even 8192. 

 

Hello George,

 

I changed the blocksize to 8192, 1024 and then 512 but it didn't solve the problem.

I have two different versions of IOS image file on the switch. I am able to backup the other version of IOS but unable to backup

the version that is running on the switch.

Hello,

 

can you post the output of:

 

dir bootflash

jessieo
Level 1
Level 1

Switch4#

Switch4#dir bootflash:/

Directory of bootflash:/

    6 -rw- 39660287 Aug 14 2015 06:48:04 +00:00 cat4500e-entservicesk9-mz.152-2.E2.bin

    7 -rw- 27242762 Nov 11 2015 15:16:04 +00:00 cat4500e-entservicesk9-mz.150-2.SG8.bin

128165888 bytes total (51234816 bytes free)

Switch4#

 

cat4500e-entservicesk9-mz.152-2.E2.bin is the current boot IOS and the one I would like to backup.

Hello,

 

what about a different TFTP server (such as the one attached) ?

jessieo
Level 1
Level 1

Hello George,

I still could not successfully complete the backup.

Has anyone successfully backed up the boot IOS image in the 4000 series catalyst switches?

 

Hi there,

As a rule of thumb depending in on file size, the pecking order for file transfer should be XMODEM -> TFTP -> FTP -> SCP .

When I was last working on 4000e's we were using FTP for image transfers. If you need GUI based opensource option take a look a filezilla FTP server: https://filezilla-project.org/

 

cheers,

Seb.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco