Skip to content

Instantly share code, notes, and snippets.

@js32
Forked from itsmikita/README.md
Last active May 31, 2023 11:29
Show Gist options
  • Save js32/5a81a33de49f3b9d14d364de6df6cd1f to your computer and use it in GitHub Desktop.
Save js32/5a81a33de49f3b9d14d364de6df6cd1f to your computer and use it in GitHub Desktop.
Create bootable USB drive from InstallMacOSX.pkg

Create bootable USB drive from InstallMacOSX.pkg

  1. Erase USB drive with Disk Utility using format Mac OS Extended (Journaled) and Master Boot Record and call it MyVolume
  2. Use Finder to mount/open InstallMacOSX.dmg.
  3. Run following commands:
pkgutil --expand /Volumes/Install\ OS\ X/InstallMacOSX.pkg /tmp/El\ Capitan
diskutil eject Install\ OS\ X
cd /tmp/El\ Capitan
hdiutil attach InstallMacOSX.pkg/InstallESD.dmg  -noverify -nobrowse -mountpoint /Volumes/esd
sudo asr restore -source /Volumes/esd/BaseSystem.dmg -target /Volumes/MyVolume -noprompt -noverify -erase
  1. To finish and fix installation issues, run these commands:
diskutil rename OS\ X\ Base\ System Install\ El\ Capitan
rm /Volumes/Install\ El\ Capitan/System/Installation/Packages
cp -rp /Volumes/esd/Packages /Volumes/Install\ El\ Capitan/System/Installation
cp -rp /Volumes/esd/BaseSystem.chunklist /Volumes/Install\ El\ Capitan/
cp -rp /Volumes/esd/BaseSystem.dmg /Volumes/Install\ El\ Capitan/
hdiutil detach /Volumes/esd
sudo bless --folder /Volumes/Install\ El\ Capitan/System/Library/CoreServices --label Install\ El\ Capitan
cp /Volumes/Install\ El\ Capitan/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/InstallAssistant.icns /Volumes/Install\ El\ Capitan/.VolumeIcon.icns
cd "$HOME"
rm -r /tmp/El\ Capitan
diskutil eject Install\ El\ Capitan
  1. Insert the USB drive on Machine needed reinstall.

Resources

https://apple.stackexchange.com/a/389830
https://appstorrent.ru/602-os-x-el-capitan.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment