Following the Building an OS X Triage Drive at The Instructional, I decided to create a bootable USB with Mavericks (10.9), Yosemite (10.10), and El Capitan (10.11). This covers most of the Mac's supported by my organization because for the most part we don't deal with imaging, we just re-install the os when we have any problems. In the beginning, I ran into a couple of problems of creating the bootable USB. When I ran this command to create the Mavericks partition
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Mavericks-I --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
and booted the Mac into the installer; it said that the installer could not complete because it may have been corrupted during download. Verifying the checksum, everything looked normal. So I tried it with the Install OS X Yosemite.app as well. Same thing, it would not install and gave the same prompt.
I'm getting a little ahead of myself. Let's start with partitioning the USB. I picked up a 64GB PNY USB 3.0 at Best Buy for less than $20. All of this was done in terminal. First we need to discover the disk we will partition, to find this out plug in the USB and use the command:
diskutil list
In my case, it was /dev/disk1 you may need to replace for the rest of the tutorial, just be cautious as to not delete other partition on any other drives you may have connected. I am not responsible for the loss of any data.
We need to create three journaled HFS+ (JHFS+) partitions. To do this the command is:
diskutil partitionDisk /dev/disk2 GPT JHFS+ Mavericks 7g JHFS+ Yosemite 7g JHFS+ ElCapitan 7g JHFS+ SpareVolume 0b
Note that this is all one line; formatting of the blog separates it into multiple lines. Also, the SpareVolume partition is not created as an empty partition, that particular combination uses all the extra space. Once that completes it's time to copy the installers.
Copying Mavericks Installer
You can copy and paste these commands into terminal and press return after. You'll want the local administrator password, or an account that has local admin privileges.
sudo hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg
sudo asr restore -source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -target /Volumes/Mavericks -erase -format HFS+
This step will prompt you to confirm that you want to erase the partition Mavericks. Press y and then return.
sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo cp -a /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg /Volumes/OS\ X\ Base\ System
hdiutil detach /Volumes/OS\ X\ Install\ ESD
Once you're done, the volume is now named Mac OS X Install ESD to make it easier to know which one is the installer we want, rename it with the following commands:
diskutil rename "Mac OS X Install ESD" "Mavericks"
and change the boot label for the volume by using:
sudo bless --folder "/Volumes/Mavericks" -label "Mavericks Install"
Copying Yosemite Installer
You can copy and paste these commands into terminal and press return after. You'll want the local administrator password, or an account that has local admin privileges.
sudo hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg
sudo asr restore -source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -target /Volumes/Yosemite -erase -format HFS+
This step will prompt you to confirm that you want to erase the partition Yosemite. Press y and then return.
sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo cp -a /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg /Volumes/OS\ X\ Base\ System
hdiutil detach /Volumes/OS\ X\ Install\ ESD
Once you're done, the volume is now named Mac OS X Install ESD to make it easier to know which one is the installer we want, rename it with the following commands:
diskutil rename "Mac OS X Install ESD" "Yosemite"
and change the boot label for the volume by using :
sudo bless --folder "/Volumes/Yosemite" -label "Yosemite Install"
Copying El Capitan Installer
You can copy and paste these commands into terminal and press return after. You'll want the local administrator password, or an account that has local admin privileges.
sudo hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg
sudo asr restore -source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -target /Volumes/ElCapitan -erase -format HFS+
This step will prompt you to confirm that you want to erase the partition ElCapitan. Press y and then return.
sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo cp -a /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg /Volumes/OS\ X\ Base\ System
hdiutil detach /Volumes/OS\ X\ Install\ ESD
Once you're done, the volume is now named Mac OS X Install ESD to make it easier to know which one is the installer we want, rename it with the following commands:
diskutil rename "Mac OS X Install ESD" "ElCapitan"
and change the boot label for the volume by using :
sudo bless --folder "/Volumes/ElCapitan" -label "El Capitan Install"
You should now have a bootable OS X USB with three installers that you can select at boot by holding down the option key and be able to select which installer you would like to use.