Yosemite and later used a built in program called createinstallmedia
to automagically make a USB stick. It is possible to create a bootable USB stick without this program.
You'll need an 8GB USB stick and either the Install Mac OS X Lion.app
or InstallESD.dmg
or BaseInstall.dmg
.
Open Terminal, you'll need it in most of this tutorial.
We're going to need to start by getting to the actual installation disk image.
Mine is in Applications, but you can put it anywhere for this.
In Terminal:
cd "/Applications/Install Mac OS X Lion.app"
find . -name "*.dmg"
Should output something like: ./Contents/SharedSupport/InstallESD.dmg
In Terminal:
open ./Contents/SharedSupport/InstallESD.dmg
Open your BaseInstall.dmg
file.
In Terminal:
ls -la /Volumes
From here you should see something like OS X Install ESD
or something like that, cd
into that path.
cd "/Volumes/OS X Install ESD"
find . -name "*.dmg"
It should show something like: ./BaseSystem.dmg
In Terminal:
open ./BaseSystem.dmg
If you just have an InstallESD.dmg
or BaseSystem.dmg
file, you should just open them.
open ./InstallESD.dmg
# or
open ./BaseSystem.dmg
Look in Volumes you should see something like OS X Base System
, remember whatever it shows.
ls -la /Volumes
diskutil list virtual | grep "OS X Base System"
Should display something like:
2: Apple_HFS OS X Base System 1.3 GB disk3s2
Take note of the disk, for example mine is /dev/disk3s2
.
Insert your USB Stick.
In Terminal:
diskutil list external
Should display something like something else may appear depending on your stick.
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *16.0 GB disk4
1: EFI EFI 209.7 MB disk4s1
2: Apple_HFS Untitled 15.7 GB disk4s2
Take note of the disk, in my case /dev/disk4
.
Partition it.
diskutil partitionDisk disk4 GPT HFS+ USBSTICK 100%
Should output something like this:
Started partitioning on disk4
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk4s2 as Mac OS Extended with name USBSTICK
Initialized /dev/rdisk4s2 as a 15 GB case-insensitive HFS Plus volume
Mounting disk
Finished partitioning on disk4
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *16.0 GB disk4
1: EFI EFI 209.7 MB disk4s1
2: Apple_HFS USBSTICK 15.7 GB disk4s2
Here you want to take note of the Initialized
line, specifically your disk, mine is /dev/rdisk4s2
.
WARNING IF YOU PUT THE WRONG DISKS IN HERE YOU CAN WIPE YOUR MACHINE
The source should be the disk from Step 2, the target should be the disk from Step 3
sudo asr restore --source /dev/disk3s2 --target /dev/rdisk4s2 --erase --noprompt
This should prompt you for your login password and display:
Password:
Validating target...done
Validating source...done
Validating sizes...done
Restoring ....10....20....30....40....50....60....70....80....90....100
Verifying ....10....20....30....40....50....60....70....80....90....100
Restored target device is /dev/disk4s2.
Remounting target volume...done
In Volumes now you should have your USB stick and original installer and possibly other mounts.
I do a force unmount here, this will not unmount your system disk(s).
diskutil unmount force *
Remove and re-insert your USB Stick now.
ls /Volumes
Should show OS X Base System
or OS X Install ESD
.
sudo bless --verbose --mount "/Volumes/OS X Base System" --setBoot
Should output something like:
EFI found at IODeviceTree:/efi
Mount point for /Volumes/OS X Base System is /Volumes/OS X Base System
Mount point is '/Volumes/OS X Base System'
No BootX creation requested
No boot.efi creation requested
found ioreg "FirmwareFeaturesMask"; featureMaskValue=0xFF1FFF7F
found ioreg "FirmwareFeatures"; featureFlagsValue=0xFD0FF57E
isPreBootEnvironmentUEFIWindowsBootCapable=1
given BSD is not a DVD disc medium
isDVDWithElToritoWithUEFIBootableOS=0
Checking if disk is complex (if it is associated with booter partitions)
GPT detected
No auxiliary booter partition required
System partition found
Preferred system partition found: disk0s1
Returning booter information dictionary:
<CFBasicHash 0x7f972fc00bf0 [0x7fff961488e0]>{type = mutable dict, count = 3,
entries =>
0 : <CFString 0x10f593be0 [0x7fff961488e0]>{contents = "System Partitions"} = (
disk0s1,
disk2s1
)
1 : <CFString 0x10f5943c0 [0x7fff961488e0]>{contents = "Data Partitions"} = (
disk2s2
)
2 : <CFString 0x10f5943e0 [0x7fff961488e0]>{contents = "Auxiliary Partitions"} = (
)
}
Path to mountpoint given: /Volumes/OS X Base System
IOMedia disk2s2 has UUID BF39EB72-D849-4437-B537-7267585E90FF
Setting EFI NVRAM:
efi-boot-device='<array><dict><key>IOMatch</key><dict><key>IOProviderClass</key><string>IOMedia</string><key>IOPropertyMatch</key><dict><key>UUID</key><string>BF39EB72-D849-4437-B537-7267585E90FF</string></dict></dict><key>BLLastBSDName</key><string>disk2s2</string></dict></array>'
Setting EFI NVRAM:
IONVRAM-DELETE-PROPERTY='efi-boot-file'
Setting EFI NVRAM:
IONVRAM-DELETE-PROPERTY='efi-boot-mkext'
Setting EFI NVRAM:
IONVRAM-DELETE-PROPERTY='efi-boot-kernelcache'
Old boot-args:
Got token:
Preserving:
New boot-args unchanged, skipping update.
You should be able to Eject your stick and boot from it now.
Regrettably, this solution only works if you can find the
.app
in the apple store.Currently, version such as Yosemite, can only being downloaded as a
.dmg
which contains a.pkg
file inside.