How can I delete this directory? I did fsck
and it has found some garbage, I looked through these files and there wasn't something important. So I've tried to delete the contents of /lost+found
and everything has gone except this strange directory. I thought that putting it to /tmp
(I can move that dir across the volume) will erase it on next reboot but it's still there after both reboot and another fsck
.
As it seems like the problem is low level and playing with ownership and permissions is not enough, I've made you able to reproduce the issue by yourself. Enjoy!
- This is safe, you will be able to umount image to get rid of these directories on your machine;
- This s not iso-image, this is the result of
dd if=/dev/sda1 of=/files/broken.iso
;
I've made a 15MB archive with the image which is ~1.2GB. You can download and ply with it with the following commands:
cd /tmp
wget https://dl.dropboxusercontent.com/u/22701362/broken.tar.xz
tar xvf broken.tar.xz
mkdir test
sudo mount broken.iso test
cd test
There would be two directories (During the creation of that image it appears that there are two such directories on my disk):
/tmp/test> tree
.
├── 1
│ └── plexus-component-annotations-1.5.5.jar.sha1 [error opening dir]
└── 2
└── #1589030 [error opening dir]
4 directories, 0 files
Good luck with removing these two directories:
/tmp/test> sudo rm -rf *
rm: cannot remove '1/plexus-component-annotations-1.5.5.jar.sha1': Operation not permitted
rm: cannot remove '2/#1589030': Operation not permitted
/tmp/test> sudo chown -R root:root *
chown: changing ownership of '1/plexus-component-annotations-1.5.5.jar.sha1': Operation not permitted
chown: cannot read directory '2/#1589030': Permission denied
/tmp/test> sudo chmod -R 777 *
chmod: changing permissions of '1/plexus-component-annotations-1.5.5.jar.sha1': Operation not permitted
chmod: changing permissions of '2/#1589030': Operation not permitted
chmod: cannot read directory '2/#1589030': Permission denied
Best Answer
One possibility is the immutable flag in the case of ext filesystem. See output of
lsattr
command. If there isi
present, it can be removed withchattr -i filename
In this case, there is something else happening
This seems to work,