recovery partition corruption

ifbell
Contributor

Okay I am using a monolithic build with casper to set up a fleet of identical machines. I am noticing with this 10.9.5 build that after I grab my image from the built drive not the whole disk and I apply that image to a new machine I get file vault issues. Specifically it acts like the recovery partition does not exist. Using diskutil command I have a recovery partition in place. What I have had to to do to fix this is do the reboot then command + R and the machine rebuilds the recovery partition and all is well.

2 REPLIES 2

rcorbin
Contributor II

We have been seeing some issues like this as well. Upon boot we often get what looks like a firmware progress indicator that runs for a bit and then the machine shuts off.

cdev
Contributor III

I've been imaging systems since we deployed Mavericks with one of two different imaging methods. Initially, we were using a script that built a custom recovery partition creator .pkg using a few scripts (you can find it here on JN), but I found this clunky and difficult to recreate as the partition was updated. Instead, I've shifted to creating a disk image of the recovery partition and using Casper Imaging to apply this during the imaging process.

First, check which partition and slice is your recovery partition:

diskutil list

This will return something similar to this:

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD           *498.8 GB   disk0s2
   3:                 Apple_Boot Recovery HD             815.0 MB   disk0s3

You can see the recovery partition resides on disk0s3. Now that we know where this is, we can do a little terminal magic to change the partition type to make this visible to Disk Utility:

Warning: don't do this if you've already enabled FileVault – I made that mistake and destroyed the CoreStorage volume of my computer causing the entire machine to lose the bootable partition. Heh, whoops.

sudo asr adjust -target /dev/disk0s3 -settype "Apple_HFS"

Now that the partition is the proper type, open Disk Utility, highlight the image in the left sidebar and create an image of it.

You can now upload this .dmg file to Casper Admin like any other OSX base image. Set the priority for this .dmg to run as 1. Now edit your configuration, add a second partition, and make it as small as you can (1GB/1% max size). Name it, check the box to make it a recovery partition, and select your new recovery partition image.

The last part you need to do is include the free "Hide Recovery Partition" script from the free resources here on JN as part of your imaging process, or the partition will mount like your primary partition. Ensure in this script the name of the partition it is hiding matches the name you set when you edited the configuration!

Using this imaging process, I've had a very simple and streamlined method of creating and applying the appropriate partition during the imaging process and it's been wonderful!