Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
I thought it didn't even try to reread at all by default... In fact, you told it to retry 3 times, -r 3. -n may also save time, although I guess it won't try to get as much data as possible. – njsg Jan 10 '13 at 12:09
So that's why I came up with the idea of using --fill=+ option ("fill mode") – evaldaz Jan 10 '13 at 12:17
up vote 1 down vote accepted

Thoroughly reread ddrescue manual and found out the following option:

-m 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
share|improve this answer

This is a very bad idea!

I'm talking about Before imaging the corrupted filesystem to a file on another hard drive...

As when a disk drive come to be corrupted, corruption are generally growing each time you try to access your drive.

So the good way to rescue a broken drive is to make an image by copying whole disk from begin to end in one uninterrupted operation!. After that: unplug the disk drive and store them quietly. As: less you touch the broken drive, more chance you have to restore something.

As each time mechanical access to broken material could make some more damages, the log you're become from your last operation is not a reference for knowing wich block are damaged now.

I personally, don't use ddrescue. I use dd from a while and this tool make all I need:

dd bs=512 if=/dev/sdX of=/backuprepo/sdXBroken.img conv=noerror,sync

And, I let him work, patiently. ;-)

Sorry. Good luck!

share|improve this answer
Using dd without a block size (bs) set makes FSM sad. – laebshade Jan 11 '13 at 22:55

Knowing what ddrecue does, you should not use it to write to /dev/null while recovering data from broken disk, but to get "at least something" using writes into real image file.

Writing to /dev/null has sence e.g. if you want to know for brand-new disk if to return it to the store.

In this case, i would not use log file from "/dev/null attempt", but empty/new one, and then trying eventually more times couple of passes, depending how it does...

share|improve this answer
pretty sure this doesn't address the question of "Is there another (preferred) way of rereading only good sectors?" – Jeff Schaller May 20 at 16:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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