ext4magic does not recognize directory
Sebastian Wright
Situation
I deleted a great number of files with Ranger and now I am trying to use ext4magic to recover them. I am on Ubuntu 20.04, and I am not a power user. :)
I have a single drive with two partitions where I store everything on sda2 only.
user@machine$ mount | grep /dev/sd
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)Now, the files I deleted were under /home/username/Downloads/compressed.
Preparation
In order to ext4magic even consider this drive I had to do the following (based on this answer):
- Launch recovery at boot and choose 'root mode'
- Mount an external drive and navigate to there
- Change the
sda2status to read-only withmount -o remount,ro /dev/sda2 - run ext4magic
Problem
ext4magic does not seem to recognize the directory where I deleted the files.
root@barat:/mnt# ext4magic /dev/sda2 -a $(date -d "-1 days" +%s) -f home/username/Downloads/compressed -l
Filesystem in use: /dev/sda2
Using internal Journal at Inode 8
Activ Time after : Wed Mar 3 19:36:06 2021
Activ Time before : Thu Mar 4 19:36:06 2021
Warning: error-NR 2133571476 can not found file: home/username/Downloads
Error: Inode not found for "home/username/Downloads/compressed"
Check the valid PATHNAME "home/username/Downloads/compressed" and the BEFORE option "Thu Mar 4 19:36:06 2021"
ext4magic : EXIT_SUCCESSTo be more precise, it does not recognize its 'parent' directory (i.e. "Downloads").
Strangely, however, it does show me a list of files when I try it on the home directory (that is, one of its parent):
ext4magic /dev/sda2 -a $(date -d "-1 days" +%s) -f home/username -lThis list contains files from other subdirectories of the home folder (e.g. .local) and it seems to show files deleted much earlier. However, I do not see any mention of files from the "Downloads" directory.
(There is a similar issue in this post, but without any error message and without an answer).
Question
What is happening here and what can I do to recover the deleted files?
Update
I also tried to use debugfs (and there 'lsdel') to find deleted inodes (based on this answer) but it came up empty.