Directory not empty

daveeveritt

Registered
Trying to erase a directory that won't go away is is a common problem which I can usually solve, but this time I'm stuck.

I have an empty dir that won't delete. I've tried the following:

  • restarting
  • repair permissions
  • trashing the .DS_Store file
  • option-emtpy trash
  • sudo rm -rf, rm -fdr and rmdir -R
  • renaming and moving the dir
  • trying to replace it with one the same name ('in use...')
  • making sure owner and group are correct
  • using Cocktail ('not empty...')

It contained another problematic directory with no icon which froze when opening (while disc working) forcing a power-key shutdown. I managed to delete that using the above, but it has now reappeared in the trash and will not delete ('in use...').

I'm on the verge of doing a clean install, which I don't really have time for... so any advice is welcome (but please note I've tried all the usual things!)
 
I was about to suggest restarting (it helped me on a similar case), but it was on your list. Have you checked what the file (files) is with ls -lsa ?

If you find a file, you could try

Code:
$ls -lsai
$find . -inum 12345 -exec rm '{}' \;

where 12345 is the number on the weird file's line.

This helps in the case where the file has name that is hard if not possible to type, for example if it contains control characters.
 
What is the directory name? Are you using Boot Camp to run Windows as well? If so, could the problematic directory be a directory that's in the Recycle Bin of the Windows partition, and not something from the Mac side?
 
Thanks - that's useful. I think I've found the problem. I looked in the logs and found multiple I/O errors - it seems my hard drive is on the way out, and this was the first sign.
 
Back
Top