PDA

View Full Version : rm -rf can't delete files


Don_T
10-30-2009, 06:23 PM
There are three directories that I can't delete on my network attached storage.
I have used rmdir with result of "directory not empty"
I have used rm -rf both as sudo and logged in as root with result of:

Don:Logos don$ rm -rf /Volumes/NAS_Don-1/ToDelete/cantdelete1
rm: /Volumes/NAS_Don-1/ToDelete/cantdelete1: Directory not empty

When listed here is what I get:

Don:Logos don$ ls -la /Volumes/NAS_Don-1/ToDelete/cantdelete1
ls: .DS_Store: No such file or directory
total 0
drwxrwxrwx@ 3 don don 264 Oct 30 15:51 .
drwxrwxrwx@ 5 don don 264 Oct 30 16:40 ..

I have also tried to use "cocktail" can't delete and have attempted to change permissions and still can't delete.

Please help these directories are driving me crazy.

hayne
10-30-2009, 08:22 PM
Don:Logos don$ ls -la /Volumes/NAS_Don-1/ToDelete/cantdelete1
ls: .DS_Store: No such file or directory
total 0
drwxrwxrwx@ 3 don don 264 Oct 30 15:51 .
drwxrwxrwx@ 5 don don 264 Oct 30 16:40 ..

The fact that 'ls' gives you a message about a file not being found (when you list a directory) would seem to indicate that there is filesystem corruption.
So I'd try using whatever filesystem repair utilities you have for that NAS.

fracai
10-30-2009, 11:11 PM
This may not be filesystem corruption. I've experienced similar behavior when connected to an AFP share. Occasionally, the filesystem would seem to get out of sync with what was really available. In the Finder, browsing files in the folder would cause them to disappear. Listing the directory in the Terminal would cause errors about files not existing.

The solution was always to unmount the drive and reconnect. Apparently this would force a refresh that corrected the local cache.

Try un-mounting the NAS or even cycling the power on it.

Don_T
11-02-2009, 11:56 AM
Thank you for the suggestions. My file system repair software is embarrassingly out of date and therefore useless. I did try rebooting the drive and having the NAS check the file system. No luck the files were still there.

Problem solved. I was able to log in to the NAS through FTP from home and was able to delete the directories with no problems. Strange.