Recovering embedded ext4 filesystem -thousands of partitions

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read
Posts: 1
Joined: 04 Jun 2013, 23:27

Recovering embedded ext4 filesystem -thousands of partitions

#1 Post by ext4collector »


I lost an ext4 partition in a dd image (stored in a file in my rootfs) in /foo/bar/my.img.
A crash corrupted the directory entry "bar" that stored the image, but the image itself should still be intact.
testdisk's disk restore identifies the ext4 when using deep search, but it also finds several thousand false positives (ext4 headers, I guess).

Is there an easy way to sort these unmountable filesystems from the output?

Can I try to run a for loop to mount the ext4 fs using offset= or similar?

I have a /log with the found partitions and offsets, but I can't get /sbin/mount -t ext4 -o offset= to work.

Any help would be greatly appreciated - thanks!