Skip to content

Rescue copy

Terminal window
sudo smartdisk rescue disk4 /Volumes/Backup/disk4.img

rescue copies a failing disk to an image file on another disk, the way GNU ddrescue does: it gets as much data off as possible before the disk gives up completely. The disk is only read.

  1. Copy: forward in 1 MiB blocks. After a failed block it jumps ahead, twice as far after each further failure (at most 1 % of the disk), so one damaged area does not hold up the rest.
  2. Reverse: what was skipped, back to front.
  3. Scrape: the failed blocks sector by sector. Every readable sector is saved.
  4. Retry: the unreadable sectors once more (-retries N, default 1).

Unreadable sectors stay zeros in the image.

Progress is saved every 30 seconds in <image>.map, in GNU ddrescue’s mapfile format. Ctrl-C stops; the same command continues where it stopped, and ddrescue can continue it too.

The disk’s volumes are unmounted during the rescue so nothing changes while it is copied, and mounted again afterwards.

SmartDisk refuses:

  • an image on the disk being rescued (APFS volumes are traced back to their physical disk),
  • an image without enough free space,
  • an existing image without its map,
  • a symbolic or hard link in place of the image or the map.

The image is created with mode 0600, because it holds everything on the disk, and belongs to the user who ran sudo.

Open the image read-only and copy the files:

Terminal window
hdiutil attach -readonly -imagekey diskimage-class=CRawDiskImage /Volumes/Backup/disk4.img

In SmartDisk for Mac: Read test → Rescue copy…. The image is named after the drive, so choosing the same folder again continues an interrupted rescue, and Open the image mounts it read-only.