DDRESCUE(1)

๐Ÿ“ฆ
version 1.30 ยท 6 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

๐Ÿ’– DDRESCUE(1) โ€” the group chat guide to ddrescue ๐Ÿ’–

okay bestie, sit down, hydrate, because this is the Unix User Commands page for ddrescue, and it is literally the rescue-romance of your hard drive's life. ๐Ÿฆ‹


โœจ NAME โœจ

ddrescue โ€” data recovery tool. yes. THE data recovery tool. it saves your data when everything else has given up. main character energy, no cap. ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

ddrescue [options] infile outfile [mapfile]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

GNU ddrescue is a data recovery tool. it copies data from one file or block device (hard disc, cdrom, etc) to another, and the whole vibe is that it tries to rescue the good parts first in case of read errors. it's giving triage nurse but for bytes. ๐Ÿฉบ

Always use a mapfile unless you know you won't need it. Without a mapfile, ddrescue can't resume a rescue, only reinitiate it. and be careful to not specify by mistake an old mapfile from an unrelated rescue. that's the equivalent of grabbing a random stranger's diary and being like "continue". ๐Ÿ™ˆ

NOTE: In versions of ddrescue prior to 1.20 the mapfile was called 'logfile'. The format is the same; only the name has changed. glow-up, honestly. โœจ

If you reboot, check the device names before restarting ddrescue. and don't use options -F or -G without reading the manual first. fr fr, those two are the "trust me bro" of flags. ๐Ÿ”ฅ


๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -h, --help โ€” display this help and exit. the "just tell me what's happening" button. ๐Ÿซถ
  • -V, --version โ€” output version information and exit. identity reveal. ๐ŸŒˆ
  • -a, --min-read-rate=<bytes> โ€” minimum read rate of good areas in bytes/s. the "you're being too slow bestie" threshold.
  • -A, --try-again โ€” mark non-trimmed, non-scraped as non-tried. giving blocks a second chance, iconic. ๐Ÿ’œ
  • -b, --sector-size=<bytes> โ€” sector size of input device [default 512].
  • -B, --binary-prefixes โ€” show binary multipliers in numbers [SI]. (SI is the default, this switches to binary. yes, the Ki vs k discourse. ๐Ÿ’€)
  • -c, --cluster-size=<sectors> โ€” sectors to copy at a time [128].
  • -C, --complete-only โ€” don't read new data beyond mapfile limits. stay in your lane, respectfully. ๐Ÿšง
  • -d, --idirect โ€” use direct disc access for input file. no caching, just raw vibes.
  • -D, --odirect โ€” use direct disc access for output file.
  • -e, --max-bad-areas=[+]<n> โ€” maximum number of [new] bad areas allowed.
  • -E, --max-error-rate=<bytes> โ€” maximum allowed rate of read errors per second. the "we're cooked" alarm. ๐Ÿ˜ญ
  • -f, --force โ€” overwrite output device or partition. dangerous. dramatic. do NOT just send it. โš ๏ธ
  • -F, --fill-mode=<types> โ€” fill blocks of given types with data (?*/-+l).
  • -G, --generate-mode โ€” generate approximate mapfile from partial copy.
  • -H, --test-mode=<file> โ€” set map of good/bad blocks from given mapfile.
  • -i, --input-position=<bytes> โ€” starting position of domain in input file [0].
  • -I, --check-input-size โ€” compare input file size with size in mapfile.
  • -J, --check-on-error โ€” reread latest good sector after every error. double-checking the receipt. ๐Ÿงพ
  • -K, --skip-size=[<i>][,<max>] โ€” initial,maximum size to skip on read error.
  • -L, --loose-domain โ€” accept unordered domain mapfile with gaps. chaotic but valid. โœจ
  • -m, --domain-mapfile=<file> โ€” restrict domain to finished blocks in <file>.
  • -M, --retrim โ€” mark some failed blocks as non-trimmed.
  • -n, --no-scrape โ€” skip the scraping phase. speedrun strats. ๐Ÿƒโ€โ™€๏ธ
  • -N, --no-sweep โ€” skip the sweeping phase.
  • --no-trim โ€” skip the trimming phase.
  • -o, --output-position=<bytes> โ€” starting position in output file [ipos].
  • -O, --reopen-on-error โ€” reopen input file after every read error.
  • -p, --preallocate โ€” preallocate space on disc for output file. manifesting the space. ๐ŸŒŸ
  • -P, --data-preview[=<lines>] โ€” show some lines of the latest data read [3].
  • -q, --quiet โ€” suppress all messages. silent mode, mysterious, gorgeous. ๐Ÿคซ
  • -r, --retry-passes=<n> โ€” exit after <n> retry passes (-1=infinity) [0].
  • -R, --reverse โ€” reverse the direction of all passes. going backwards like a lil crab. ๐Ÿฆ€
  • -s, --size=<bytes> โ€” maximum size of input data to be copied.
  • -S, --sparse โ€” use sparse writes for output file.
  • -t, --truncate โ€” truncate output file to zero size.
  • -T, --timeout=<interval> โ€” maximum time since last successful read.
  • -u, --unidirectional โ€” run all passes in the same direction.
  • -v, --verbose โ€” be verbose (a 2nd -v gives more). spill the tea, twice. โ˜•
  • -w, --ignore-write-errors โ€” make fill mode ignore write errors.
  • -W, --compare-before-write โ€” omit superfluous writes in rescue mode.
  • -x, --extend-outfile=<bytes> โ€” extend outfile size to be at least this long.
  • -X, --max-read-errors=<n> โ€” maximum number of read errors allowed.
  • -y, --synchronous โ€” use synchronous writes for output file.
  • -Z, --max-read-rate=<bytes> โ€” maximum read rate in bytes/s. chill, we have time. ๐Ÿง˜
  • --ask โ€” ask for confirmation before starting the copy.
  • --bad-sector-data=<file> โ€” treat sectors with <file> data as read errors.
  • --command-mode โ€” execute commands from standard input.
  • --continue-on-errno=<n>[,<n>] โ€” treat errno code <n> as non-fatal.
  • --cpass=<range> โ€” select what copying pass(es) to run.
  • --delay-slow=<interval> โ€” initial delay before checking slow reads [30].
  • --log-events=<file> โ€” log significant events in <file>.
  • --log-rates=<file> โ€” log rates and error sizes in <file>.
  • --log-reads=<file> โ€” log all read operations in <file>.
  • --mapfile-interval=[i][,i] โ€” save/sync mapfile at given interval [auto].
  • --max-slow-reads=<n> โ€” maximum number of slow reads allowed.
  • --pause-on-error=<interval> โ€” time to wait after each read error [0].
  • --pause-on-pass=<interval> โ€” time to wait between passes [0].
  • --reset-slow โ€” reset slow reads if rate rises above min.
  • --same-file โ€” allow infile and outfile to be the same file. risky little move, be careful bestie. ๐Ÿ™ˆ

๐ŸŒˆ NUMBER FORMAT (the rules, bestie) ๐ŸŒˆ

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.

In rescue mode, --size=output uses the size of the output file or device.

Time intervals have the format 1[.5][smhd] or 1/2[smhd].


โญ 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 ddrescue to panic. ๐Ÿ’€

๐Ÿ› REPORTING BUGS ๐Ÿ›

Report bugs to bug-ddrescue@gnu.org

Ddrescue home page: http://www.gnu.org/software/ddrescue/ddrescue.html

General help using GNU software: http://www.gnu.org/gethelp


Copyright ยฉ 2026 Antonio Diaz Diaz. License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.


๐Ÿงš SEE ALSO ๐Ÿงš

The full documentation for ddrescue is maintained as a Texinfo manual. If the info and ddrescue programs are properly installed at your site, the command

info ddrescue

should give you access to the complete manual.


and that's the whole page, babe. this was GNU ddrescue 1.30, brought to you in January 2026 โ€” go save some data, you've got this. ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹๐ŸŒธ