5

I have a corrupted ext4 file system that had ~7 TiB of data on it. Using photorec, I was able to recover usable data, but all the filenames are gone. Is there a tool that would let me recover the file names? Getting the actual data back would be a plus but not strictly necessary.

3 Answers 3

6

I managed to rescue not only the filenames, but (almost) the entire file system using the (magical!) debugfs tool. It's essentially an interactive interface to low level file system operations. It wouldn't "open" my file system with a corrupted superblock, but has a magical "catastrophic" mode (-c flag) that skips it and directly inspects the contents.

$ debugfs -c -b 4096 -s 32768 /dev/vg0/data_lv_snapshot

(open in catastrophic mode, block size is 4096, use alternate superblock at 32768).

After that, "ls" showed my directory contents. The magical "rdump" command let me recover almost all my files by recursively dump a subtree onto a known good file system. It even has a "-f" flag to execute a script, so I can automatically dump different subtrees onto different disks over the course of several days.

2
  • You sir, just saved my life. <3
    – Caleb Gray
    Feb 11, 2012 at 17:47
  • it is an unreal but true saver. thanks a lot! Jul 2, 2023 at 11:22
0

Were you using a photo organizer (e.g. Picasa/F-Spot/Shotwell)? Maybe they stored some information in the file itself. Maybe you can recover this using that tool and importing the files, or by figuring out what data was stored there.

Or maybe you have a database for that application, e.g. a Thumbs.db or something that contains the file names.

Or if the files are JPEGs, maybe there is some information in the EXIF header. There are several tools to extract this, e.g. libjpeg-tools, exif, exifprobe, and exiftags.

1
  • Thanks, but alas, most of my files are not photos. I have a number of .avi videos and random data files (.pdf, .zip, etc). I'm not as concerned with recovering the files themselves as I am about retrieving the index. Does anyone know how exactly ext4 stores its directory listings?
    – stuyguy
    May 13, 2011 at 1:50
0

Picking a random photo from my camera, the filename is "100CANON/IMG_0015.JPG", and I see that in the EXIF data there is a field called "File number" that says "100-0015". So if I lost this set of photos and used photorec to recover just the file data without the file names, I could recover the file names from this field of the EXIF data. Different camera brands and models may or may not save sufficient data to recover the file names.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .