17:34 25/06/2006

dead hard-drive (again)

It's happened again: Last week-end, one of my two 200-Gigabyte began to show some bad blocks and I thus started myself to get worried.

I needed some space to try to get any data back from the three reiser4 partitions that are on the dying Seagate Barracuda 200GB, so I got a brand new drive.
The three partitions wouldn't even mount, complaining about unreadable journal blocks .... I started to look around for solutions, as I can't just forget about the 75GB of music. The solution was almost obvious : dd_rescue
The last time a hard drive a hard drive gave up on me, I tried a couple of dd commands, before giving up on him. Indeed, dd stops at the first error encountered. It was obviously no good for recovery purposes.
This time, I just didn't want to give up. I googled around for a solution and found dd_rescue, which just skips the failed segments of data. With my second hard drive in hand mounted as /mnt/backup, i used the following command:

$ dd_rescue -b 4k -l hdb1.log /dev/hdb1 /mnt/backup/hdb1.img

This took three days, discarded 41752KB of corrupted data and generated a 100GB hdb1.img file. Originally, /dev/hdb1 was a reiserfs partition. I then needed to rebuild the reiser4 tree with :

$ fsck.reiser4 --rebuild-tree /mnt/backup/hdb1.img

A few minutes minutes later, the image was considered as a healthy reiserfs partition that I could mount on a loop devive:

$ mount -o loop -t reiser4 /mnt/backup/hdb1.img /mnt/test

All the corrupted data, 110 files, was copied to lost+found, with numeric folder names, and the right filenames .I got more than 99% of my data back. Enough to put a happy smile on my face.

thanks to titov

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Images can be added to this post.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.

More information about formatting options