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 Lion.app” or “Install OS X Mountain Lion.app”
  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:

BaseSystem.chunklist
BaseSystem.dmg
dmtest
en.lproj/
package_version
postflight

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).

Explore posts in the same categories: Deployment, Lion, Mountain Lion, OS X

16 Comments on “Creating Recovery Partitions”

  1. Andy Says:

    I was going to have to tackle this myself next week; now I don’t have to! Thank you very much! :)

  2. asdasdffasd Says:

    FYI, BaseSystem.chunklist and BaseSystem.dmg will be hidden unless you have show hidden files turned on in Finder.
    Thanks! It appears to have worked!


  3. [...] HD to restore, it can be time consuming to build and capture these images. Some admins have taken a packaging approach to creating Recovery HD partitions, which is great for a wide number of deployment tools [...]

  4. 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!

  5. Derick Says:

    Thank you for this!

  6. 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.

  7. 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?

  8. 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?

  9. GregN Says:

    If these tools and instructions are too difficult to follow, you might be interested in this: https://github.com/MagerValp/Create-Recovery-Partition-Installer

  10. 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.

    • GregN Says:

      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.

  11. john Says:

    that is my first package install crap now i can’t type!

  12. john Says:

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

  13. ZenCoder Says:

    thanks! invaluable and helpful article … (:


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 170 other followers

%d bloggers like this: