Home > create_macos_recovery, Mac administration, macOS, macOS Recovery, Scripting > Rebuilding your macOS Recovery volume or partition with create_macos_recovery

Rebuilding your macOS Recovery volume or partition with create_macos_recovery

I recently got an email from a former colleague, requesting assistance with a problem they were seeing. They were cloning drives with macOS Catalina, but their cloning process was not including the Recovery volume. Was there a way to create a new Recovery volume on a macOS Catalina boot drive that didn’t have one?

I did some research on this and found that there was a script to do this on High Sierra and Mojave, but it didn’t appear to work anymore.

With some more digging, I was able to figure out why. The script was downloading and expanding a macOSUpd10.13.6.RecoveryHDUpdate.pkg installer package from Apple’s Software Update service in order to get access to a dm tool included with the installer package. This installer package was no longer available from the Software Update service, but a similar package named SecUpd2019-005HighSierra.RecoveryHDUpdate.pkg with the same dm tool was available.

Once I verified that I could get the same results using the SecUpd2019-005HighSierra.RecoveryHDUpdate.pkg installer package, I wrote a script (based on the original one I had found) to help automate the process of rebuilding a macOS Recovery volume or partition. For more details, please see below the jump.

Downloading the script

The create_macos_recovery script is available from the following location:

https://github.com/rtrouton/create_macos_recovery

Once you have the script downloaded, run the create_macos_recovery script using root privileges with one argument:

  • The path to an Install macOS.app

Using the script

If you have a macOS Catalina 10.15.0 installer application available in your Mac’s /Applications directory, run this command with root privileges:

/path/to/create_macos_recovery.sh "/Applications/Install macOS Catalina.app"

Screen Shot 2019-10-20 at 10.50.48 PM

If successful, you should see output like this appear:

Once the script has finished running, you should be able to verify that you can boot into Recovery.

Screen Shot 2019-10-20 at 10.55.04 PM

Testing notes

Before any use in production, I strongly recommend testing this script on test systems and verifying that this also works for you. Please see below for what I have tested this script with:

OS versions:

  • macOS 10.13.6
  • macOS 10.14.6
  • macOS 10.15.0

OS installers:

  • Install macOS High Sierra.app (for 10.13.6)
  • Install macOS Mojave.app (for 10.14.6)
  • Install macOS Catalina.app (for 10.15.0)

Test systems:

  • Virtual machines running in VMware Fusion 11.5.0

Note: I have only tested on systems where FileVault encryption has not been enabled.

 

  1. Patrick Morton
    October 21, 2019 at 2:15 pm

    Great information. However your line “They were cloning drives with macOS Catalina, but their cloning process was not including the Recovery volume” piqued my interest.. I assume you are not talking about cloning an entire image but something else?

    • October 21, 2019 at 2:45 pm

      I honestly don’t know what process they were using.

  2. FritzscCorner
    October 21, 2019 at 3:43 pm

    It seems like the only way to reinstall Catalina is if FileVault is not enabled. I see you indicated you hadn’t tested on a FileVault encrypted system. In my testing, both local recovery mode and internet recovery mode only give you the option to Reset a users password or erase the drive. Once FileVault has been disabled or the Drive is erased we are then able to boot back into recovery mode (Internet recovery mode if the drive was erased) to reinstall the OS. It adds an extra step to rebuilding Macs that are reclaimed and getting ready for re-deployment. Hopefully I am missing something and there is a better way to do this for Catalina.

  3. Selim
    November 27, 2019 at 9:08 pm
  4. January 24, 2020 at 10:57 pm

    Greetings! I ran the script with the High Sierra installer, with the drive being HFS+. In the end, I ended up with the following:

    “: Error: Couldn’t attach disk image (-69736)
    — Failed to create 10.13.6 Recovery partition on Macintosh HD.
    — Recovery tools returned the following non-zero exit code: 1”

    Any clue on what I need to do to have it complete successfully? Thanks!

  5. FN
    February 20, 2020 at 6:44 pm

    Looks like Apple removed the download link for “SecUpd2019-007HighSierra.RecoveryHDUpdate.pkg”. Do you by chance know of any other source for it? I tried to extract it from “SecUpd2019-007HighSierra.dmg” but all I get there is an empty directory. Thanks!

  6. FN
    February 20, 2020 at 7:07 pm

    Nevermind, figured it out… simply download the full update DMG, then extract the contents of the installer package via Terminal.app using “pkgutil –expand” (drag and drop source pkg and destination folder separated by a space).

  7. Steve Osborn
    March 24, 2020 at 3:41 pm

    How can I back-grade to Mojave from Catalina on my recovery partition? This installer fails because it won’t overwrite a newer OS. I’m running patched Catalina on a 2010 Mac Pro. I tried installing the Mojave recovery partition using this script after the Catalina version gave me the circle-slash upon recovery startup (OS too new for this computer, circle-slash and shutdown). Here’s the output from the script:

    — The macOS installer app provided installs 10.14.6’s Recovery, which is earlier than macOS 10.15.3
    — Please use an installer app which installs macOS 10.15.3 or later.

    How can I get around this and just install Mojave onto the recovery partition while leaving my Catalina main partition alone? Thanks!

    • Steve Osborn
      March 24, 2020 at 4:49 pm

      Disregard. I figured it out. I just commented lines 94-99 in the script to disable the version checker. Worked like a charm. THANK YOU for a fantastic solution to a rather obscure problem!

  8. March 25, 2020 at 3:20 pm

    Your instructions state:

    > Using the script
    >
    > If you have a macOS Catalina 10.15.0 installer application available in your Mac’s /Applications directory, run this command with root privileges:
    >
    > 1
    /path/to/create_macos_recovery.sh “/Applications/Install macOS Catalina.app”

    I’m not seeming to find that file? Mostly, I’m trying to take an MBP13 and update its recovery partition from Mojave to Catalina so that each time I have to whack the instaled OS, I don’t also have to upgrade (it’s a testing system, so, rebuilds are frequent and would love to save myself some time on each rebuild).

  9. Gordon Bezzina
    April 3, 2020 at 9:11 am

    file SecUpd2020-001HighSierra.RecoveryHDUpdate.pkg is failing to download. Is there an alternative file or location to get it from.

  10. April 7, 2020 at 9:43 pm

    Ejerce do can I get for encriptes Macintosh HD?

  11. pademaret
    May 12, 2020 at 12:46 pm

    Thank you very much for this powerful script. I used a slight modification to install the recovery partition on an external disk. This script is brilliant !

    • J T
      June 2, 2020 at 5:25 am

      what line(s) did you modify to point this script to another volume?

  12. May 18, 2020 at 12:23 am

    What aboyó ir you era sed Teherán dial and reserva the Mac and appears a folder with ?

  13. J T
    June 4, 2020 at 5:50 pm

    can anybody point me the right direction on which lines to modify on the scrip to install the recovery partition on a different volume?

  1. No trackbacks yet.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: