manpagez: man pages & more
info ddrescue
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Algorithm

GNU ddrescue manages efficiently the status of the rescue in progress and tries to rescue the good parts first, maximizing the amount of data finally recovered from a failing drive.

The standard dd utility can be used to save data from a failing drive, but it reads the data secuentially, which may wear out the drive without rescuing anything if the errors are at the beginning of the drive.

Other programs switch to small size reads when they find errors, but this is a bad idea because it means spending more time at error areas, damaging the surface, the heads and the drive mechanics, instead of getting out of them as fast as possible. This behavior reduces the chances of rescuing the remaining good data.

The algorithm of ddrescue is as follows: (the user may interrupt the process at any point)

1) Optionally read a logfile describing the status of a multi-part or previously interrupted rescue. If no logfile is specified or is empty or does not exist, mark all the rescue domain as non-tried.

2) Read the non-tried parts of the input file, marking the damaged areas as non-trimmed and skipping beyond them, until all the rescue domain is tried.

3) Read backwards the damaged areas marked as non-trimmed until an error is found, and mark the rest of the area as non-split.

4) Try to read the damaged areas marked as non-split, splitting them into smaller pieces and reading the non-damaged pieces, until the hardware block size is reached. Mark the pieces that can't be read as bad hardware blocks.

5) Try to read the damaged hardware blocks until the specified number of retries is reached.

6) Optionally write a logfile for later use.


The logfile is periodically saved to disc, as well as when ddrescue finishes or is interrupted. So in case of a crash you can resume the rescue with little recopying.

Also, the same logfile can be used for multiple commands that copy different areas of the file, and for multiple recovery attempts over different subsets. See this example:

Rescue the most important part of the disc first.

 
ddrescue -i0 -s50M /dev/hdc hdimage logfile
ddrescue -i0 -s1M -r3 -d /dev/hdc hdimage logfile

Then rescue some key disc areas.

 
ddrescue -i30G -s10G /dev/hdc hdimage logfile
ddrescue -i230G -s5G /dev/hdc hdimage logfile

Now rescue the rest (does not recopy what is already done).

 
ddrescue /dev/hdc hdimage logfile
ddrescue -r3 -d /dev/hdc hdimage logfile

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.