Folder cannot be deleted from Trash

I have three nested folders in my trash: folder1/folder2/folder3. They were on an external FAT32 drive but were deleted, along with all the files inside them, a while ago.

When I try to empty the trash on Yosemite, I get a "file in use" error. I get this even after reboots, with no programs open, and nothing which could be using it.

Navigating to /Volumes/External_name/.Trashes/501/folder1/folder2/folder3 with Terminal gives me a very weird error: I call ls and obtain:

username-Mac:folder3 username$ ls
Filename_with_ö.mp3
username-Mac:folder3 username$ ls -l
ls: Filename_with_ö.mp3: No such file or directory

I strongly suspect it's something to do with the interaction between OS X, FAT32, and that ö, but I have no idea how to delete a file which doesn't seem to exist... any ideas?

Solutions tried

Finder > "Secure Empty Trash" still gives me the "file in use" error. "Disk Utility" > "Repair disk" doesn't fix it either. Also tried:

username-Mac:folder3 username$ sudo rm -r F*
rm: Filename_with_ö.mp3: No such file or directory

and

username-Mac:/ username$ sudo rm -r /Volumes/external_name/.Trashes
rm: /Volumes/external_name/.Trashes/501/folder1/folder2/folder3/Filename_with_ö.mp3: No such file or directory
rm: /Volumes/external_name/.Trashes/501/folder1/folder2/folder3: Directory not empty
rm: /Volumes/external_name/.Trashes/501/folder1/folder2: Directory not empty
rm: /Volumes/external_name/.Trashes/501/folder1: Directory not empty
rm: /Volumes/external_name/.Trashes/501: Directory not empty
rm: /Volumes/external_name/.Trashes: Directory not empty

and

username-Mac:folder3 username$ mv Filename_with_ö.mp3 safe.mp3
mv: rename Filename_with_ö.mp3 to safe.mp3: No such file or directory

and

username-Mac:external_name username$ sudo mv .Trashes /external_trashes
mv: .Trashes/501/folder1/folder2/folder3/Filename_with_ö.mp3: No such file or directory
mv: /bin/cp: terminated with 1 (non-zero) status

Still no success.


Solution 1:

I have two suggestions. My first is to try creating a folder called .Trashes elsewhere and moving it such that it would overwrite the original folder; it's possible that this would leapfrog the problem (I used a similar method to fix a problem I was having a few months ago).

Alternatively, if the external drive is FAT32, have you tried booting a Linux distro from a USB drive and using that? Alternatively you could plug the external drive into a Windows machine (Boot Camp/VirtualBox?) and see whether that can delete the offending folder.

Solution 2:

Have you tried rm as root:

sudo rm -r Filename_with*

That command will ask for your administrator password.

Solution 3:

I had this issue and the only solution that worked for me was to format the external HDD the files were originally on. This emptied the trash along with the bathwater.

Solution 4:

The external volumen has corrupted entries, repairing the Volume usually fixes the issue but the Disk Utility GUI may also fail. Try from the command line:

Close all the applications using the Volume, unmount it, mount it back and run:

diskutil verifyVolume /Volumes/external_name
diskutil repairvolume /Volumes/external_name

That should fix the issue.