Jump to content

Console DELETE command ???


bombz

Recommended Posts

Hello,

I have a folder on my disk2 drive (which has 2 empty sub folders) which I can not delete. I have tried deleting just via Windows (over the LAN). It will not delete the folders. I can re name the folders, but I would like it gone since they are not being used.

 

Is there a command from UnRAID console, to which I can perform this command / task, and finally be rid of these annoying folders/directories that are useless to me.

 

If I can not do it through console, would I physically have to pull the hard disk out, and boot it with unbuntu ? That was my next thought.

 

Thank you.

Link to comment

rm (Linux man page)

or

rmdir (Linux man page)

 

edit: I should add that rmdir directory will only work if the directory is empty.

 

You can go into the directory and check:

 

/disk2/directory >  ls -a

 

If there is a file that starts with a . such as ".cshrc" it may not show up without the -a switch.

 

The alternate method is

 

/disk2/ rm -r *

 

that should delete everything recursively from the current folder (in this example disk2)

Link to comment

I understand the command part, I was trying to mount the disk from UnRaid console, but it was not working, is there specifics to mount / delete ?

 

mount /disk2/ ??

 

what would be the process ?

 

i want to delete

 

disk2/-----/ 

 

(which has 2 sub directories in that folder that are empty)

Link to comment

You're not trying to delete disk2 are you? That is the drive itself which obviously can't be deleted. Taking a drive out of the array is not done by deleting it.

 

The disks are already mounted when the array is started. You will find disk2 by going cd /mnt/disk2

 

Try rm -r <dir_name>

Alternatively, cd into the directory and do rm -r * to delete all the contents of the directory first.

 

You do not want to mount a stopped disk and mess with it. That will break the parity protection.

 

You might need to do a file system check if you can't delete the files from the command line.

 

Peter

 

Link to comment

Ok, i did that command, and it thinks there is a .pdf file in one of the directories, but there is not. I am still trying to figure out why I can not remove it

 

cd /mnt/disk2/

 

disk2#: rm -r app

 

cannot delete app/pii/game_manuals/filename.pdf

no such file or directory

 

very strange :-s

 

I was going to do a clean power down of the server via GUI --- but it is stuck on trying to unmount disk2 now

 

 

Since the unmount was unsuccessful, I was forced to to a hard power down. The directories were not deleted, and now I have to let it complete its parity-sync ... I guess my next method is to pull the drive and boot with ubuntu, and try to delete the directory that way, then pop it back into my server, and do a new parity check, so it stays deleted.

Link to comment

How about rm -rf?

 

Be careful using this, it will forcibly remove what you tell it to do without confirmation, so make sure you've entered the folder you want to delete correctly.

 

ie:

 

cd /mnt/disk2

rm -rf app/

 

(this will remove EVERYTHING from the app/ folder).

Link to comment

Ok, i did that command, and it thinks there is a .pdf file in one of the directories, but there is not. I am still trying to figure out why I can not remove it

 

cd /mnt/disk2/

 

disk2#: rm -r app

 

cannot delete app/pii/game_manuals/filename.pdf

no such file or directory

 

very strange :-s

 

I was going to do a clean power down of the server via GUI --- but it is stuck on trying to unmount disk2 now

It is stuck because you "cd'd" to it. It cannot unmount until you "cd" off of the disk you are trying to unmount.

 

All you needed to do is type

cd /

Since the unmount was unsuccessful, I was forced to to a hard power down. The directories were not deleted, and now I have to let it complete its parity-sync ... I guess my next method is to pull the drive and boot with ubuntu, and try to delete the directory that way, then it back into my server, and do a new parity check, so it stays deleted.

The other possibility is that corruption of the file system has caused the disk to be mounted as read-only.  It would then be impossibly to delete anything until it is corrected and mounted as read/write.
Link to comment

You can do the same things with the disk in unRAID as you can in Ubuntu. unRAID is actually even better because you don't break parity.

 

There are a few possibilities for the failure to delete the directory;

The pdf file was open on a computer on your network - you need to close it.

The disk has corruption - test and repair as described here ->  http://lime-technology.com/wiki/index.php?title=Check_Disk_Filesystems

 

As Joe already posted, disk2 can not be unmounted when you are logged on and are cd'd to disk 2. You needed to log off or just go cd / to get away from that directory.

 

Peter

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...