Creating Recovery Partitions

Allen Golbig has an article on AFP548 on creating a package that will create or update a Recovery partition on a Lion or Mountain Lion volume.

The solution requires you get a few pieces from Apple:

  1. The BaseSystem.dmg and BaseSystem.chunklist from an InstallESD.dmg; found inside “Install Mac OS X” or “Install OS X Mountain”
  2. Apple’s Lion Recovery Update package.

Additionally, Allen’s solution requires the use of Joe Block’s The Luggage, which in turn requires Xcode (or at least the Xcode command line tools) and PackageMaker.

Since getting all of that running might be a nasty hurdle to jump for some, I’ve put together a package template you can use. It’s available here.

To use it, you’ll still need to obtain the dmtest tool from the Lion Recovery Update package and the BaseSystem.dmg and BaseSystem.chunklist from an InstallESD.dmg.

pkgutil --expand RecoveryHDUpdate.pkg ./RecoveryUpdate
cd ./RecoveryUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/
cp dmtest /path/to/CreateRecoveryPartition.pkg/Contents/Resources/

hdiutil attach /path/to/InstallESD.dmg -noverify
cp /Volumes/Mac\ OS\ X\ Install\ ESD/BaseSystem.* /path/to/CreateRecoveryPartition.pkg/Contents/Resources/
hdiutil eject /Volumes/Mac\ OS\ X\ Install\ESD/

When you are done, CreateRecoveryPartition.pkg/Contents/Resources/ should contain:


You’re done unless you’d like to edit the package identifier and/or version in CreateRecoveryPartition.pkg/Contents/Info.plist.

You can now use this package to install a Recovery partition (or update an existing partition).

Creating Recovery Partitions

16 thoughts on “Creating Recovery Partitions

  1. Brian Martin says:

    Very easy to build the package which made it easy to integrate into a Casper workflow. As always Greg, you do an excellent job making the Mac sysadmin’s life easier!

  2. Ellen says:

    Have I mentioned lately that I love you? Thank you so much for making the tools you use available to all of us without your skills. My 700 macs would be completely lost without you.

  3. Burny says:

    Guys, I have all the stuff together (Lion Recovery Update package, the BaseSystem.dmg and BaseSystem.chunklist), but no idea what to do now … could anybody explain that to me?

  4. john says:

    hello, I am very green with this so please bear with me.
    I have downloaded the package file and my Contents directory looks like your post ( it contains the dmtest and the two Base files

    so how do i run it? also do i need to have an empty partition on the disk for it to fit into? or will it hack out part of the first partition?

  5. john says:

    ok, i think i figured out you use installer -pkg ./CreateRecoveryPartition.pkg -target / right ???? if so i have a new question. how can i target the correct disk ? diskutil list shows i have /dev/disk0 – /dev/disk4 and the package got installed on disk4 but i need it on disk0 I realized disk4 was the dmg containing the dmtest and disk1 was the install esd disk so i unmounted both of those and reran the install which said it completed successfully, however i don’t see a recovery partition on any of the remaining disks.

    ps. this is my package install on a mac so any help you could give would be really awesome.

    1. Surely you’ve installed software before.

      Double-click the package and let Installer install it.

      I’m not 100% sure it works on anything other than the current boot volume. If you can’t select another volume, you might need to boot from the desired volume, then install the package.

  6. john says:

    i have installed software, just not used a mac. first time i have used the command line for that.

Comments are closed.