I was experimenting with encryption on an ext4 filesystem and I encrypted a file (using
fscrypt) which was set to be immutable (via
chattr +i). I have now lost the encryption key and uninstalled
I would like to delete the file, but when I try to delete it, I get the following error:
# rm foo rm: cannot remove 'foo': Operation not permitted
and when I try to make it mutable:
# chattr -i foo chattr: Required key not available while reading flags on foo
Therefore, I believe I cannot delete the file as it is immutable and I cannot change its attributes due to encryption. Any suggestions?
I have tried the following and they do not work:
- Deleting/modifying the files from a Live USB. The same errors occur.
- Trying after removing the
encryptfeature, as Ángel suggested.
fsckalso doesn't throw any errors for some reason.
foo) and filesystem properties:
$ findmnt --target testdir TARGET SOURCE FSTYPE OPTIONS / /dev/sda4 ext4 rw,relatime # tune2fs -l /dev/sda4 | grep "Filesystem features" Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum