cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
264538
Views
162
Helpful
25
Replies

deleting a directory in flash:

GaryRS
Level 1
Level 1

Started to upgrade IOS image on new switch, upgrage was interrupted. Now when I issue the command to upgrade image I get error message "unable to create temp dir flash:update". There is an Update directory already there and I am assuming I need to delete it. Trying to delete it I get message "error deleting flash:update (it is a directory)

Found it, able to delete using /recursive

25 Replies 25

Common rule when dealing with anything:  If you don't know what you're doing then don't do it.

If you don't know what you're doing Then do it = learning :)

Ill did try many commands some work some  don't .

PalladiumOne
Level 1
Level 1

Hello Everyone,

I'm very new to the Cisco world, I just recently got a switch and have been staying up for days at a time figuring it out.

Then found this discussion, learned some things and solved my issue. I hope this helps someone! Anyway, I was having a similar issue, but with the old IOS file itself.  The following is a visual what I was experiencing while attempting to delete my old file-Problem Areas In Bold Letters- because my new file is at least 5 MB:

usatl01cisco01#dir flash:

Directory of flash:/

    2  -rwx     3721984  Jan 01 1970 02:19:06 +00:00  c2950-i6k2l2q4-mz.121-22.E

A13.bin

    3  -rwx         990  Mar 01 1993 00:24:53 +00:00  config.text

    4  -rwx          24  Mar 01 1993 00:24:53 +00:00  private-config.text

    5  -rwx        1031  Mar 03 1993 01:56:24 +00:00  config.old

    6  -rwx        3018  Apr 07 1993 22:39:57 +00:00  statrtup-config

    7  -rwx         108  Mar 01 1993 00:01:35 +00:00  info

    8  drwx           0  Mar 01 1993 10:29:26 +00:00  html

   19  -rwx         108  Mar 01 1993 00:03:43 +00:00  info.ver

   20  -rwx         269  Jan 01 1970 00:04:34 +00:00  env_vars

   21  -rwx         676  Mar 01 1993 01:40:02 +00:00  vlan.dat.renamed

   22  -rwx        3060  Mar 16 1993 02:32:09 +00:00  config

   24  -rwx        1596  Mar 01 1993 02:18:29 +00:00  config.text.renamed

   25  -rwx          24  Mar 01 1993 02:18:29 +00:00  private-config.text.rename

d

7741440 bytes total (4003328 bytes free)

Switch#delete flash:c2950-i6k2l2q4-mz.121-22.A13.bin

Delete filename [c2950-i6k2l2q4-mz.121-22.A13.bin]?

Delete flash:c2950-i6k2l2q4-mz.121-22.A13.bin? [confirm]

%Error deleting flash:c2950-i6k2l2q4-mz.121-22.A13.bin (No such file or directory)

We know it is there cause we can see it clear as day. So I came here and with in minutes I had the following resaults:

Switch#delete /recursive flash:c2950-i6k2l2q4-mz.121-22.EA13.bin

Delete filename [c2950-i6k2l2q4-mz.121-22.EA13.bin]?

Delete flash:c2950-i6k2l2q4-mz.121-22.EA13.bin? [confirm]

Switch#

Switch#dir flash:

Directory of flash:/

    3  -rwx         990  Mar 01 1993 00:24:53 +00:00  config.text

    4  -rwx          24  Mar 01 1993 00:24:53 +00:00  private-config.text

    5  -rwx        1031  Mar 03 1993 01:56:24 +00:00  config.old

    6  -rwx        3018  Apr 07 1993 22:39:57 +00:00  statrtup-config

    7  -rwx         108  Mar 01 1993 00:01:35 +00:00  info

    8  drwx           0  Mar 01 1993 10:29:26 +00:00  html

   19  -rwx         108  Mar 01 1993 00:03:43 +00:00  info.ver

   20  -rwx         269  Jan 01 1970 00:04:34 +00:00  env_vars

   21  -rwx         676  Mar 01 1993 01:40:02 +00:00  vlan.dat.renamed

   22  -rwx        3060  Mar 16 1993 02:32:09 +00:00  config

   24  -rwx        1596  Mar 01 1993 02:18:29 +00:00  config.text.renamed

   25  -rwx          24  Mar 01 1993 02:18:29 +00:00  private-config.text.rename

d

7741440 bytes total (7725568 bytes free)

Switch#

And Good Night Batman, it worked! Thanks Again!

Hey, to you folks with the dir issue have you tried to copy your backup file into the dir then try to delete it? Some it appears that our devices are not seeing neither the file nor its directory. Is it possible that the dadt could be defragmented?

Best Regards,

W

Tcharles

  Your first attempt you used the wrong name , take a close look you have "

Switch#delete flash:c2950-i6k2l2q4-mz.121-22.A13.bin ,   you are missing an "E" before the A13  so it rejected the imagename and failed. If the name would have been correct your first attempt would have worked.

Hey Glenn thanks,

You are probably right! However, that was my last failed attempt. I will have to review my log to see what I actually typed in on my long list of failed attempts.  Most likely I typoed every time cause I was half cocked and sideways.  But, I'm glad I was cause i would have never entered this blog.  Thanks again and I look forward to seeing you here!

princekennedy
Level 1
Level 1

Is very easy to fix this problem just do a show flash output you will see a filename update delete that with the below command

delete /r /f flash:update

and you will be all set to go depending on which platform of switch you are using. In my case i was upgrading a 3750 switch in a stack and one of our engineers accidentally pull of the power from the main outlet.

