9

I tried moving some backup files to my trash so that I could free up some space on the backup drive. Using Finder, I was able to empty the trash can with the exception of one directory that remains even though emptying trash raises no error messages.

After searching around I found quite a few examples for forcing the trash can to empty. However I've tried several now and I'm getting the same message.

The directory looks like this:

Domain Users  102 Jan  6 10:35 .
Domain Users  102 Jan  6 10:35 ..
Domain Users  102 Jan  6 10:35 Local Storage

I ran this command to delete that Local Storage folder:

$ sudo rm -r -i Local\ Storage/

And this is the message I get:

rm: Local Storage/: Directory not empty

I also changed the permissions so that I own the folder but that didn't help.

This is the directory I'm working in:

/Volumes/BackUpDrive/.Trashes/862998330/2013-11-26-143907/Macintosh HD/Users/{user}/Library/Application Support/Google/Chrome/Profile 1

I also tried deleting the entire "862998330" folder but that didn't work either so I moved onto deleting each directory and that's where I am now.

Machine stats:

• 27-inch, Mid 2011

• OSX 10.91

  • There are a whole host of gotchas for dealing with Trash files. Is there a reason why you're not letting the Finder take care of the emptying? It has some extra checks to deal with the locking of Time Machine volumes to prevent rm from touching Backups.backupdb – bmike Jan 6 '14 at 21:44
  • I can't delete through through finder. Nothing happens when hitting "empty" – Ryan Rich Jan 6 '14 at 21:58
  • Is there a .DS_Store file in the folder? Finder makes those whenever you enter a directory. – SilverWolf Aug 19 '18 at 12:53
4

First, I would be sure no files are locked

sudo chflags -R nouchg Local\ Storage

Then, assuming you are sure about using sudo and rm -rf on your backup drive, you could tell rm to force things.

sudo rm -rf -i Local\ Storage
  • 2
    Still returns rm: /Volumes/Files/.Trashes/: Directory not empty for me – bafromca Dec 17 '14 at 20:22
1

This is caused by corrupted entries in the drive. The steps below solved my problem.

  1. Open Disk Utility
  2. Choose the partition/drive
  3. Under the First Aid tab click Repair Disk

The file should be gone after this, if not just try empty trash again. It should work.

0

Try booting into Recovery Mode by holding down Cmd+R while rebooting. Then open up a root Terminal in Single User Mode and try executing the command from there.

0

My problem was that the files came from a Windows back up. Thus, all the .Trashes in my hard drive were not recognised by OS. I took my hard drive to a PC, delete all the .Trashes (hidden) files and the problem was solved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .