Articles July 30, 2011 at 3:59 am

Creating a OS X Lion Recovery HD Partition

<code>       OS X Lion&amp;rsquo;s Recovery HD partition is required for some new Lion features, like FileVault 2 (&lt;a href=""&gt;http:/ /;/a&gt;). Unfortunately NetRestore does not create this partition. A supported way of setting this partition up is to install a minimal OS X Lion system first.&lt;br /&gt; &lt;br /&gt; Since NetInstall uses the installer command to create the partition we can do the same.

Read on for more… 

The first step is to mount the InstallESD.dmg from within the "Install Mac OS X" App. To only have a minimal installation you can create an installation choices XML file for that purpose.

With the following command you can create a choices XML-file and place it on your Desktop. Note that “myHD” is the name of the empty partition that you want to install the NetRestore image on.

 installer -pkg /Volumes/Mac OS X Install ESD/Packages/OSInstall.mpkg -target /Volumes/myHD -showChoiceChangesXML > ~/choices.xml

To only install the necessary packages you can set all the attributeSetting keys to zero except for the EssentialSystemSoftware and EssentialSystemSoftwareGroup dict entries. You should keep this modified choices file for all future installations.

Big thanks to Rich Trouton for sharing his choices XML file 
Now you run the minimal installation with the modified choices file.

 sudo installer -pkg /Volumes/Mac OS X Install ESD/Packages/OSInstall.mpkg -target /Volumes/myHD -applyChoiceChangesXML ~/choices.xml

After the installer is done you should have a shiny new Recovery HD partition on the disk. Once the Recovery HD is created you can deliver a NetRestore or asr image to the main data partitions without harming it in any way.

1 Comment

  • nice. thanks,

    Anyone know of a way to use the “Reinstall Lion” option with a local repository and not Apple’s?

Leave a reply

You must be logged in to post a comment.