lsattr: Permission denied While reading flags on directory

5,076

I had a similar problem on an ext4 filesystem.

The solution was: unmount filesystem, use debugfs in interactive mode. It is similar to a shell and allows to do many operations bypassing all permissions, including deleting files and directories.

Share:
5,076

Related videos on Youtube

Grief
Author by

Grief

Updated on September 18, 2022

Comments

  • Grief
    Grief over 1 year

    This question is risen from Undeletable directory in lost+found

    I have a directory which I cannot delete and it seems like the reason of that is wrong attrbiutes ('immutable' on that dir or 'append only' on the parent one or something like that), but I cannot even list permissions of that dir:

    /tmp/2 sudo lsattr
    lsattr: Permission denied While reading flags on ./#1589030
    

    How is it possible and what could be the reason?

    UPDATE In the original question, there were steps to reproduce:

    cd /tmp
    wget https://dl.dropboxusercontent.com/u/22701362/broken.tar.xz
    tar xvf broken.tar.xz
    mkdir test
    sudo mount broken.iso test
    sudo lsattr test/2
    

    While it was reported that it returns

    ---D-ad--j--T--- 2/#1589030 
    

    On both my machine and my work station in returns:

    lsattr: Permission denied While reading flags on test/2/#1589030