Hands on with Mountain Lion's OS X Recovery and Internet Recovery
[Editor’s note: This article is part of our series of articles on installing and upgrading to Mountain Lion.]
A major feature that debuted in Lion (OS X 10.7) and continues in Mountain Lion (OS X 10.8) is one I hope you’ll never need to use: recovery mode, officially called OS X Recovery. (It was called Lion Recovery under Lion.) When you install Mountain Lion or Lion, the installer creates an invisible, bootable, 650MB partition—a portion of a drive the operating system treats as a separate volume—on your startup drive called Recovery HD that includes a few essential utilities for fixing problems, restoring files, browsing the Web, and even reinstalling the operating system.
The idea behind recovery mode is that if you ever have problems with your Mac’s startup volume, you can boot from Recovery HD and perform some basic troubleshooting procedures without the need for an OS X installation DVD or thumb drive, or a separate bootable drive. In fact, because Recovery HD is a separate partition—and one that’s invisible even to Disk Utility—recovery mode would be available at startup even if you were to erase your Mac’s startup drive.
Of course, because the Recovery HD partition is actually part of your Mac’s internal drive or SSD, if that drive is having hardware problems, or partition-map problems, the recovery partition itself may be inaccessible. In other words, recovery mode won’t save you from every problem, and it’s no substitute for having a reliable, regularly updated backup. Also, because the Recovery HD volume is read-only, you can’t, say, copy your favorite third-party disk utility onto it to make that utility available in recovery mode.
Separate from—but closely related to—OS X Recovery is a feature called Internet Recovery, which provides similar features even if your Mac’s drive is damaged or has been replaced. I also cover Internet Recovery below.
Why you might not have a Recovery HD partition
When you install Mountain Lion on a drive, the installer automatically attempts to repartition that drive to create the invisible Recovery HD partition. (If the drive was previously running Lion and already has a Recovery HD partition, the Mountain Lion installer simply updates the partition’s contents.) I say “attempts” because the installer is not always successful. For starters, as Apple explains, the drive must be formatted with a GUID partition scheme and Mac OS Extended (Journaled) format, and it must be at least 13GB in size. In addition, if your drive has a non-standard partition scheme—for example, if it’s part of a RAID, or if you partitioned the drive using Boot Camp Assistant and then tweaked the drive’s partitions later—the installer won’t be able to create Recovery HD. So not everyone will get this useful feature.
Unfortunately, if you didn’t already have a Recovery HD partition from a previous Lion installation, and the Mountain Lion installer can’t create the partition, you can’t add it later. Your only option, according to Apple, is to back up your drive (including your Boot Camp partition, if you have one), erase it (repartitioning it as a single-partition, Mac OS Extended [Journaled] volume in the process), reinstall Mountain Lion or Lion, and then restore your data from your backup. If you were using Boot Camp, you’d then use Boot Camp Assistant to set up Boot Camp again, and then restore your Boot Camp data.
Alternatively, you could install Mountain Lion on an external hard drive or thumb drive, which would create a usable Recovery HD partition on that drive. If you ever needed recovery mode, you can boot into it using that external drive or thumb drive.
Accessing recovery mode
You can access recovery mode only when your Mac starts up, although there are two ways to do so.
The easy way On most Macs, you can access recovery mode by simply restarting or starting up the Mac while holding down Command+R. Keep holding these keys until you see a window with OS X Utilities in large text across the top. If this procedure doesn’t work for you, try the next method.
The alternate way On any Mac, you can access recovery mode using OS X’s Startup Manager:
Restart or start up your Mac while holding down the Option key; keep holding Option until the Startup Manager—a gray screen showing all connected, bootable volumes—appears. One of the volumes will be called Recovery HD.
If you’ll want to connect to your local network (for example, to access backups on a Time Capsule) or the Internet in recovery mode (see “Using recovery mode,” below), you can use the pop-up menu at the bottom of the screen to choose a local Wi-Fi network; provide the network’s password when prompted. However, you aren’t required to perform this step now, as you’ll also be able to choose a network once you’re booted into recovery mode.
Select Recovery HD and then click the upward-pointing arrow below it to boot from Recovery HD. After a brief delay, you’ll see the new OS X Utilities screen.
(Note that this Utilities screen is the same one you’ll see if you create a bootable Mountain Lion install drive and boot your Mac from it.)
Regardless of which method you used to access recovery mode, the menu bar displays OS X’s Input, Wi-Fi, and (on laptops) battery menus. If you want to connect to your network or the Internet, and you haven’t already chosen a Wi-Fi network, you can do so using the Wi-Fi menu. Alternatively, if you’ve got a wired connection, be sure the Ethernet cable or USB-to-Ethernet adapter is connected to your Mac.
Macs released in mid-2011 or later, along with some older Macs once you install a firmware update, include a new feature called OS X Internet Recovery (Lion Internet Recovery under Lion). This feature works much like standard OS X Recovery but with one major difference: Internet Recovery works even if you don't have a Recovery HD partition, if that partition isn't working properly, or if your Mac’s drive is damaged or not connected.
How does Internet Recovery work? Unlike standard recovery mode, which uses software on a partition of your Mac’s drive, Internet Recovery uses a combination of code stored in your Mac’s firmware and a net-boot image stored on Apple’s servers. Specifically, when you start Internet Recovery, your Mac contacts Apple’s Internet Recovery servers and requests the appropriate disk image to boot your Mac into recovery mode. Your Mac then downloads the necessary code over the Internet and boots. At that point, Internet Recovery works much like standard recovery mode, as described in the next section.
One other difference between standard recovery mode and Internet Recovery is that when you boot into Internet Recovery, the system tests your Mac’s RAM and its hard drive to see if either has any obvious hardware problems. Also, because Internet Recovery requires an Internet connection just to boot, if your Mac is not connected to a working Ethernet network, you’re required to connect to a Wi-Fi network right from the start.
However, while Internet Recovery is a useful feature, and it could even be a metaphorical life-saver should your hard drive die, it has one major drawback: It’s very, very slow compared to standard recovery mode, because it must first download the necessary software. In fact, if you boot into Internet Recovery, the first screen you see displays a slow-moving progress bar along with a warning that booting will take a while.
How do you boot into Internet Recovery? If you’re really curious, you may be able to force your Mac to boot into Internet Recovery by holding down Command+Option+R at startup. However, in my testing, this didn’t work on every Internet Recovery-capable Mac.
If that keyboard shortcut doesn’t work for you, the answer is generally, “You can’t unless you really need to.” As long as you have a valid Recovery HD partition, trying to boot into Internet Recovery will instead boot your Mac into standard recovery mode. Internet Recovery comes into play only if you have a compatible Mac with no working Recovery HD partition—in that case, your Mac automatically uses Internet Recovery. In fact, on one of my Macs, to even test Internet Recovery I had to use a number of tricks to make my Mac’s Recovery HD partition visible and then purposely erase and remove it. Only then, with a blank drive with no Recovery HD partition, was I able to boot into Internet Recovery by holding down Command+R at startup. (If you have a compatible Mac with an easily accessible hard drive, you could simply disconnect your hard drive, but that’s not an option for most current Macs.)
Using OS X Recovery and Internet Recovery
When booted into recovery mode, the tasks you can perform are limited. The four main options are listed in the OS X Utilities window; select one and click Continue to use it.
Restore From Time Machine Backup: You have a backup of your system that you want to restore. If the problems your Mac is having are serious enough that you need to erase your startup drive (perhaps using Disk Utility in recovery mode, below), or if you’ve installed a new drive in your Mac, this option lets you restore, from a Time Machine backup, your entire system, including the OS and all accounts, user data, and settings.
Note that to use this feature, your Time Machine backup must be a complete backup that includes all system files. So if you previously added the System folder, or any other OS-related files and folders, to Time Machine’s exclusion list in the Time Machine pane of System Preferences, you won’t be able to restore your system from that backup using this tool. Instead, you’ll need to reinstall the OS (see the next item) and then use the Mountain Lion Setup Assistant to transfer your data from that Time Machine backup.
Before proceeding, read the important information on the Restore Your System screen that appears when you choose this option. Specifically, note that the Restore From Time Machine Backup feature erases the destination drive—it’s only for restoring an entire volume from a Time Machine backup to its original source (or to a replacement drive). To transfer files from a backup to a new Mac, you should use Migration Assistant or Setup Assistant; to restore individual files and folders, use Time Machine while booted into OS X.
If you’re sure you want to use the Restore From Time Machine Backup feature, click Continue. On the next screen, select your Time Machine drive, then the particular backup snapshot you want to restore from, then the destination drive. You’ll see a final warning that this procedure will erase the destination drive; click Continue, and the drive is erased and the utility begins restoring your files from your Time Machine backup.
Once this process is finished—on a MacBook Air, it took about an hour and a half for approximately 65 GB of data—your Mac will restart from the newly restored drive and you’ll be able to log in normally.
Reinstall OS X: Set up and install a new copy of OS X. Select this option and click Continue, and the OS X installer launches, letting you install Mountain Lion on any supported drive or volume, including the current Mac’s internal drive. However, this version of the installer doesn’t actually include all of the necessary files and data, so installing Mountain Lion from within recovery mode requires an Internet connection to download the actual OS.
When you click Continue on the initial installer screen, you’ll get a dialog stating, “To download and restore OS X, your computer’s eligibility will be verified with Apple.” Clicking Continue sends the necessary information to Apple and then the installer proceeds just as if you were running the Mountain Lion installer normally, with one key exception: Once you select the drive onto which you want to install the OS, the actual data used by the installer—roughly 4GB of it—is downloaded over the Internet. (When I tested the feature, the estimated download time was roughly five hours, although the actual download time was closer to 35 minutes over my cable-modem connection.)
Note that if your Mac didn’t ship with the version of OS X you’re installing—in other words, if you purchased that version of OS X from the Mac App Store—you'll be prompted to enter your Mac App Store Apple ID and password before your Mac downloads the installer data.
Although it’s nice to have the option to install OS X from within recovery mode, having to download the installer data is inconvenient—and if you have a metered Internet connection, it could be quite expensive, as well. Because of this, I recommend using recovery mode to reinstall the OS only if you don’t have a bootable Mountain Lion install drive.
Get Help Online: Browse the Apple Support website to find help for your Mac. Choosing this item and clicking Continue launches Safari (with default settings and bookmarks) to let you browse Apple’s Support site, or any other website, to find answers to troubleshooting problems. You can also check and send email if your email account provides Web access.
When Safari first launches in recovery mode, you’ll see a page called Recovery Information that provides brief instructions on how to perform various tasks in recovery mode. Unfortunately, you won’t be able to print these instructions from within recovery mode, although you can access them when booted from your standard startup drive—see “Recovery HD under the hood,” below.
To get back to the main OS X Utilities window, just quit Safari.
Disk Utility: Repair or erase a disk using Disk Utility. Selecting this option and clicking Continue launches Disk Utility, which you can use to check, repair, erase, or partition connected drives, including your startup drive. (Yes, you can partition your normal startup drive from within recovery mode, although be aware that doing so will erase the drive’s contents.)
If you decide to erase your Mac’s startup drive and reinstall OS X (after making sure you’ve backed up, of course), you’d start here, erase the drive, quit Disk Utility, and then use the Reinstall option (above) to install a new copy of OS X. You can get back to the Utilities window at any time by quitting Disk Utility.
Other options In addition to the four main functions in the Utilities window, recovery mode also offers a few options in its Utilities menu (displayed when viewing the main OS X Utilities screen): Firmware Password Utility, Network Utility, and Terminal. These are the same utilities you can use when your Mac is booted normally into OS X; they let you configure a firmware password, monitor network connections and traffic, and use OS X’s Unix shell, respectively.
What version of OS X does recovery mode install?
You may be wondering what version of OS X will be installed if you use recovery mode to reinstall the operating system. When Lion Recovery debuted last year, the answer to this question was simply, “Lion.” But now that there are two versions of OS X that support recovery mode, the answer is a bit more complicated.
Standard (non-Internet) OS X Recovery Unless there was a problem when installing OS X, your Recovery HD partition should correspond to your hard drive’s OS: Mountain Lion or Lion. (When you install Mountain Lion over Lion, Lion Recovery is updated to the Mountain Lion version.) In other words, if you’re running Mountain Lion and you reinstall OS X from within recovery mode, you get Mountain Lion. If you’re running Lion, you get Lion.
Internet Recovery Unlike OS X Recovery, Internet Recovery relies on your Mac’s firmware, which isn’t updated when you install a newer version of the OS. This means that if your Mac model was released prior to Mountain Lion, you have the Lion version of Internet Recovery, even if you upgrade your Mac’s operating system to Mountain Lion. If you purchase a Mac model released after Mountain Lion’s debut, Internet Recovery will install Mountain Lion. (It’s possible that Apple could release firmware updates for older Macs to give them the Mountain Lion version of Internet Recovery, but it hasn’t happened yet.)
What all this means is that as long as your Mac’s drive doesn’t have serious problems—so it can boot from the Recovery HD partition—holding down Command+R lets you re-install the same version of OS X as is currently installed on your hard drive. If your drive is having serious problems, so your Mac has to boot into Internet Recovery, reinstalling OS X gives you whatever version of the OS your Mac originally shipped with. (On Macs that shipped with Snow Leopard but gained OS X Internet Recovery support via a firmware update, Internet Recovery installs Lion.)
Recovery HD under the hood
If you try to find the Recovery HD partition in the Finder, or even using Disk Utility, you’ll come up empty. Apple’s hidden this partition well, presumably to keep it safe from accidental (or intentional) modifications—after all, what good is an emergency disk if someone has accidentally deleted some of its vital contents?
However, if your curiosity won’t be sated until you’ve been able to browse Recovery HD, here’s how. Just remember: Look, but don’t touch.
1) Open Terminal, type
diskutil list, and press Return.
2) You’ll get output similar to this (If you’ve enabled FileVault, you may see a second list for /dev/disk1):
DanBookAir:~ frakes$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *121.3 GB disk0 1: EFI 209.7 MB disk0s1 2: Apple_HFS DanBookAir 120.5 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3
3) Locate the Recovery HD partition (under Name) and note its identifier—in my case, disk0s3.
diskutil mount [identifier], where [identifier] is, of course, that identifier. This mounts the Recovery HD partition in the Finder. Inside you’ll find a folder named com.apple.recovery.boot.
5) Open the com.apple.recovery.boot folder in the Finder, and you'll see several items. However, you aren't seeing everything—some of the folder's contents are invisible. If you want to see everything that's there, switch back to Terminal and type (or copy from here and paste into Terminal)
ls -al /Volumes/Recovery\ HD/com.apple.recovery.boot/ and press Return. This will display the full list of the folder's contents:
DanBookAir:~ frakes$ ls -al /Volumes/Recovery\ HD/com.apple.recovery.boot/ total 906680 drwxr-xr-x 9 root wheel 306 Jul 12 23:12 . drwxrwxr-x 11 root wheel 442 Jul 13 00:56 .. -rw-r--r--@ 1 root admin 1840 Jul 5 05:19 BaseSystem.chunklist -rw-r--r--@ 1 root admin 448702992 Jul 5 04:58 BaseSystem.dmg -rw-r--r-- 1 root wheel 3418 Jun 20 12:53 PlatformSupport.plist -r--r--r-- 1 root wheel 475 Jul 5 02:56 SystemVersion.plist -rw-r--r-- 1 root wheel 986272 Jul 5 04:57 boot.efi -rw-r--r-- 1 root wheel 361 Jul 12 23:12 com.apple.Boot.plist -rw-r--r-- 1 root wheel 14510577 Jul 5 04:53 kernelcache
Of particular interest is BaseSystem.dmg, a disk image that contains the recovery partition’s bootable copy of OS X and all the recovery-mode utilities. You can mount this disk image in the Finder by typing
open /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg and pressing Return. Once you’ve done that, you can view the Recovery Information page you see when you launch Safari from within recovery mode; just type
open /Volumes/Mac\ OS\ X\ Base\ System/System/Installation/CDIS/OS\ X\ Utilities.app/Contents/Resources/English.lproj/ (all one line) and press Return. You’ll see the contents of the English.lproj folder; find the file RecoveryInformation.html and double-click it to open it in your default Web browser.
When you're done browsing, you can eject Mac OS X Base System as you would any removable volume. You can then unmount the Recovery HD volume by typing
diskutil unmount [identifier], where [identifier] is the same identifier you used above.
[Dan Frakes is a Macworld senior editor. He wishes he had a recovery mode right about now.]
Updated 7/25/12, 7:55pm to mention the Command+Option+R shortcut for Internet Recovery and clarify the paragraph on booting into Internet Recovery.
Hands on with Mountain Lion's OS X...