Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
You sir, just saved my life. <3 – Caleb Gray Feb 11 '12 at 17:47

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.

share|improve this answer
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 '11 at 1:50

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.

share|improve this answer

You must log in to answer this question.

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