Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a directory in my filesystem. If I do an ls -a in the directory, I get nothing (not even ./ and ../). If I do an rmdir, I get told that the directory is not empty. rm -rf gives the same "not empty" error. I tried to use mv to change its name. This produced an Input/output error, but was apparently successful.

Say that I don't care about the contents, I just want to clean it up. What can I do?

OSX Tiger, in a FileVault home directory (if it matters).

EDIT: more diagnostics, as suggested by gbarry. As I said, the mv was apparently successful, so the directory is called foo now.

$ ls -ld foo
drwxr-xr-x   3 repton  repton  102B May 30  2007 foo/
$ stat foo
234881029 39016 drwxr-xr-x 3 repton repton 0 102 "Jul  9 12:00:10 2009" "May 30 03:24:34 2007" "Jan 21 16:55:53 2008" 4096 0 0 foo
$ file foo
foo: directory
$ du -h foo
  0B    foo
share|improve this question
up vote 2 down vote accepted

In Tiger, a FileVault disk is a sparse image. (After upgrading to Leopard it's still such sparse image, but when creating a new FileVault in Leopard, you'll get a sparse bundle instead. The latter works better with Time Machine.)

Did you try to run Disk Utility on that image? See Apple's Mac OS X 10.3, 10.4: FileVault - How to verify or repair a home directory image for detailed instructions. (Or, if for some reason you cannot use that, maybe hdiutil verify.)

share|improve this answer
    
I will have a go with Disk Utility later today (I need to use the computer right now). What does hdiutil attach do? – John Fouhy Aug 17 '09 at 22:09
    
It mounts the disk image, and then by default verifies it. In fact, I guess one could better use hdiutil verify instead (I'll change my answer). But: no need for any of those command line commands if you're trying Disk Utility. – Arjan Aug 17 '09 at 22:15
    
I followed the instructions on that Apple page. When I tried to open the .sparseimage, OSX said it was damaged and opening it might break my system :-/ so I made a copy (65GB over the network.. ugh.) and then opened it. No trouble. Disk repair fixed some issues. I had some trouble resetting the permissions (changing the ownership of my home directory back to my username wouldn't "stick", until I tried setting to my username, then back to admin, then back to my username again), but all seems well now, and the directory is working again. Thanks. – John Fouhy Aug 18 '09 at 22:15
    
Good it was solved. Too bad one still needs some kind of sysadmin skills to get it done. – Arjan Aug 19 '09 at 7:07

Before deleting, ask it how much is being used (since it's "not empty"). Be careful it isn't like a link to the root directory or something.

Is the name of the directory reasonable or is it blank or funny characters? Also try other commands to describe it. ls -ld funnydir , stat funnydir , and file funnydir should all tell you "it's a directory".

If there's really something wrong, an fsck or equivalent "check the directory structure" command might fix it (as you can see I don't know much about OS X proper yet).

share|improve this answer
    
See my post edit. – John Fouhy Aug 17 '09 at 22:06

You probably need to repair the hard drive using the Disk Utility. I had a similar problem with one file staying in trash even after forcing it to empty (the system kept saying it was in use). After repairing the disk I was able to delete the file.

share|improve this answer

Have you tried disabling FileVault, deleting the directory, and re-enabling FileVault?

FileVault might not be able to decrypt the directory on-the-fly (for whatever reason), so you're able to see it, but not do anything with it. Disabling FileVault will force it to batch-decrypt everything, allowing the OS to directly access the disk.

share|improve this answer
1  
I have not ... but I've got 60GB in here, so that seems like a process that will take a long time. I'll give it a try if no one else comes up with an idea (maybe overnight in stages). – John Fouhy Aug 17 '09 at 4:32

You must log in to answer this question.

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