ddrescuelog1
Tool for ddrescue mapfiles
Usage
ddrescuelog [options]
mapfile
Overview
GNU ddrescuelog is a tool that manipulates ddrescue mapfiles, shows mapfile contents, converts mapfiles to/from other formats, compares mapfiles, tests rescue status, and can delete a mapfile if the rescue is done. Ddrescuelog operations can be restricted to one or several parts of the mapfile if the domain setting options are used.
Use a hyphen '-' as mapfile to read the mapfile from standard input (also in the options taking a mapfile argument) or to write the mapfile created by '--create-mapfile' to standard output.
NOTE: In versions of ddrescue prior to 1.20 the mapfile was called 'logfile'. The format is the same; only the name has changed.
Options
-
-h, --help -
display this help and exit
-
-V, --version -
output version information and exit
-
-a, --change-types=<ot>,<nt> -
change the block types of mapfile
-
-A, --annotate-mapfile -
add comments with human-readable pos/sizes
-
-b, --block-size=<bytes> -
block (sector) size in bytes [default 512]
-
-B, --binary-prefixes -
show binary multipliers in numbers [SI]
-
-c, --create-mapfile[=<tt>] -
create mapfile from list of blocks [+-]
-
-C, --complete-mapfile[=<t>] -
complete mapfile adding blocks of type t [?]
-
-d, --delete-if-done -
delete the mapfile if rescue is finished
-
-D, --done-status -
return 0 if rescue is finished
-
-f, --force -
overwrite existing output files
-
-F, --format=<name> -
format for
-cand-l(list, bitmap-[bl]e)
-
-H, --make-test=<C:H:S:to:bh> -
create mapfile for test mode of ddrescue
-
-i, --input-position=<bytes> -
starting position of rescue domain [0]
-
-l, --list-blocks=<types> -
print block numbers of given types (?*/-+)
-
-L, --loose-domain -
accept unordered domain mapfile with gaps
-
-m, --domain-mapfile=<file> -
restrict domain to finished blocks in <file>
-
-n, --invert-mapfile -
invert block types (finished <--> others)
-
-o, --output-position=<bytes> -
starting position in output file [ipos]
-
-p, --compare-mapfile=<file> -
compare block types in domain of both files
-
-P, --compare-as-domain=<file> -
like
-pbut compare finished blocks only
-
-q, --quiet -
suppress all messages
-
-s, --size=<bytes> -
maximum size of rescue domain to be processed
-
-t, --show-status -
show a summary of mapfile contents
-
-v, --verbose -
be verbose (a 2nd
-vgives more)
-
-x, --xor-mapfile=<file> -
XOR the finished blocks in file with mapfile
-
-y, --and-mapfile=<file> -
AND the finished blocks in file with mapfile
-
-z, --or-mapfile=<file> -
OR the finished blocks in file with mapfile
-
--shift -
shift all block positions by (opos - ipos)
Numbers may be in decimal, hexadecimal, or octal, may contain underscore separators between groups of digits, and may be followed by a SI or binary multiplier and 's' for 'sectors': 1_234_567kB, 4Kis, 0x1234_5678, 07_777. The syntax of the argument of option '-H' is <cylinders:heads:sectors1[-sectors2[,tracks_per_zone]]:track_order:bad_head>
Exit status
0 for a normal exit, 1 for environmental problems (file not found, invalid command-line options, I/O errors, etc), 2 to indicate a corrupt or invalid input file, 3 for an internal consistency error (e.g., bug) which caused ddrescuelog to panic.
Releases
8 releases since Debian 7 (Wheezy); the text changed 6 times.
--and-mapfile since Debian 9 (Stretch);
--annotate-mapfile since Debian 10 (Buster);
--binary-prefixes since Debian 8 (Jessie);
--compare-as-domain since Debian 8 (Jessie);
--compare-mapfile since Debian 9 (Stretch);
--complete-mapfile since Debian 9 (Stretch);
--create-mapfile since Debian 9 (Stretch);
--domain-mapfile since Debian 9 (Stretch);
--format since Debian 12 (Bookworm);
--invert-mapfile since Debian 9 (Stretch);
--loose-domain since Debian 8 (Jessie);
--make-test since Arch Linux 2026-11-01;
--or-mapfile since Debian 9 (Stretch);
--shift since Debian 10 (Buster);
--size since Debian 8 (Jessie);
--xor-mapfile since Debian 9 (Stretch);
-A since Debian 10 (Buster);
-B since Debian 8 (Jessie);
-C since Debian 8 (Jessie);
-F since Debian 12 (Bookworm);
-H since Arch Linux 2026-11-01;
-L since Debian 8 (Jessie);
-P since Debian 8 (Jessie).
--and-logfile until Debian 8 (Jessie);
--compare-logfile until Debian 8 (Jessie);
--complete-logfile until Debian 8 (Jessie);
--create-logfile until Debian 8 (Jessie);
--domain-logfile until Debian 8 (Jessie);
--invert-logfile until Debian 8 (Jessie);
--max-size until Debian 7 (Wheezy);
--or-logfile until Debian 8 (Jessie);
--xor-logfile until Debian 8 (Jessie).