I'm currently having a close call with a hard lesson!

My 2TB WD Green drive started throwing bad blocks after a year of service. I have recovered all but 82kb of data to an image on a spare 3TB drive using the following commands:

ddrescue --no-split /dev/sda1 /media/store1/store1.img /media/store1/store1.log

Then I ran

ddrescue --direct --max-retries=3 /dev/sda1 /media/store1/store1.img /media/store1/store1.log

Followed by

ddrescue --direct --retrim --max-retries=3 /dev/sda1 /media/store1/store1.img 

I have another empty 3TB drive which can be used for a restore. But I'd quite like some advice first, as this recovery has taken 3 solid days and I wouldn't want to screw it up!

From what I understand, I could restore the image to a disk and then repair the copied bad blocks.. Would that be correct?


Since you didn't copy the whole disk but only the first partition, you have to recreate the partition table first. If you have both drives in your box at the same time, you can use something like this: https://askubuntu.com/questions/57908/how-can-i-quickly-copy-a-gpt-partition-scheme-from-one-hard-drive-to-another Otherwise, just note down the parameters and recreate them exactly on the second drive.

Then you dd your image back onto the first partition of the new drive (no point using ddrescue here). You should run an fsck after that, in case the bad block was in the file system. If it was in the files itself, you can find out which one using the original drive as described here: https://wiki.archlinux.org/index.php/Find_File_that_Owns_a_Given_Block.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.