switch#archive download-sw usbflash0:(name of ios) i hope this helps thank you.

Is very easy to fix this problem just do a show flash output you will see a filename update delete that with the below command

delete /r /f flash:update

and  you will be all set to go depending on which platform of switch you are  using. In my case i was upgrading a 3750 switch in a stack and one of  our engineers accidentally pull of the power from the main outlet.

switch#archive download-sw usbflash0:(name of ios) i hope this helps thank you.

princekennedy
Level 1
Level 1

Is very easy to fix this problem just do a show flash output you will see a filename update delete that with the below command

delete /r /f flash:update

and  you will be all set to go depending on which platform of switch you are  using. In my case i was upgrading a 3750 switch in a stack and one of  our engineers accidentally pull of the power from the main outlet.

switch#archive download-sw usbflash0:(name of ios) i hope this helps thank you.

princekennedy
Level 1
Level 1

Is very easy to fix this problem just do a show flash output you will see a filename update delete that with the below command

delete /r /f flash:update

and  you will be all set to go depending on which platform of switch you are  using. In my case i was upgrading a 3750 switch in a stack and one of  our engineers accidentally pull of the power from the main outlet.

switch#archive download-sw usbflash0:(name of ios) i hope this helps thank you.

pathiksohel
Level 1
Level 1

#format flash: will delete every thing from the flash. 

I just wrote the command, but when I saw the flash memory again, some files are shown like deleted and other aren´t and I don´t know why.

2651XM#dir flash:

Directory of flash:/

1 -rw- 27092404 <no date> c2600-ipvoicek9-mz.124-15. T14.bin
17 -rw- 24985 <no date> bacdprompts/app-b-acd-2.1. 2.2.tcl
18 -rw- 35485 <no date> bacdprompts/app-b-acd-aa-2 .1.2.2.tcl

28 -rw- 131470 <no date> Desktops/320x212x12/Campus Night.png
29 -rw- 80565 <no date> Desktops/320x212x12/CiscoF ountain.png

39 -rw- 4802 <no date> gui/admin_user.html
40 -rw- 657587 <no date> gui/admin_user.js

33030140 bytes total (0 bytes free)

2651XM#delete /force/recursive flash:bacdprompts
2651XM#delete /force /recursive flash:gui
2651XM#delete /force /recursive flash:Desktops

2651XM#show flash:

System flash directory:
File Length Name/status
1 27092404 c2600-ipvoicek9-mz.124-15.T14.bin
2 18836 bacdprompts/app-b-acd-2.1.2.2-ReadMe.txt [deleted]
3 24985 bacdprompts/app-b-acd-2.1.2.2.tcl [deleted]

14 131470 Desktops/320x212x12/CampusNight.png [deleted]
15 79872 Desktops/320x212x12/CiscoFountain.png [deleted]
16 18836 bacdprompts/app-b-acd-2.1.2.2-ReadMe.txt [deleted]
17 24985 bacdprompts/app-b-acd-2.1.2.2.tcl
18 35485 bacdprompts/app-b-acd-aa-2.1.2.2.tcl
19 75650 bacdprompts/en_bacd_allagentsbusy.au
20 83291 bacdprompts/en_bacd_disconnect.au
21 63055 bacdprompts/en_bacd_enter_dest.au
22 37952 bacdprompts/en_bacd_invalidoption.au
23 496521 bacdprompts/en_bacd_music_on_hold.au
24 123446 bacdprompts/en_bacd_options_menu.au
25 42978 bacdprompts/en_bacd_welcome.au
26 34794 bacdprompts/en_bacd_xferto_operator.au
27 20954 CME41-full-readme.txt [deleted]
28 131470 Desktops/320x212x12/CampusNight.png
29 80565 Desktops/320x212x12/CiscoFountain.png
30 628 Desktops/320x212x12/List.xml
31 109076 Desktops/320x212x12/MorroRock.png
32 108087 Desktops/320x212x12/NantucketFlowers.png
33 10820 Desktops/320x212x12/TN-CampusNight.png
34 9657 Desktops/320x212x12/TN-CiscoFountain.png
35 7953 Desktops/320x212x12/TN-Fountain.png
36 7274 Desktops/320x212x12/TN-MorroRock.png
37 9933 Desktops/320x212x12/TN-NantucketFlowers.png
38 138278 Desktops/320x212x12/Fountain.png
39 4802 gui/admin_user.html
40 657587 gui/admin_user.js
41 1602 gui/CiscoLogo.gif
42 716 gui/CME_GUI_README.TXT
43 953 gui/Delete.gif
44 16344 gui/dom.js
45 864 gui/downarrow.gif
46 6146 gui/ephone_admin.html
47 4658 gui/logohome.gif
48 3724 gui/normal_user.html
49 81443 gui/normal_user.js
50 1347 gui/Plus.gif
51 843 gui/sxiconad.gif
52 174 gui/Tab.gif
53 2431 gui/telephony_service.html
54 870 gui/uparrow.gif
55 9968 gui/xml-test.html
56 3412 gui/xml.template
57 496521 music-on-hold.au [deleted]
58 1698556 phone/7945-7965/apps45.8-3-1-22.sbn [deleted]
[33030140 bytes used, 0 available, 33030140 total]
32768K bytes of processor board System flash (Read/Write)

leafarna
Level 1
Level 1

Sorry this is another topic...

By mistake the command **delete /f /r flash:** was applied on a 9500 cisco switch.

Do you know how to recover the files from the flash ?

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: