Restoring a deleted recovery partition on a Mac

Update

This is only one method to restore the missing recovery partition. Check out Recreating a deleted recovery partition on a Mac for another method.

The Missing Recovery Partition Problem

I don't actually know how a recovery partition gets deleted, but I've come across a few Macs with the partition deleted, and I've been looking for a way to restore them, because if you don't have the recovery partition and you want to boot into recovery mode (holding down Cmd-R at startup), you'll have to boot into Internet Recovery Mode (which will involve you connecting to a wireless network and downloading a temporary recovery).

Outdated Solution

Apparently, for Mac OS X Lion and Mountain Lion, Apple had this program called Recovery Disk Assistant that let you install a recovery partition (on an external drive, but presumably you could do it on an internal one, too). I also found an article from April, 2015 talking about Recovery Disk Assistant and OS X Lion. The one comment on the article says This may be a dumb question, but I have a slow internet. Can I do this with Yosemite? No reply there. It would be great to have solution that works for Yosemite.

Less-than-ideal Solution

I found an article called Pro tip: Restore the recovery partition in OS X 10.10 Yosemite that advises either reinstalling OS X (not ideal) or restoring using Carbon Copy Cloner. I tried to follow the instructions to restore using Carbon Copy Cloner, but I couldn't find a Recovery HD button to click.

Working Solution

I finally figured out a solution on my own (with lots of help from Apple Boot Partition and Enable Disk Utility's Debug Menu).

The gist of it is you clone an existing recovery partition and then change it to an Apple Boot partition. Details to follow.

What you'll need:

  • One Mac missing a recovery partition (of course—that's why you're here, right?). I'll refer to this Mac as Mac #1.
  • At least one other Mac that already has a working recovery partition on it. I'll refer to this Mac as Mac #2.
  • A Thunderbolt cable to connect the two Macs.

Boot into Mac #2, log in as an admin user, and then paste into Terminal.app the following command so you'll be able to see the debug menu in Disk Utility:

defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
restorerecoverypartition00
When you launch up Disk Utility afterwards, you should see a new menu called Debug. From that menu, select Show every partition. You should now be able to see hidden partitions (including one called Recovery HD).

Boot Mac #1 into target disk mode and then attach it to Mac #2 using a Thunderbolt cable. You should see Mac #1's partitions show up in Mac #2's Disk Utility.

restorerecoverypartition01
Click on Mac #1's hard drive (not the partitions underneath), select the Partition tab, and click the plus sign (+) to add a new partition. You won't be able to drag the partition size to be very small (I think the smallest you can make the new partition by mouse-dragging is about 6 GB), but if you type in a value (e.g., .65—or anything less than 1), it'll automatically bump the value up to 1.07 GB. That should be fine, since the normal recovery partition is 650 MB, which isn't that far off from 1.07 GB. If you want to make the partition even smaller, you can explore disk management from the command line.

restorerecoverypartition02
You'll be asked if you really want to repartition. You backed up your data on Mac #1 already, right? Or the data isn't that important to you? Either way, repartitioning is usually fine, but there is a small risk you could lose data. Act accordingly.

restorerecoverypartition03
Once you have repartitioned Mac #1, click on Recovery HD for Mac #2 and select the Restore tab. Drag Macintosh HD 2 (the newly-created small partition) to Destination, and then click Restore.

restorerecoverypartition04
Click Erase, when prompted.

restorerecoverypartition05
When it's done, we still have one more important step to undertake. You'll see, if you click on the old Recovery HD, that its Partition Type is Apple Boot Partition.

restorerecoverypartition06
And the new Recovery HD's Format is Mac OS Extended (Journaled). If you leave it that way, holding down Cmd-R at startup will still go to Internet Recovery Mode instead of regular Recovery Mode (and manually selecting the new partition by holding down the Option key at startup will just lead you to a do-not-enter symbol).

restorerecoverypartition07
Close out Disk Utility and launch up the Terminal. Enter the command

diskutil list
to list out the partitions and drives.

Identify the partition to fix. It should be TYPE Apple_HFS and NAME Recovery HD. In this case, it's /dev/disk2s3, but be sure to look at how it's displayed in your setup (the numbers may be different from this example).

Unmount the partition (substitute your numbers for #, where appropriate):

diskutil unmountDisk /dev/disk#s#
Then put in a command like the following (substituting in your actual disk numbers) to change the partition type:
sudo asr adjust -target /dev/disk#s# -settype Apple_Boot

restorerecoverypartition08
If you launch up Disk Utility now, you should see that the Recovery HD on Mac #1 is type Apple Boot Partition, and recovery mode should now work on that Mac.

1 thought on “Restoring a deleted recovery partition on a Mac”

Leave a Reply

Your email address will not be published. Required fields are marked *