Cannot delete attribute file in mac os X
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 ?
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
tobadtrash
- 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.