Skip to content

Instantly share code, notes, and snippets.

@itsmikita
Last active May 7, 2024 05:30
Show Gist options
  • Save itsmikita/35619de294676bafc45af09ee88c8a23 to your computer and use it in GitHub Desktop.
Save itsmikita/35619de294676bafc45af09ee88c8a23 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

@js32
Copy link

js32 commented May 31, 2023

The first line below „4.“ should be:

diskutil rename OS\ X\ Base\ System Install\ El\ Capitan

@Bazze
Copy link

Bazze commented May 5, 2024

Thanks for this! This saved my day with my old mid-2009 macbook pro 🤓

The first line below „4.“ should be:

diskutil rename OS\ X\ Base\ System Install\ El\ Capitan

And indeed, yes, this should be included too in the commands

@itsmikita
Copy link
Author

itsmikita commented May 7, 2024

The first line below „4.“ should be:

diskutil rename OS\ X\ Base\ System Install\ El\ Capitan

Ah, missed it... Updated the gist now. Danke, @js32 !

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