How can I create or recreate a Lion recovery partition?

For whatever reason, one of our macs didn't make a recovery partition when it upgraded to Lion.

Is it possible to add a recovery partition after the fact?


To be clear - on a normal mac, the recovery partition is hidden in both the Startup Disk system preference and the Disk Utility. You can only see it from the command line with a direct command, diskutil list or enabling the debug menu in Disk Utility. It also shows up if you boot with the option key held or if you successfully boot to recovery with Command-R a.k.a. +R during boot.

Warning - this question and answer ONLY APPLY to 10.7.x Lion - using the Lion installer to recreate recovery on newer OS can and will cause problems due to drivers not being present for newer OS and hardware.


Solution 1:

First, open a Terminal.

Status before:

$ diskutil list
/dev/disk0
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:      GUID_partition_scheme                        *128.0 GB   disk0
  1:                        EFI                         209.7 MB   disk0s1
  2:                  Apple_HFS Macintosh HD            127.8 GB   disk0s2

Get Lion Recovery Update v1.0 (431.91 MB)

Mount RecoveryHDUpdate.dmg

$ hdiutil attach ~/Downloads/RecoveryHDUpdate.dmg

Extract data from RecoveryHDUpdate.pkg

$ pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg ~/Desktop/RHD

Mount RecoveryHDMeta.dmg (in the RecoveryHDUpdate.pkg package)

$ hdiutil attach ~/Desktop/RHD/RecoveryHDUpdate.pkg/RecoveryHDMeta.dmg

Run tool that will finally resize current partition and create recovery

$ ~/Desktop/RHD/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / /Volumes/Recovery\ HD\ Update/BaseSystem.dmg 0 0 /Volumes/Recovery\ HD\ Update/BaseSystem.chunklist
Creating recovery partition: finished

Status after:

$ diskutil list
/dev/disk0
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:      GUID_partition_scheme                        *128.0 GB   disk0
  1:                        EFI                         209.7 MB   disk0s1
  2:                  Apple_HFS Macintosh HD            127.2 GB   disk0s2
  3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

Solution 2:

Rerunning the Installer works for OS X 10.7, 10.8 and 10.9 - running the recovery disk assistant isn't a good idea if you are running 10.8 or newer OS as well as hardware that ships with newer builds of OS.

The Lion Recovery Disk Assistant can make a backup copy of the recovery partition.

The Lion Recovery Disk Assistant lets you create Lion Recovery on an external drive that has the same capabilities and limitations as the built-in Lion Recovery. Just as a backup copy of a good file needs to be made before the file comes upon it's demise, this tool will not help if you start with a partition that is missing or broken.

Re-running the Lion installer will create a workable recovery partition.

To get the Installer (since we didn't save it and it deletes itself on running the first time).

  1. Start the App store and pick any view except Purchased.
  2. Hold the option key while selecting Purchased.
  3. Download the Lion Installer

It took a good 35 minutes to run the installer again. Disk Utility hides the Recovery HD (and other partitions by default) unless you enable a debug menu. You can use the diskutil list to see the Recovery HD if you don't mind terminal.app commands.

mac:~ mike$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            999.3 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

The debug menu looks as follows - selecting show every partition will let you see whether your Recovery HD is on your drive.

enter image description here

https://apple.stackexchange.com/users/8527/z4mba pointed out these hidden commands from this MacWorld article. I only needed to turn on/off the one command:

  • defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true

I don't know if you can move a Recovery HD around like a normal partition or need the other defaults write command to roll your own recovery HD, running the Lion installer a second time was fine for my needs. As many have pointed out, it appears that the recovery contents are not universal and instead customized for the specific hardware, so recreating it from the official tools is much preferred unless you wish to test well and are saving time by automating tens or hundreds of macs and can control for hardware differences in your process.

Solution 3:

If you reinstall OS X from App Store, it also recreates a recovery partition. I just tried it on a VM. First I removed the Recovery HD partition. Then I reinstalled OS X from App Store:

It took about two hours, and after that I had a working recovery partition again.

Reinstalling OS X over an existing installation is similar to upgrading to a new major version of OS X, or it keeps user files and settings in place but replaces system files with new versions. Apple should call it something less scary like "repairing OS X", because it is the solution to a lot of issues like this, and it is not such a drastic operation especially if you have backups.

Upgrading to a new major version of OS X will also add a missing recovery partition.

Reinstalling OS X is also recommended by SuperDuper's developer:

Actually, you can easily recreate the recovery partition by simply reinstalling Lion from the App Store. (This has the additional benefit of updating the recovery partition with the most recent data, too.)

Carbon Copy Cloner has an option to add a recovery partition, but it needs to copy the recovery partition from another disk or a backup archive. If your Mac doesn't have a recovery partition, Carbon Copy Cloner recommends reinstalling OS X:

Solution 4:

While all of the solutions outlined in this discussion will probably work, if you're using the latest version of OS X someone was kind enough to create an AppleScript that does the entire process automatically without having to run any commands from your terminal or trying to carefully manage system partitions.

I've tested it out on Mavericks (10.9.4) and it worked great. After running the tool, I was able to enable FileVault 2 which previously refused to activate because my machine was missing a recovery partition.