/home partition recovered

I was able to recover the /home partition from the disk that Windows clobbered a week ago.  Windows overwrote the partition table, and none of the usual methods I’ve used for data recovery were able to find it, nor was gpart.  I ended up writing a program to scan for likely ext2/ext3 superblocks, identified the right one, then dd’d the contents of the drive from two sectors prior to the superblock into a file.  Then I was able to mount that as a filesystem via the loopback interface.  Worked like a charm.  A lot of hassle, though.  There wasn’t anything too important on the partition, but it was still nice getting it back.

I need to set up an automated backup system for my laptop, so that when I go home I just plug it into the network and it gets backed up.

This entry was posted in Disaster recovery, Linux. Bookmark the permalink.

2 Responses to /home partition recovered

  1. Tom Harrison says:

    “I ended up writing a program to scan for…” Well, I’m impressed. The only time I had to recover a lost partition (after I screwed up the partition table somehow), parted found it. If it had not, I would have given up.

  2. Eric says:

    I think the reason that the available tools couldn’t find it may have been that it was actually an LVM logical volume. I don’t see much reason for using LVM on my laptop, but the Fedora installer did that by default, and I didn’t bother to change it. Fortunately the LVM clusters comprising the logical volume were all contiguous; otherwise I would have had to write a much more sophisticated program to try to find the LVM metadata (assuming that it hadn’t been corrupted).

    Regular backups is clearly the correct solution, rather than spending lots of time hacking up new code for recovery.

Leave a Reply