10.7 : How to get a full Lion install disc for a new MacBook Air or Pro
I've found a way to get a full Lion installer by capturing the installer files that the recovery partition downloads. This seems to work on my 2008 MBP machine with the App Store version of Lion installed on it, but it should be of particular interest to users of the new MacBook Airs and MacBook Pros which don't come with an install disk, but can't install the App Store version of Lion. By following this hint, it should be possible to get a full Lion install disk for those machines that won't require network access to install.
To avoid messing up your one and only good Lion installation, I recommend getting an external drive big enough to install Lion on. An external hard drive or separate partition is great. A large USB flash drive might work, but I haven't tried it.
As we all know, the Recovery HD lets you reinstall Lion by downloading it from Apple's servers. Unfortunately, it deletes itself after installation, so it doesn't give you a chance to make a boot disk that doesn't involve network access. However, it is possible to capture the installer and interrupt the install, so that it doesn't get a chance to delete itself.
Here's what to do:
- Open the Terminal, and type this command to list all partitions on your hard drive or SSD:
diskutil list
- Look for 'Recovery HD' in the list, and note its identifier. It will be something of the form diskXsY, where X and Y are numeric digits. (On my machine, it's disk0s3).
- Type the following command to mount the recovery HD:
diskutil mount readOnly /dev/[identifier]
- Replace [identifier] above with the identifier from step 2. So on my machine, I typed:
diskutil mount readOnly /dev/disk0s3
- The disk image inside the recovery HD is invisible, so use the Terminal to mount that too:
hdiutil attach "/Volumes/Recovery HD/com.apple.recovery.boot/BaseSystem.dmg"
- Now, from the newly mounted Mac OS X Base System image, double-click the 'Install Mac OS X' application at the root of the disk. Surprisingly, it launches, even when booted into a standard Mac OS X user account from the hard drive!
- Go through the license agreement. Once it asks you for a disk to install on, choose the external drive or spare partition. (Or the boot partition if you're feeling gutsy. As long as you don't let the installer reboot, it shouldn't be able to install anything, but I like to err on the side of caution.)
- Enter your admin password when prompted, and the installer will start downloading.
- Open an old-style (non-autosaving) application that still uses the traditional Save, Save As..., etc. commands in the File menu (I used TextWrangler) and make a new unsaved document, and type a few things in it. This will give you a little insurance against the installer rebooting the system, since the app won't let the system reboot until you respond to its message asking whether you want to save the document or not.
- The installer will start downloading some packages into a folder called Mac OS X Install Data on the root of the drive you're installing onto. Of the files it puts in there, the interesting item is a package with a funky name (on my system, it was 'mzm.stuhjljp.pkg'). It will be the file in the folder with the largest file size. Once the file finishes downloading, the installer will extract the InstallESD.dmg image from it and delete the package. This will be fine as long as you don't let the app restart your machine.
- Wait for the download to finish. This will probably take a while, as it's a very large download.
- Once the installer finishes download and prompts you to restart your Mac, force-quit it. Do this quickly, as it may automatically reboot for you after a timeout period (although if you've got an unsaved document open, you should be able to prevent that).
- You should now have a file called InstallESD.dmg in the Mac OS X Install Data folder. You can burn this to a DVD, or image it to a USB flash drive to create a boot disk.
[
crarko adds: I second the recommendation to try this with an external drive first while perfecting the execution of the process.]