Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Suddenly some *attributes files started to appeared in the trash folder of my mac os x (snow leopard).

The problem is I can't delete them.

// 1. See there is a file with an invalid name 
MAC:libs cran$ ls
commons-io-2.0.1.jar:com.dropbox.attributes

// 2. That I can't delete  
MAC:libs cran$ rm commons-io-2.0.1.jar\:com.dropbox.attributes 
rm: commons-io-2.0.1.jar:com.dropbox.attributes: No such file or directory

// 3. The only file here
MAC:libs cran$ ls -a
.
..
commons-io-2.0.1.jar:com.dropbox.attributes

// 4. But I can't do anything with it
MAC:libs cran$ ls -l
ls: commons-io-2.0.1.jar:com.dropbox.attributes: No such file or directory

// 5. Trying to delete parent folder
MAC:iome.desktop cran$ rm -rf libs
rm: libs: Directory not empty

// 6. Trying to use wildcards 
MAC:libs cran$ rm commons-*
rm: commons-io-2.0.1.jar:com.dropbox.attributes: No such file or directory

// 7. Trying to delete parent folder
MAC:iome.desktop cran$ rmdir libs
rm: libs: Directory not empty

// 8. Retrieving the inode
MAC:libs cran$ ls -i
ls: commons-io-2.0.1.jar:com.dropbox.attributes: No such file or directory
3408401 commons-io-2.0.1.jar

// 8. Remove the file by inode
MAC:libs cran$ find . -inum 3408401 -exec rm -i {} \;
remove ./commons-io-2.0.1.jar? y
find: ./commons-io-2.0.1.jar:com.dropbox.attributes: No such file or directory

// 9. Repair the disk permission 

// 10. Fix the ACL (while booting from an external drive)

I ran a fsck -fy hoping that it would clean them, but to no avail. I want to install bootcamp on my computer. But now that I feel that the filesystem is messed, I'm a bit afraid about creating new partitions and whatnot.

I tried to use xattr to remove the file, but once again, to no avail :

MAC:libs cran$ touch commons-io-2.0.1.jar

// a. Trying to remove attr 
MAC:libs cran$ xattr -d com.dropbox.attributes commons-io-2.0.1.jar 
xattr: commons-io-2.0.1.jar: No such xattr: com.dropbox.attributes

// b. Trying to remove attr 
MAC:libs cran$ xattr -d com.dropbox commons-io-2.0.1.jar 
xattr: commons-io-2.0.1.jar: No such xattr: com.dropbox

I ran all those tests in normal mode and single user mode. Do you know how I can get rid of those files ?

share|improve this question
    
find -delete didn't work either? –  Daniel Beck Jan 29 '13 at 16:46
    
I haven't tested it. But find ... rm didn't. Fortunately, I don't have the files anymore :) –  Name is carl Jan 29 '13 at 17:44

2 Answers 2

up vote 1 down vote accepted

My hat off to the genuises of the Apple Store of Lyon Part Dieu, France.

The rationale behind the solution is : if you can't delete something, try to move it some other place.

What Adrien and Vincent did :

  • rename .trash to badtrash
  • create another .trash folder. Now my trash is working as expected but the undeletable files are still on my computer. But wait, there is more :)
  • boot the mac from another system located on an external harddrive
  • change the permission of badtrash so it can be deleted
  • delete badtrash
  • empty the trash

Tadah !

Now my undeletable files are now on the external drive. Which is not a problem : neither for me, neither for Adrien and Vincent as the external drive will be reformatted soon.

Classy solution, eh ?

Thanks to the great Apple store team at Lyon Part Dieu.

share|improve this answer

While in that directory, try:

rm commons

and then press the Tab key (this should autocomplete the file name) and after that Enter.

Disclaimer: I am not sure if deleting such files could cause any trouble.

share|improve this answer
    
Thanks for your reply. I did that (see 2.) but unfortunately it doesn't work. –  Name is carl Jan 27 '13 at 18:53
    
I didn't realize that it came from autocomplete. What if you try rm commons*? or if you delete the whole directory from one level up? –  lupincho Jan 27 '13 at 18:55
    
Unfortunately, it didn't work either (I updated the question with 5, 6 and 7). But nice ideas, by the way. –  Name is carl Jan 27 '13 at 19:02
    
Also, what xattr option did you try? One thing that I am not sure is what happens with the extended attributes when the original file is missing, this may have something to do with the problem and you may need to create a fake original file to delete the atributes with xattr, say touch commons-io-2.0.1.jar and then xattr -c commons-io-2.0.1.jar –  lupincho Jan 27 '13 at 19:02
    
Already did that. But it failed too. Somehow I feel I have to use low level utils : directly manipulating inodes or something like that. Because the file is obviously invalid so I doubt that the file system could return a valid file descriptor for my attributes files... –  Name is carl Jan 27 '13 at 19:10

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.