Description

GNU ddrescue is a data recovery tool. It copies data from one file or
block device (hard disc, cdrom, etc) to another, trying hard to rescue
data in case of read errors.

ddrescue does not truncate the output file if not asked to. So, every
time you run it on the same output file, it tries to fill in the gaps.

The basic operation of ddrescue is fully automatic. That is, you don't
have to wait for an error, stop the program, read the log, run it in
reverse mode, etc.

If you use the logfile feature of ddrescue, the data is rescued very
efficiently (only the needed blocks are read). Also you can interrupt
the rescue at any time and resume it later at the same point.

Automatic merging of backups: If you have two or more damaged copies of
a file, cdrom, etc, and run ddrescue on all of them, one at a time,
with the same output file, you will probably obtain a complete and
error-free file. This is so because the probability of having damaged
areas at the same places on different input files is very low. Using
the logfile, only the needed blocks are read from the second and
successive copies.


The algorithm of ddrescue is as follows:

  1) Optionally read a starting point, a size and a list of bad blocks
     (damaged areas) from a file, for resuming a previously interrupted
     rescue.

  2) Read the non-damaged part of the file, skipping the damaged areas,
     until the requested size is reached, or until interrupted by the user.

  3) Try to read the damaged areas, splitting them into smaller pieces
     and reading the non-damaged pieces, until the hardware block size
     is reached, or until interrupted by the user.

  4) Try to read the damaged hardware blocks until the specified number
     of retries is reached, or until interrupted by the user.

  5) Optionally write a starting point, a size and a list of bad blocks
     to a file for later use.


Examples

  Fast rescue of non-damaged part of file
    ddrescue --no-split infile outfile

  Infinite retrying
    ddrescue --max-retries=-1 infile outfile

  Reading from CD-ROM with physical sector size of 2048 bytes
    ddrescue --block-size=2048 /dev/cdrom outfile

  Efficient rescue from several identical (but independent) sources
    ddrescue infile1 outfile bbfile
    ddrescue infile2 outfile bbfile
    ddrescue infile3 outfile bbfile
    ...
    (repeat until all blocks are copied to outfile (ddrescue deletes bbfile))

  Complex rescue
    ddrescue infile outfile bbfile
    (edit bbfile and move the desired entries to bbfile2)
    ddrescue --max-retries=-1 infile outfile bbfile2
