Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I can't empty the trash of my removable drive. At first it appears to empty it correctly (no error message, the sound is played), but the folder in question stays there.

I tried:

jan@MacBook-Pro /Volumes/JD 2 $ sudo rm -rf .Trashes/

which gives errors like the following:

rm: .Trashes//501: Directory not empty
rm: .Trashes/: Directory not empty

Anyways, I narrowed it down to a .svn file that can't be deleted:

root@MacBook-Pro /Volumes/JD 2/.Trashes/501/CD_10.2009/devel/funghos $ ls -altr .svn
-rwxrwxrwx  1 _unknown  _unknown  690 Oct 21  2009 .svn
root@MacBook-Pro /Volumes/JD 2/.Trashes/501/CD_10.2009/devel/funghos $ rm -f .svn
root@MacBook-Pro /Volumes/JD 2/.Trashes/501/CD_10.2009/devel/funghos $ ls -altr .svn
-rwxrwxrwx  1 _unknown  _unknown  690 Oct 21  2009 .svn

As you can see, no error appears, but the file doesn't get deleted. Huh?

share|improve this question
    
Wow. That file has been around for a while! –  ephsmith Jul 22 '12 at 4:56
    
Did you try sudo rm -f .svn in the second step yet? –  patrix Jul 22 '12 at 10:01
    
@patrix: I run it as root. –  houbysoft Jul 22 '12 at 12:06
    
Do you get an error message if you omit the -f option? –  patrix Jul 22 '12 at 12:17
    
@patrix: just tried, and no, it just doesn't say/do anything. –  houbysoft Jul 22 '12 at 12:26
show 2 more comments

4 Answers

This is due to the MNT_IGNORE_OWNERSHIP flag being set for the drive when mounted. The unknown user and group are exactly what show up when root views files on a drive for which permissions are ignored. When a user views the permissions, the files will show up as their own. I'm surprised you can't delete the .svn file from your own account (not root)

Please see this Ask Different Answer for more direction. Basically, you'll need to uncheck the "Ignore ownership on this volume" checkbox from an inspector on the drive info.

If you can't delete it from your user account, try setting yourself as the file owner with the ignore flag unset.

share|improve this answer
    
Just tried, but there's no box for "Ignore ownership on this volume" -- screenshot –  houbysoft Jul 22 '12 at 12:28
    
Ah, NTFS. OS X doesn't have native write support for NTFS, maybe the FUSE driver has some problems. Can you attach the drive to a Windows box? –  patrix Jul 22 '12 at 16:38
    
@patrix: Yes it worked on a Windows box, I posted it as an answer but can't accept yet :) –  houbysoft Jul 22 '12 at 19:12
add comment

You can do this instruction:

1- Drag the file from your Trash bin to the Desktop.
2- Launch a Terminal
3- Type

cd ~/.Trash && sudo rm -rf [your file path on the desktop]

4- Then press enter and enter your password

share|improve this answer
    
Eh, why do you change into ~/.Trash before running sudo? –  patrix Jul 22 '12 at 9:59
    
Dragging the file to the desktop = copying it to the desktop and deleting it in the old place, which doesn't work... –  houbysoft Jul 22 '12 at 12:29
add comment
up vote 0 down vote accepted

I finally fixed the issue by deleting the file on a Windows machine. Must be a bug in OS X or something?

share|improve this answer
    
not a bug — it appears none of the answers here are 100% correct, which is obviously why you resorted to using this route. –  l'L'l Jul 22 '12 at 20:24
add comment

If you can locate the file in Finder, can bring up the info pane (cmd-i) on that file and check its not locked or has incorrect permissions?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.