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

One possibility is the immutable flag in the case of ext filesystem. See output of lsattr command. If there is i present, it can be removed with chattr -i filename

A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

In this case, there is something else happening

This seems to work,

> lsattr 1
-----a---------- 1/plexus-component-annotations-1.5.5.jar.sha1
> rmdir 1/plexus-component-annotations-1.5.5.jar.sha1
rmdir: failed to remove '1/plexus-component-annotations-1.5.5.jar.sha1': Operation not permitted
> chattr -a 1/plexus-component-annotations-1.5.5.jar.sha1
> rmdir 1/plexus-component-annotations-1.5.5.jar.sha1

> lsattr 2
---D-ad--j--T--- 2/#1589030 
> chattr -D -a -d -j -T 2/\#1589030
> rmdir 2/\#1589030

try becoming the user that owns it to delete it

sudo -u 6666 -g 19312 rm -rf ./#1589030