I have an ext4 LUKS partition where I "deleted" a file.
(I moved one into other: mv /media/HDD/file1.txt /media/HDD/file2.txt
where both file1.txt and file2.txt already existed).
Files in the directory had consecutive inode numbers so I can guess the one I lost using ls -il
, let's call it 12345678.
I tried find -inum 12345678 -exec gedit {} \;
to open it (which works with the rest of files), but since it only searches in the directory it doesn't work with my lost file.
I tried debugfs (unlocking first: udisksctl unlock -b /dev/sdb
) like this:
~$sudo debugfs /dev/sdb
debugfs 1.45.5 (07-Jan-2020)
debugfs: Bad magic number in super-block while trying to open /dev/sdb
/dev/sdb contains a crypto_LUKS file system
debugfs:
The same happens if don't unlock the partition.
Why does it say "Bad magic number"? How can I make it open the file? Is there any other way to recover my file?
I'm running Ubuntu 20.04.
find -inum 12345678
cannot find any deleted i-node.