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

3. Invoking ddrescue

The format for running ddrescue is:

ddrescue [options] infile outfile [logfile]

ddrescue supports the following options:


Print an informative help message describing the options and exit.


Print the version number of ddrescue on the standard output and exit.

-b bytes

Hardware block size of input device in bytes (usually 512 for hard discs and 3.5" floppies, 1024 for 5.25" floppies, and 2048 for cdroms). Defaults to 512.


Show units with binary prefixes (powers of 1024).
SI prefixes (powers of 1000) are used by default. (See table below).

-c blocks

Number of hardware blocks (sectors) to copy at a time. Defaults to 64KiB / hardware_block_size. Try smaller values for slow drives. The number of sectors per track (18 or 9) is a good value for floppies.


Limit rescue domain to the blocks of finite size read from logfile. Do not read new data beyond logfile limits. This is useful when reading from devices of undefined size, like raw devices.


Use direct disc access to read the input file, bypassing the kernel cache. Hardware block size must be correctly set for this to work. Not all systems support this.


Use synchronous writes for output file. May be useful when forcing the drive to remap its bad sectors.

-e n

Maximum number of error areas allowed before giving up. Defaults to infinity.

-F types

Fill the output file areas specified as any of types in the logfile, with data read from the input file. types contains one or more of the status characters defined in the chapter Logfile Structure (see section Logfile Structure). See the chapter Fill Mode (see section Fill Mode) for a complete description of the fill mode.


Generate an approximate logfile from the input and output files of the original rescue run. Note that you should keep the original offset between ‘--input-position’ and ‘--output-position’ of the original rescue run.

-i pos

Starting position in input file, in bytes. Defaults to 0. In fill mode it refers to the original input file. See the chapter Fill Mode (see section Fill Mode) for details.

-m file

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


Do not try to split or retry error areas. Allows a fast recovery of the non-damaged part of the file. This option overrides the ‘--max-retries’ option.

-o pos

Starting position in output file, in bytes. Defaults to ‘--input-position’. The bytes below pos aren't touched if they exist and truncation is not requested. Else they are set to 0.


Quiet operation.

-r n

Exit after given number of retry passes. -1 means infinity. Defaults to 0. Every bad sector is tried only one time per pass. To retry error areas detected on a previous run, you must specify a non-zero number of retries.


Mark all error areas inside the rescue domain as non-trimmed before beginning the rescue. The effect is similar to ‘--max-retries=1’, but the bad sectors are tried in a different order, making perhaps possible to rescue some of them.

-s bytes

Maximum size of the input data to be copied, in bytes. If ddrescue can't determine the size of the input device, you may need to specify it with this option. Note that this option specifies the size of the input data to be copied, not the size of the output file. So, for example, the following command creates an output file 300 bytes long, but only writes data on the last 200 bytes:

ddrescue -i 100 -s 200 infile outfile logfile

Use sparse writes for output file. May save a lot of disc space in some cases. Not all systems support this.


Truncate output file to zero size before writing to it. Only works for regular files, not for drives or partitions.


Mark all non-split and non-trimmed areas inside the rescue domain as non-tried before beginning the rescue. Try this if the drive stops responding and ddrescue immediately starts splitting error areas when restarted. If ‘--retrim’ is also specified, mark all error areas inside the rescue domain as non-tried.


Verbose mode.

Numbers given as arguments to options (positions, sizes) may be followed by a multiplier and an optional ‘B’ for "byte".

Table of SI and binary prefixes (unit multipliers):








hardware blocks


kilobyte (10^3 = 1000)



kibibyte (2^10 = 1024)


megabyte (10^6)



mebibyte (2^20)


gigabyte (10^9)



gibibyte (2^30)


terabyte (10^12)



tebibyte (2^40)


petabyte (10^15)



pebibyte (2^50)


exabyte (10^18)



exbibyte (2^60)


zettabyte (10^21)



zebibyte (2^70)


yottabyte (10^24)



yobibyte (2^80)

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