MacOS – How to create a new Recovery Partition on EXTERNAL disk

external-diskmacosrecovery-hd

I want to enable encryption on an external FireWire disk. The disk has been formatted a while ago (2+ years), and when choosing "encrypt volume" from the Finder context menu, Mountain Lion refuses with the message:

A Recovery system for the targeted disk is required

Turns out: You need a Recovery Partition (RP) on the external disk you want to encrypt. Mine does not have one, as it was formatted when there were no Recovery Partitions.

Reformatting the drive does create a new RP, but I can’t do this because I have no spare disks where I can swap the data to.

This hint is not useful, as it deals with internal disks.

So I am looking for a way to create a Recovery Partition on the external disk so that I can enable encryption for this disk. (How) can this be done?

EDIT: Yes, there is space on the disk for another partition. diskutil list:

/dev/disk2
   #:                       TYPE NAME           SIZE       IDENTIFIER
   0:      GUID_partition_scheme               *320.1 GB   disk2
   1:                        EFI                209.7 MB   disk2s1
   2:                  Apple_HFS le_disk        306.7 GB   disk2s2

EDIT II:

Output from an other disk. Here, encryption of a partition (FreeSpace-500) has worked directly from Finder. Note that the (invisible) boot partition created during the process is called Boot OS X, and not Recovery HD.

/dev/disk2
   #:                       TYPE NAME                SIZE       IDENTIFIER
   0:      GUID_partition_scheme                    *2.0 TB     disk2
   1:                        EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS TimeMachine         1.5 TB     disk2s2
   3:          Apple_CoreStorage FreeSpace-500       503.3 GB   disk2s3
   4:                 Apple_Boot Boot OS X           134.2 MB   disk2s4

Best Answer

Manually Cloning a Recovery Partition

This process worked for me on an external USB drive, but I don't have a Firewire drive or encrypted partition to test with, but it should work for you.

Requirements

  • Existing recovery partition on your internal drive (or elsewhere).
  • At least 650 MB of free space on your external drive (a previous version of this answer required more space, but I fixed the first section to only use what's required).

Add New Partition

Notes: this process is not destructive, provided you have sufficient free space on your drive.

  1. In Terminal, run diskutil list. You should get output like this:

    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *120.0 GB   disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh SSD           119.2 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *320.1 GB   disk1
       1:                        EFI                         209.7 MB   disk1s1
       2:                  Apple_HFS Portable                319.7 GB   disk1s2
    

    Make note of the identifiers for your existing recovery partition (in my case, disk0s3) and the main partition on your external drive (disk1s2).

  2. Run diskutil info disk1s2 | grep 'Total Size', replacing disk1s2 with the identifier for your external volume. Note the number of bytes listed.
  3. Run diskutil resizeVolume disk1s2 Xb JHFS+ Temp 650002432b, replacing X with the total number of bytes from step 2 minus 650002432. This will repartition your disk, giving us a new partition with exactly enough space for the recovery partition. Note: A recovery partition is not always 650002432 bytes. Find out the exact size by checking diskutil info on the partition you want to copy.
  4. The resizeVolume command will print out the new partition map (like in step 1), make note of the identifier for the new partition (labelled Temp).

Clone Existing Recovery to the New Partition

  1. Run the following command in Terminal to clone the recovery partition to the new partition, replacing disk0s3 and disk1s3 with the appropriate identifiers for your partitions:

    sudo asr -source /dev/disk0s3 -target /dev/disk1s3 --erase
    

    You will be asked for your password, and to verify that you want to erase the contents (type y followed by enter), then the cloning process will begin.

  2. Unmount the recovery partition if it's mounted, then run sudo asr adjust --target /dev/disk1s3 --settype "Apple_Boot". Be sure to replace disk1s3 with the appropriate identifier. This sets the proper partition type, which stops OS X from auto-mounting the recovery partition when you attach your external drive.

If everything completed properly, you should have a working recovery partition on your external disk.