cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
18615
Views
6
Helpful
3
Replies

Deleting a directory in flash.

Hi,

 

We are upgrading the IOS on our switches as the current image does not support SSH.

If I copy the new IOS to flash, it will still boot up with the old IOS which is in a directory in flash.

 

How do I delete the entire directory in one command?

I tried to use

boot system

command but this doesn't work.

What I was going to do is delete the directory containing the IOS, copy the new IOS over.

 

1 Accepted Solution

Accepted Solutions

Jerry Ye
Cisco Employee
Cisco Employee

Here is my assumption

 

1) you want to copy the .bin file only to the flash. Where the .bin file is your new IOS image

2) you want to remove the old IOS in

flash:/c3560-ipbase-mz.122-25.SEB4/

You can use the following command to remove the directory

 

delete /force /recursive flash:/c3560-ipbase-mz.122-25.SEB4/

DO NOT REBOOT THE BOX. Once that is done, copy the new IOS into the flash via TFTP or FTP. Then

verify /md5 image_name

Compare the MD5 checksum with the checksum on CCO.

To change the boot variable

config t

boot system flash:/image_name.bin

exit

wri mem




Use show boot to verify.




Here is the output of show boot in my switch in the lab




SW1#sh boot

BOOT path-list : flash:/c3560e-universalk9-mz.122-44.SE6.bin

Config file : flash:/config.text

Private Config file : flash:/private-config.text

Enable Break : no

Manual Boot : no

HELPER path-list :

Auto upgrade : yes

Auto upgrade path :

Timeout for Config

Download: 0 seconds

Config Download

via DHCP: disabled (next boot: disabled)

SW1#

 

HTH,

jerry

View solution in original post

3 Replies 3

bberry
Level 1
Level 1

When I upgraded my switches using the

archive download-sw

command, it was all done for me. I used the files with the -tar in them. There was an option to delete the old file / directory as part of the command and it even modified the boot.

Jerry Ye
Cisco Employee
Cisco Employee

Here is my assumption

 

1) you want to copy the .bin file only to the flash. Where the .bin file is your new IOS image

2) you want to remove the old IOS in

flash:/c3560-ipbase-mz.122-25.SEB4/

You can use the following command to remove the directory

 

delete /force /recursive flash:/c3560-ipbase-mz.122-25.SEB4/

DO NOT REBOOT THE BOX. Once that is done, copy the new IOS into the flash via TFTP or FTP. Then

verify /md5 image_name

Compare the MD5 checksum with the checksum on CCO.

To change the boot variable

config t

boot system flash:/image_name.bin

exit

wri mem




Use show boot to verify.




Here is the output of show boot in my switch in the lab




SW1#sh boot

BOOT path-list : flash:/c3560e-universalk9-mz.122-44.SE6.bin

Config file : flash:/config.text

Private Config file : flash:/private-config.text

Enable Break : no

Manual Boot : no

HELPER path-list :

Auto upgrade : yes

Auto upgrade path :

Timeout for Config

Download: 0 seconds

Config Download

via DHCP: disabled (next boot: disabled)

SW1#

 

HTH,

jerry

Thanks a million, this worked like a dream.

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