cannot delete file and directory in Cisco 2960x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 05:23 AM
Hi Geeks,
I have a crashed 2960x switch and I am trying to upgrade the ios, when transferring file thru console flash is full.
I cannot delete file or directory.
below are the errors I got when deleting.
switch: rmdir flash:/c2960x-universalk9-mz.150-2a.EX5
Are you sure you want to remove "flash:/c2960x-universalk9-mz.150-2a.EX5" (y/n)?
y
Directory "flash:/c2960x-universalk9-mz.150-2a.EX5" not removed -- directory not
empty
switch: delete /force flash:/c2960x-universalk9-mz.150-2a.EX5
Are you sure you want to delete "/force" (y/n)?y
File "/force" not deleted -- no such device
switch: delete /force /recursive flash:/c2960x-universalk9-mz.150-2a.EX5/
Are you sure you want to delete "/force" (y/n)?y
File "/force" not deleted -- no such device
Are you sure you want to delete "/recursive" (y/n)?y
File "/recursive" not deleted -- no such device
Are you sure you want to delete "flash:/c2960x-universalk9-mz.150-2a.EX5/" (y/n)
?y
File "flash:/c2960x-universalk9-mz.150-2a.EX5/" not deleted -- is a directory
switch: delete <c2960x-universalk9-mz.150-2a.EX5>
Are you sure you want to delete "<c2960x-universalk9-mz.150-2a.EX5>" (y/n)?y
File "<c2960x-universalk9-mz.150-2a.EX5>" not deleted -- no such device
Anyone knows the exact command for this.
Cheers!
- Labels:
-
Network Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 06:22 AM
You should be able to delete the file by typing;
delete flash:/c2960x-universalk9-mz.150-2a.EX5
Does the 'dir' command, when in the flash directory show that your flash is full?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 05:30 PM
switch: delete flash:/c2960x-universalk9-mz.150-2a.EX5
Are you sure you want to delete "flash:/c2960x-universalk9-mz.150-2a.EX5" (y/n)?
y
File "flash:/c2960x-universalk9-mz.150-2a.EX5" not deleted -- is a directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 10:33 AM - edited 07-06-2019 10:40 AM
Some switches do put ios inside of a folder on flash. show boot or show system boot to see ios location. based on output, u may have something like this:
boot flash:/c2960x-universalk9-mz.150-2a.EX5/c2960x-universalk9-mz.150-2a.EX5.bin
- ios ,bin is inside of a folder , usually same name as ios .bin
"directory not empty" --this error means u have file or files inside of a directory. u must go to directory first, then delete all files inside, then exit and remove directory.
cd - move u to folder, so cd flash:/c2960x-universalk9-mz.150-2a.EX5
then do dir to see what files are in there, then u can delete them, I think delete *.* should work to remove all files.
all those are Linux based commands
cd - moves to folder
pwd - show u current location /directory.
Regards, ML
**Please Rate All Helpful Responses **
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 05:34 PM
Appreciate it but still no to avail
switch: cd flash:/c2960x-universalk9-mz.150-2a.EX5
Unknown cmd: cd
switch: pwd
Unknown cmd: pwd
below are the only available commands, but I cannot successfully use the delete command.
switch: help
? -- Present list of available commands
boot -- Load and boot an executable image
cat -- Concatenate (type) file(s)
copy -- Copy a file
delete -- Delete file(s)
dir -- List files in directories
flash_init -- Initialize flash filesystem(s)
format -- Format a filesystem
fsck -- Check filesystem consistency
help -- Present list of available commands
memory -- Present memory heap utilization information
mkdir -- Create dir(s)
more -- Concatenate (display) file(s)
ping -- Send ICMP ECHO_REQUEST packets to a network host
rename -- Rename a file
reset -- Reset the system
rmdir -- Delete empty dir(s)
set -- Set or display environment variables
sleep -- Pause (sleep) for a specified number of seconds
type -- Concatenate (type) file(s)
unset -- Unset one or more environment variables
-- MORE --
version -- Display boot loader version
switch:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2019 04:48 PM
format flash is last result sort of thing and I would not use it on older models. you cannot replace flash on switches.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 05:07 AM
we have exact same problem. I tried most of the answers above however still unable to delete it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 01:45 PM
Delete what?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 06:48 PM
@jnd23 wrote:
switch:
Look at the prompt. It is a ":" and not a "#". This means the switch is in ROMMON. If you want to delete everything in the flash, the command to use is "format flash:".
If you want to delete a file, in ROMMON, the command is "delete flash:c2960x-universalk9-mz.150-2a.EX5/filename.bin".
Wildcards are not accepted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 08:19 PM
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 09:43 PM
@jnd23 wrote:
formatted the flash and now transferring the new ios via console xmodem.
How quaint.
Look at the appliance. Can you see the USB port? It is a lot faster to transfer the IOS file from a thumb drive to the appliance via USB.
The USB port will even allow booting a USB even from ROMMON using the command "boot usb0:filename.bin".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2019 10:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 11:18 PM
Hi jnd23
I believe it is resolved, but you can use the command:
Switch# delete /force /recursive flash:/c2960x-universalk9-mz.150-2a.EX5
Have a nice day
