Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

ext4magic does not recognize directory

Writer 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):

  1. Launch recovery at boot and choose 'root mode'
  2. Mount an external drive and navigate to there
  3. Change the sda2 status to read-only with mount -o remount,ro /dev/sda2
  4. 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_SUCCESS

To 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 -l

This 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.

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy