Skip to content

Learn

Your first image on macOS

Everything you need is already built into macOS: a few Terminal commands make a complete raw image. The hard part is being careful about which disk you point them at.

What you need

  • A USB-to-SATA/IDE adapter or dock (with its own power supply for 3.5" drives). Newer Macs may also need a USB-C adapter.
  • Ideally, a hardware write-blocker, which physically prevents writes to the drive.
  • Free space at least the size of the whole drive.
  • Terminal (in Applications → Utilities) and an administrator password.

The "initialise" trap

If macOS can't read the drive's filesystem (very common for old DOS, Windows or Linux disks), it shows a dialog: "The disk you attached was not readable by this computer." with the buttons Initialise…, Ignore and Eject.

  • Click Ignore. Initialise opens Disk Utility to erase the disk.
  • Never use Erase, First Aid or Partition in Disk Utility on the old drive.
  • Don't click Eject either: that removes the device entirely and you won't be able to image it until you reconnect.

If the drive is readable, macOS mounts it automatically and may write hidden files such as .Spotlight-V100 or .fseventsd. Unmount it straight away (see below) and don't browse it in Finder. The imaging guide shows how to switch off auto-mounting.

Finding the right disk

Open Terminal and run this before plugging the drive in:

diskutil list

Then connect the drive and run it again. The new entry is your drive. It will look something like this:

/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *40.0 GB    disk4
   1:                 DOS_FAT_32 OLD_PC                  40.0 GB    disk4s1

Here the whole drive is disk4; disk4s1 is a partition on it. You want the whole drive. Check the size matches the label and that it says external, physical. Your Mac's own disk is usually disk0 or disk1, and pointing dd at the wrong disk can wipe it. If you're unsure, unplug other external drives and run diskutil list again.

In the commands below, replace N with your number (for example disk4).

Unmounting (not ejecting)

diskutil unmountDisk /dev/diskN

This detaches any partitions macOS mounted, while keeping the device available for reading. Don't use diskutil eject, and never diskutil eraseDisk.

Imaging a healthy drive with dd

sudo dd if=/dev/rdiskN of=drive.img bs=4m status=progress
  • if= is the input (the old drive), of= is the output (the new image file). Swapping them would overwrite the old drive with your file, so read the command twice before pressing Enter.
  • /dev/rdiskN is the raw device. macOS offers each disk twice: /dev/diskN goes through a system buffer, while /dev/rdiskN reads directly and is usually much faster. Both give the same data.
  • bs=4m reads in 4 MB chunks (lower-case m on macOS).
  • status=progress shows progress on recent macOS versions. If yours doesn't support it, leave it out and press Ctrl+T to see progress.

If dd stops with an Input/output error, the drive has bad sectors. Don't keep retrying: switch to ddrescue.

Failing drives: ddrescue

GNU ddrescue copies the easy parts first, comes back for the difficult areas later and records its progress so you can stop and resume. Install it with Homebrew:

brew install ddrescue
sudo ddrescue -d -n /dev/rdiskN drive.img drive.map     # pass 1: skip slow areas
sudo ddrescue -d -r3 /dev/rdiskN drive.img drive.map    # pass 2: retry bad areas 3 times

Keep the .map file. A partly recovered image is still valuable: just mention how much was rescued in your notes. If the drive clicks, grinds or isn't detected at all, stop; more power-on time can make things worse.

Computing the SHA-256

shasum -a 256 drive.img

The 64-character string before the file name is the hash you'll paste into the contribute form. Don't double-click or mount the image afterwards; if you want to look inside, work on a copy.

What's next

  • Unplug the drive and store it safely.
  • Note the adapter, command and any errors.
  • Consider privacy. If the drive may hold someone else's personal data, plan to submit it as private.
  • Create a private torrent of the image so the archive can download it.