If the freedom of speech is taken away then dumb and silent, we may be led, like sheep, to slaughter.
— George Washington.
Recently, I’ve been in a situation where I want to create a separate portable macOS Mojave1 installer, but I don’t know how. I’ve compiled these steps which I gathered from multiple sources to create a boot-able macOS installer. This article will assume you are running on macOS system.
- First, we download the macOS installer that we want to use from the Apple App Store. I picked the latest one (at this time of writing) which is Mojave.
- After that export, an environment variable to hold the output ISO filename that we will be consuming.
- Then we create a blank
dmgvolume using the command
hdiutil2. This command will create an
HFS+Jfilesystem table to store the installer data with the capacity of 6GB.
hdiutil create -o "$ISO_PATH.cdr" -size 6g -layout SPUD -fs HFS+J`
- Mount the created volume. If you get a problem while mounting the volume, try to create the folder first using
mkdir -p /Volumes/install_build.
hdiutil attach "$ISO_PATH.cdr.dmg" -noverify -mountpoint /Volumes/install_build`
- After that run the setup to install and copy the files in the volume that we mounted earlier.
sudo "/Application/Install macOS Mojave.app/Contents/Resources/createinstallmedia" --volume /Volumes/install_build --nointeraction
- Unmount the volume.
Note: Check the name first, as volume name changes after the setup. The installation process specifically overwrites the partition table and volume name.
hdiutil detach "/Volumes/Install macOS Mojave"
- We convert the
UDTOcompatible ISO standard.
hdiutil convert "$ISO_PATH.cdr.dmg" -format UDTO -o "$ISO_PATH"
- Then we rename and remove
mv "$ISO_PATH.cdr" "$ISO_PATH"
- Finally, we delete all the remnants of the procedure.
That’s all the steps needed. If you ever completed it without error, then you got yourself a macOS ISO installer.
Hope you guys enjoyed this article!
- macOS Mojave is the fifteenth major release of macOS, Apple Inc.’s desktop operating system for Macintosh computers. Mojave was announced at Apple’s Worldwide Developers Conference on June 4, 2018, and was released to the public on September 24, 2018. Wikipedia ↩︎
- hdiutil – Manipulate disk images (attach, verify, burn, etc). https://ss64.com/osx/hdiutil.html ↩︎