Skip to content

Instantly share code, notes, and snippets.

@RobertYim
Last active September 1, 2018 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertYim/07630ef4b1090b84cb805089b7dd3909 to your computer and use it in GitHub Desktop.
Save RobertYim/07630ef4b1090b84cb805089b7dd3909 to your computer and use it in GitHub Desktop.
hdiutil create -srcdevice /dev/diskXsY -format ULFO /Volumes/ExternalDriveName/YourImageName.dmg
In the above, diskXsY is obtained from diskutil list when you find the APFS container disk or HFS disk identifier.
Then, use:
asr imagescan --source /Volumes/ExternalDriveName/YourImageName.dmg
After that runs, you can then connect the external drive to the new MBP, use its internet recovery and terminal and do:
asr restore --source /Volumes/ExternalDriveName/YourImageName.dmg --target /dev/diskAsB --erase
Again, in the above, diskAsB is the MBP's disk identifier for its APFS container.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment