Ddrescue: reread only good sectors

data-recoveryddrescue

Before imaging the corrupted filesystem to a file on another hard drive, I decided to dry-run ddrescue (throwing rescued output to /dev/null) just to see how much data is unreadable:

# ddrescue -d -b 4096 -r 3 -f /dev/sda1 /dev/null sda1.log

In the end it took 3 days to finish. Now I'm ready to make a real image, but I don't want to wait another 3 days until it finishes. But, luckily because I have a logfile, is it possible to force ddrescue to rescue only the good sectors and do not touch bad ones?

Having read some documentation, I've came up with the following idea:

# ddrescue -d -b 4096 --fill=+ /dev/sda1 /mnt/sda1.img sda1.log

Will this work? Is there another (preferred) way of rereading only good sectors?

Best Answer

Thoroughly reread ddrescue manual and found out the following option:

-m file
--domain-logfile=file

Restrict the rescue domain to the blocks marked as finished in the logfile file. This is useful if the destination drive fails during the rescue.

So the invocation of ddrescue would look something like this:

# ddrescue -d -b 4096 -m sda1.log /dev/sda1 /mnt/sda1.img logfile2.log
Related Question