Skip to content
GNU ddrescue

GNU ddrescue

The first thing to run on a dying drive: copy what is still readable, keep a map, and come back for the rest.

Homebrew formula

What it does

ddrescue copies a block device to an image file, reading the easy areas fast and the damaged ones slowly, and recording exactly what succeeded in a mapfile. Interrupt it, unplug the drive, come back tomorrow — point it at the same mapfile and it resumes where it stopped instead of grinding over the good sectors again.

diskutil unmountDisk /dev/disk4
ddrescue -f -n /dev/rdisk4 failing.img failing.map    # first pass, no retries
ddrescue -d -f -r3 /dev/rdisk4 failing.img failing.map # then retry the bad areas

Recover from failing.img afterwards with TestDisk & PhotoRec or foremost. The original disk gets read once and then left alone.

The output argument comes second and is written to. Reversing the two overwrites the disk you were trying to save, and there is no confirmation prompt. Check diskutil list immediately before running it.

Notes

  • Use the raw device (/dev/rdisk4, not /dev/disk4) on macOS — it is unbuffered and markedly faster.
  • Not the same project as dd_rescue. The mapfile, the two-phase strategy and the direct-access flags are what make this one the standard.
  • A mechanical drive making noises has a limited number of reads left in it. First pass, no retries, always.

Alternative to

AlternativeTypeTrade-off
ddBuilt inStops at the first read error and cannot resume
Disk DrillFreemiumIts byte-to-byte backup does the same job behind a window, with less control
HDDSuperCloneOpen sourceGoes further with damaged drives, including a direct ATA mode
Parted MagicPaidShips this and the rest of the toolkit on a bootable stick

Install

brew install ddrescue

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on