Skip to content

Instantly share code, notes, and snippets.

@ucyo
Last active December 31, 2020 14:28
Show Gist options
  • Select an option

  • Save ucyo/70d0065eaf3e5a55db8a308b52e12808 to your computer and use it in GitHub Desktop.

Select an option

Save ucyo/70d0065eaf3e5a55db8a308b52e12808 to your computer and use it in GitHub Desktop.
Recovery of old macintosh drive using disk to disk (dd) 👀

Create backup of old data

Be aware that the target device must be of a least the same size as the source device

Let /dev/sda be the target device and /dev/sdb be the source device.

  1. Check end sector (ES) and block size (BS) of source device
> sudo fdisk -l /dev/sdb
Disk /dev/sdb: 113 GiB, 121332826112 bytes, 236978176 sectors
Disk model: XXXXXX
Units: sectors of 1 * 512 = 512 bytes  <--------------------------------- Block size (BS)
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Device      Start       End   Sectors   Size Type
/dev/sdb1      40    409639    409600   200M EFI System
/dev/sdb2  409640 236978135 236568496 112.8G unknown
                  ---------
                      |
                      --------- End sector of target resource (ES)
  1. Delete partition table on target device
> sudo fdisk /dev/sda

> Command (m for help): d
  1. Clone disk with ES+1
sudo dd if=/dev/sdb bs=512 count=236978136 conv=sync,noerror | pv -s 113G | sudo dd of=/dev/sda

Create bootable Mac OSX image

In this step we are going to create a bootable Mac OSX USB drive. The problem is, that I currently have only a single USB drive.

Steps are:

  1. Download image from official webpage on USB drive (on linux machine, all following on mac)
  2. Mount reformated HDD on Macintosh
  3. Mount USB drive on Macintosh
  4. Copy from USB drive to HDD
  5. Create bootable drive on Mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment