-
-
Save Diegus83/e493a30ac4d1c57e327fa181ce77294e to your computer and use it in GitHub Desktop.
# This is not intended to be guide, I just wrote it as a reminder to myself of the steps necessary. | |
# If you find it useful, that's great, but keep in mind the paths and device ID's will need | |
# to be adjusted to your case. And you may need sudo if you are not doing this while booted from recovery like I did. | |
Get the InstallMacOSX.dmg from https://support.apple.com/kb/DL2077?locale=en_US | |
Mount the image | |
hdiutil mount InstallMacOSX.dmg | |
cd /Volumes/Install\ Mac\ OS\ X | |
Copy to a tmp location | |
mktemp -d | |
/var/folders/v6/s_rd76bx78j5mpjxl1b0yn5m0000gn/T/tmp.plAsi6ls | |
cp InstallMacOSX.pkg /var/folders/v6/s_rd76bx78j5mpjxl1b0yn5m0000gn/T/tmp.plAsi6ls/ | |
cd /var/folders/v6/s_rd76bx78j5mpjxl1b0yn5m0000gn/T/tmp.plAsi6ls/ | |
Change extension to xar | |
mv InstallMacOSX.pkg InstallMacOSX.xar | |
Unarchive | |
xar -xf InstallMacOSX.xar | |
Get the install media from the extracted package | |
mv InstallMacOSX.pkg/InstallESD.dmg . | |
Restore the install media to a USB drive (in this case /dev/disk4) | |
asr restore --source InstallESD.dmg --target /dev/disk4 --erase | |
Thanks for catching that typo with the extension. I didn't wrote this as a guide, it's just a reminder to myself because it took me some time to figure out the steps.
I did this from the recovery partition so sudo wasn't necessary, and the device id will of course be different in each case. In your case seems like you where using a partition and not a whole drive (hence the s2). I was using a USB thumb drive so using the whole device worked fine.
I am getting a checksum error when I try to restore. I am not sure what the problem might be. Is there another step that I need to execute?
sudo /usr/sbin/asr restore --source InstallESD.dmg --target /dev/disk2s2 --erase
Restoring ....10....20....30....40....50....60....70....80....90....100
Verifying ....10....20....30....40....50....60....70....80....90....100
Checksum failed.
Expected 7425D663
but got 84E748B9
Could not restore - error -206
problem resolved. used internet restore method.
@Diegus83 I encountered Could not find any scan information. The source image needs to be imagescanned before it can be restored.
problem while run command on macOS ventura. After some research, I found I can add -noverify
parameter to asr
for skipping this error.
asr restore --source InstallESD.dmg --target /dev/disk4 --erase -noverify
@Diegus83 I encountered
Could not find any scan information. The source image needs to be imagescanned before it can be restored.
problem while run command on macOS ventura. After some research, I found I can add-noverify
parameter toasr
for skipping this error.
asr restore --source InstallESD.dmg --target /dev/disk4 --erase -noverify
This helped. Just added sudo
:
❯ sudo asr restore --source InstallESD.dmg --target /dev/disk4s1 --erase --noverify
Thanks @zhukovgreen
This should be: mv InstallMacOSX.pkg InstallMacOSX.xar
I needed to run this as sudo. Also, if it fails with error "Could not restore - Resource busy" then make sure that you have selected the correct target - in my case it was /dev/disk4s2