5

I'am currently trying to recover data from a failing 3TB WD Red drive using ddrescue.

After two weeks I got about one TB, but then read speed doped to a few thousand bytes per second and it would now take years to finish. I noticed that powering off and on the drive increase read speed for a few second to a few hundred/thousand kilobytes per second and then drops again to super slow.

I guess there is some dust on the platter which stuck on the disk head and is removed when the heads slide in the parking position.
ddrecsue is currently running like this:

ddrescue -f -n -b 4096 /dev/sda /dev/sdb /media/usbstick/rescue.log

I want now to skip this area and continue somewhere else, lets says at 1500GB but don't know how to do this. There is the parameter --input-position=bytes but the docs say:

Starting position of the rescue domain in infile, in bytes. Defaults to 0. This is not the point from which ddrescue starts copying.

There is also --skip-size=[initial][,max] but it seems to be the size to skip after a bad sector which is not what I want.

Any ideas how to achieve this?

GAD3R
  • 66,769
  • 1
    -i, --input-position=<bytes> is the correct option, might also want to experiment with -a, --min-read-rate=<bytes> so hopefully it will skip slow areas better – frostschutz Mar 12 '16 at 14:44
  • Thanks. Just started again with my logfile and and it is not "fast" again. However ddrescue printed the message "sizes below are limited to the domain 1500 GB to 3000 GB" and the previous stats are gone. I hope that I not lost all my previous recovered data/logfile about bad sectors? – NKnusperer Mar 12 '16 at 15:06
  • ddrescuelog still show the previous stats + the new current position so I guess everything is fine :) – NKnusperer Mar 12 '16 at 15:13
  • @frostschutz: https://superuser.com/a/432006/166461 states that -i and -o must always be specified at the same time with the same value to avoid corruption of the target – Wolfgang Fahl Jun 28 '18 at 14:32
  • 5
    @WolfgangFahl --output-position defaults to --input-position so you'd have to deliberately specify two different values to get a wrong result. – frostschutz Jun 28 '18 at 22:01

1 Answers1

2

The full documentation of ddrescue (see info ddrescue) covers this example:

Example 3: While rescuing the whole drive /dev/sda to /dev/sdb, /dev/sda freezes up at position 12345678.

ddrescue -f /dev/sda /dev/sdb mapfile       <-- /dev/sda freezes here
  (restart /dev/sda or reboot computer)
  (restart copy at a safe distance from the troubled sector)
ddrescue -f -i 12350000 /dev/sda /dev/sdb mapfile
  (then copy backwards down to the troubled sector)
ddrescue -f -R /dev/sda /dev/sdb mapfile

So option -i can indeed be used to skip a certain area. The warning

This is not the point from which ddrescue starts copying.

is related to additional options which the documentation also explains:

-i bytes
--input-position=bytes
    Starting position of the rescue domain in infile, in bytes. Defaults to 0. This is not the point from which ddrescue starts copying. (For example, if you pass the option '--reverse' to ddrescue, it starts copying from the end of the rescue domain). In fill mode it refers to a position in the infile of the original rescue run. See the chapter Fill mode (see Fill mode) for details.

So as long as you don't use -R or -F, you can use -i as an offset to skip a certain area of bytes.

  • Maybe they should revise the note to say something like "this is not necessarily the point from which ddrescue immediately starts working". – mwfearnley Jan 30 '24 at 09:03