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.
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 areasRecover 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
| Alternative | Type | Trade-off |
|---|---|---|
dd | Built in | Stops at the first read error and cannot resume |
| Disk Drill | Freemium | Its byte-to-byte backup does the same job behind a window, with less control |
| HDDSuperClone | Open source | Goes further with damaged drives, including a direct ATA mode |
| Parted Magic | Paid | Ships this and the rest of the toolkit on a bootable stick |
Install
brew install ddrescue