Thursday, January 3, 2019

Create a Disk Image & Restore It (Mojave / APFS)

First of all, Apple you SUCK!!!

Now, that's out of the way, here is how to create a disk image for APFS and restore it:

  • Boot Mojave from an external USB (CMD + Option)
  • Open Terminal
    • Unmount the disk (disk0 is the built-in disk):
      • diskutil unmountDisk /dev/disk0
    • Create the image:
      • hdiutil create -srcdevice /dev/disk0s2 -format UDZO /Volumes/100G/Macintosh_HD_Backup.dmg
    • Scan the image
      • asr imagescan --source /Volumes/100G/Macintosh_HD_Backup.dmg
    • Restore the image
      • asr restore --source /Volumes/100G/Macintosh_HD_Backup.dmg --target /dev/disk0s2 --erase
      • When it asks to restore it to disk1, APFS, say 'y'.

No comments: