cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
277390
Views
163
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

Craig Norborg
Level 4
Level 4

Yes, either the /recursive or using "rmdir" instead of "delete" will do it.

glen.grant
VIP Alumni
VIP Alumni

Use "delete /force /recursive flash: "

I'm running into the same issue with a number of my switches, but none of the fixes above work.

rmdir:

uta-146-gsw3#rmdir flash:update

Remove directory filename [update]?

Delete flash:update? [confirm]

%Error Removing dir flash:update (Device or resource busy)

delete /recursive:

uta-146-gsw3#delete /recursive flash:update

Delete filename [update]?

Examine files in directory flash:update? [confirm]

Delete flash:update? [confirm]

%Error Removing dir flash:update (Device or resource busy)

delete /recursive /force:

uta-146-gsw3#delete /recursive /force flash:update

Doesn't show an error message, but when I look at what's on the flash, the directory is still there:

uta-146-gsw3#dir flash:

Directory of flash:/

2 -rwx 796 May 15 2009 15:49:49 -04:00 vlan.dat

3 -rwx 2072 May 15 2009 15:52:15 -04:00 multiple-fs

4 drwx 192 Feb 28 1993 19:25:28 -05:00 c2960-lanbasek9-mz.122-44.SE2

7 -rwx 26205 May 15 2009 15:52:15 -04:00 config.text

8 drwx 0 May 19 2009 10:29:28 -04:00 update

9 -rwx 3828 May 15 2009 15:52:15 -04:00 private-config.text

32514048 bytes total (22191104 bytes free)

Glad to see you fixed it.

It appears a lot like bug CSCsc41813, but occurs with a 2960 12.2(35)SE5. Waiting for 24 hours or so seems to clear the undeletable directory.

Can I ask that you retry your command adding a '/' in place as follows:

rmdir flash:/update

Let us know if that sorts your problem out?

EDIT: aaah, see you fixed it anyway (you edited your 1st post). Well done :)

Nope, doesn't work either:

uta-146-gsw3#rmdir flash:/update

Remove directory filename [update]?

Delete flash:/update? [confirm]

%Error Removing dir flash:/update (Device or resource busy)

uta-146-gsw3#rmdir flash:/update/

Remove directory filename [/update/]?

Delete flash:/update/? [confirm]

%Error Removing dir flash:/update/ (Device or resource busy)

I'm reloading the switch tonight and trying again tomorrow.

Leo Laohoo
Hall of Fame
Hall of Fame

Try format flash:

To save the VLAN database, do the following:

vlan datatbase

exit

To save your config, just do write mem.

Don't forget to copy the IOS back to the appliance.

Hope this helps.

Greg Matthews
Level 1
Level 1

Having the same problem but on a WS-CBS3020-HPQ.

Originally started with an attempted IOS upgrade:

#archive download-sw /overwrite tftp://10.xx.xx.xx/cbs30x0-ipbasek9-tar.122-50.SE1.tar flash: ?
 

#archive download-sw /overwrite tftp://10.xx.xx.xx/cbs30x0-ipbasek9-tar.122-50.SE1.tar flash:
Loading cbs30x0-ipbasek9-tar.122-50.SE1.tar from 10.25.167.176 (via Vlan32): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 12144640 bytes]

Loading cbs30x0-ipbasek9-tar.122-50.SE1.tar from 10.25.167.176 (via Vlan32): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Could not buffer tarfile...using multiple downloads
examining image...
extracting info (110 bytes)
extracting cbs30x0-ipbasek9-mz.122-50.SE1/info (389 bytes)
extracting info (110 bytes)

Stacking Version Number: 1.41

System Type:             0x00000000
  Ios Image File Size:   0x0094C200
  Total Image File Size: 0x00B95200
  Minimum Dram required: 0x08000000
  Image Suffix:          ipbasek9-122-50.SE1
  Image Directory:       cbs30x0-ipbasek9-mz.122-50.SE1
  Image Name:            cbs30x0-ipbasek9-mz.122-50.SE1.bin
  Image Feature:         IP|LAYER_3|SSH|3DES|MIN_DRAM_MEG=128

examining image...
%Error, "flash:" is a directory.
%Error, "flash:" is a directory.
%Error opening flash:update/info (No such file or directory)
ERROR: Malformed `info' file.
ERROR: Image is not a valid IOS image archive.

Unable to delete temp dir "flash:update"
#dir
#dir flash
#dir flash:
Directory of flash:/

    2  -rwx        3136  Mar 15 2010 13:59:52 +11:00  vlan.dat
    3  -rwx        8853   May 5 2010 11:10:38 +10:00  config.text
    4  -rwx        8746   May 5 2010 11:10:38 +10:00  private-config.text
    5  drwx           0   May 5 2010 11:13:31 +10:00  update
    6  -rwx        2072   May 5 2010 11:10:38 +10:00  multiple-fs
  473  drwx         192  Feb 13 2008 06:33:40 +11:00  cbs30x0-lanbasek9-mz.122-37.SE1

32514048 bytes total (24393216 bytes free)
#

Tried all the recommendations:

#rm
#rmdir fl
#rmdir flash:update
Remove directory filename [/update/update]?
Delete flash:/update/update? [confirm]
%Error Removing dir flash:/update/update (No such file or directory)
#
#rm
#rmdir fl
#rmdir flash:/update
Remove directory filename [update]?
Delete flash:/update? [confirm]
%Error Removing dir flash:/update (Device or resource busy)
#
#
#
#del
#delete /r
#delete /recursive /f
#delete /recursive /force fl
#delete /recursive /force flash:update
#delete /recursive /force flash:update
#
#
#dir
#dir flash
#dir flash:
Directory of flash:/

    2  -rwx        3136  Mar 15 2010 13:59:52 +11:00  vlan.dat
    3  -rwx        8853   May 5 2010 11:10:38 +10:00  config.text
    4  -rwx        8746   May 5 2010 11:10:38 +10:00  private-config.text
    5  drwx           0   May 5 2010 11:13:31 +10:00  update
    6  -rwx        2072   May 5 2010 11:10:38 +10:00  multiple-fs
  473  drwx           0   May 5 2010 11:14:32 +10:00  cbs30x0-lanbasek9-mz.122-37.SE1

32514048 bytes total (32488448 bytes free)
#
#
#del
#delete /r
#delete /recursive /f
#delete /recursive /force fl
#delete /recursive /force flash:/update
#
#dir
#dir flas
#dir flash:
Directory of flash:/

    2  -rwx        3136  Mar 15 2010 13:59:52 +11:00  vlan.dat
    3  -rwx        8853   May 5 2010 11:10:38 +10:00  config.text
    4  -rwx        8746   May 5 2010 11:10:38 +10:00  private-config.text
    5  drwx           0   May 5 2010 11:13:31 +10:00  update
    6  -rwx        2072   May 5 2010 11:10:38 +10:00  multiple-fs
  473  drwx           0   May 5 2010 11:14:32 +10:00  cbs30x0-lanbasek9-mz.122-37.SE1

32514048 bytes total (32488448 bytes free)
#

delete /f /r flash:update

Don't forget to rate our post.  Thanks.

vvasisth
Level 1
Level 1

delete /force /recursive flash:

HI,

Using delete /f /r flash:update does not remove the flash:update file. Can anyone Guarantee that if i reload the switch that the switch will come back up as per normal without any issues, then i can try the upgrade again. I only have remote access to the relevant switch. Below is the output from the switch:

NZWLGUNI16SW02#delete /f /r flash:update

NZWLGUNI16SW02#

NZWLGUNI16SW02#sh flash:

Directory of flash:/

    2  drwx         512   Mar 1 1993 13:02:11 +13:00  c2960-lanbasek9-mz.122-44.SE6
  544  -rwx       19567  Apr 16 2011 18:30:51 +12:00  config.text
  545  -rwx         616   Mar 1 1993 13:00:37 +13:00  vlan.dat
  546  -rwx        1918  Apr 16 2011 18:30:51 +12:00  private-config.text
  547  drwx         512  Apr 16 2011 18:50:50 +12:00  update
  548  -rwx        2072  Apr 16 2011 18:30:51 +12:00  multiple-fs

27998208 bytes total (17224704 bytes free)
NZWLGUNI16SW02#

NZWLGUNI16SW02#sh boot
BOOT path-list      : flash:/c2960-lanbasek9-mz.122-44.SE6/c2960-lanbasek9-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   :
NVRAM/Config file
      buffer size:   65536
Timeout for Config
          Download:    0 seconds
Config Download
       via DHCP:       disabled (next boot: disabled)
NZWLGUNI16SW02#

Thanks

BOOT path-list      : flash:/c2960-lanbasek9-mz.122-44.SE6/c2960-lanbasek9-mz.122-44.SE6.bin

Ryan,

Firstly, don't worry about this.  The new switches are alot smarter than the older 2900/3500XL series.  If the file in the boot string is not found the switch will search for the first IOS file it can find.

Can anyone Guarantee that if i reload the switch that the switch will come back up as per normal without any issues,

Sure.  I can "guarantee" that.  But if I'm wrong what can you do?  I don't work for Cisco and I'm here posting on my free time.  Common rule when dealing with anything:  If you don't know what you're doing then don't do it.

NZWLGUNI16SW02#delete /f /r flash:update

I can only think of only one reason why you can't delete the "update" sub-directory:  You are probably using the "archive download-sw" command and the process is still on-going.

In order for your switch to boot up properly, you'll need to make sure that the subdirectory of "c2960-lanbasek9-mz.122-44.SE6" contains a valid IOS BIN file.

First i need to say Hello to all because i am new here. so Hello;]

leolaohoo you are right he probably using "archive download-sw" command. Same thing happens to me. When i was pissed enough i finally use "erase flash" command and next xmodem to download new OS and it working great.

But it takes ages to download it. After start new OS no more problems with "archive download-sw" command again.

Sorry for my english.

Review Cisco Networking for a $25 gift card