1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Create Recovery Partition

Discussion in 'OS X Mavericks (10.9)' started by Dalton63841, Jun 13, 2013.

  1. Dalton63841, Jun 13, 2013
    Last edited: Jun 25, 2013

    macrumors 65816


    With the new 10.9 beta installer, a recovery partition is not created if you use a DIY USB installer. The reason for that is because the BaseSystem.dmg needs to be copied onto the Recovery partition, but it does not exist as a dmg file on the USB Installer. This presents a problem for some, as functions like "Find My Mac" and FileVault won't work without it. Here are the instructions to fix that. I am not responsible for your system... Blah blah blah normal disclaimer. It will not break Boot Camp so no worries there.

    Standard Recovery Partition(UPDATED EASIER!!!)

    1. Download the Lion Recovery Update. Make sure it is in your downloads folder. Then right click on the OS X Installer.app file and click Show Package Contents. Go to Contents/SharedSupport/. Copy the InstallESD.dmg file into your Downloads folder.

    ###Alternate Lion Recovery HD Update Link

    2. Copy the following code into a text document and save it as "recovery.sh" in your Downloads folder.
    read -p "Ensure "RecoveryHDUpdate.dmg" and "InstallESD.dmg" are in your Downloads folder and press [Enter]"
    #access dmtest from RecoveryHDUpdate.pkg
    rm -rf /private/tmp/RecoveryHDUpdate
    echo "Expanding RecoveryHDUpdate.pkg"
    hdiutil attach -nobrowse ~/Downloads/RecoveryHDUpdate.dmg
    pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /tmp/RecoveryHDUpdate
    #access BaseSystem.dmg and BaseSystem.chunklist
    echo "Expanding InstallESD.dmg"
    hdiutil attach -nobrowse ~/Downloads/InstallESD.dmg
    #build Recovery partition
    echo "Building Recovery Partition. Please Wait"
    /tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg 0 0 /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist
    echo "Cleaning up"
    hdiutil eject /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update
    hdiutil eject /Volumes/OS\ X\ Install\ ESD/
    sudo touch /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
    sudo kextcache -f -u /
    exit 0
    3. Open Terminal and type the following commands:
    chmod +x ~/Downloads/recovery.sh
    sudo ~/Downloads/recovery.sh
    4. Wait a few minutes for it to finish and return back to a prompt. Reboot to test your new recovery partition.
  2. macrumors 65816


    Instructions significantly simplified. I took down the instructions for the full offline installer. Some kind of signature check is performed, so modifying the Recovery partition breaks it. I can get it to boot to a working offline installer, but it stops being recognized as a proper recovery partition.
  3. macrumors G5


    For the first time in years, I don't have a "Spare" Mac but I wish I did....with just my Imac and my rMBP, both of which are essential to me, I can't play with 10.9 yet, but it looks a lot more interesting than previous incarnations since SL.
  4. macrumors regular

    Great post! Wish I would've seen it earlier... took the easy way out and ran the installer from inside os x and it created the recovery partition that way. :apple:
  5. macrumors 65816


    Didn't even know that was an option. Still, there are certain instances where the installer refuses to make a recovery partition. Usually because of odd hard drive or partition setups. This gets around that.
  6. torana355, Jun 14, 2013
    Last edited: Jun 14, 2013

    macrumors 68000

    I tried it but it comes up with syntax errors. :(
  7. macrumors 65816


    It either copied wrong, or else the text editor is messing it up. Try this:

    Attached Files:

  8. macrumors 68000

    That worked a treat. Thanks! I wonder why my text file didnt work, it looked the same lol.

    EDIT: i figured it out, the apple textedit app defaults to RTF on a new document instead of plain text. Doh lol
  9. macrumors 65816


    What text editor did you use?
  10. macrumors 68000

    The standard Apple textedit app. I set it to plain text in preferences and it works fine now :) Thanks for your help.
  11. macrumors 65816


    Glad it worked! I kind of figured it was something like that. Some text editors edit line breaks in a way that screws up shell scripts.
  12. macrumors 65816

    Great stuff! Worked for me too (on a 2011 mba dual booting lion and mavericks).

    I just want know though as other developer previews and public versions of mavericks are released and we continue to use bootable usbs to install these, would we have to redo the process to update the recovery partition as well?
  13. Dalton63841, Jun 15, 2013
    Last edited: Jun 15, 2013

    macrumors 65816


    I am pretty sure you would. But on the bright side you don't have to do anything special when that happens. If you don't have a recovery partition, this script builds one, but if you do already have a Recovery partition, the script will just update the Recovery partition with the new files.

    I thought about adding a few lines to the script to handle getting the LionRecoveryHD.dmg, and deleting that file after it's done.

    Pros: You wouldn't have to redownload or keep up with that file, or mess with it at all. You would literally just drop the InstallESD.dmg into your Downloads folder, and run this script.

    Cons: It would add on up to about 5 minutes to the amount of time it takes the script to run. Because of this, I am going to see what people think before I change it.
  14. macrumors 65816

    But you know what's going to happen? I reckon a lot of people will make the recovery partition once, happily update their system with usbs without taking care to update the recovery partition at all. I think that's fraught with danger and I'm not suggesting that I'm in that category.......


    You know what I mean. I really don't like what apple have done with the installesd file! It has essentially separated the installation of the system and recovery partition. Before it used to be done together from bootable usbs (the old way) so there was no possibility of having an updated system without an updated recovery partition. So it never was an issue before. But now it may become a big issue for those who choose to update with usbs!

    I'm happy that you made the script file and it will be good for those who need it. But my point is that we shouldn't need it at all!

    Apple should go back to the old way so that systems and recovery partitions are updated together from bootable usbs restored directly from the installesd file.
  15. macrumors 65816


    I agree completely. Honestly I will NEVER use my Recovery partition to reinstall. The only reason I made this script to build one is because it is required for "Find My Mac" and Filevault to work at all. And I'm willing to bet most feel the same. It's a nice idea, but having to download all the installation files from apples servers is hugely time consuming, especially when I can just keep a flash drive installer in a drawer that will do the same thing in 20 minutes.

    Also, if I'm needing to jump into the Recovery partition to use Time Machine, disk utility or terminal to fix something, those tools won't be broken, even if it is outdated.
  16. macrumors member

    I am unable to install mavericks as it claims a recovery partition would not be created, the installer just plain refuses to continue and boots back into ML, would this sort that issue?
  17. macrumors 65816


    Possibly. If there is a recovery partition before you try to install Mavericks it may go ahead and use it. BUT! Use the InstallESD for Mountain Lion, since that is what is currently installed. I can't predict what it will do if you install a Mavericks recovery partition to a Mountain Lion install.

    After the recovery partition is built, then try installing Mavericks again and let me know what happens.
  18. macrumors demi-god


    When I initially just upgraded to Mavericks from Mountain Lion, it also upgraded my Recovery partition from 10.8 to 10.9.

    However I wanted a fresh install so Restart - Option - Boot to 10.9 Recovery Installer and no matter what I did, 10.9 would not complete a fresh install from recovery.
    I ran DiskUtility from recovery and formatted the SSD, the installer would just sit on trying to connect to my iTunes/AppStore account to verify my 10.9 was legit. It sat there for 45 minutes before I gave up and created the(your) USB Install.
  19. macrumors 65816


    Yea the regular recovery partition is kind of a PITA, and especially useless since they don't even have anything set up for the beta to actually do a store. That's why I went ahead and did THIS
  20. macrumors member

    When I try to download the Lion Recovery Update from Apple I get a 404. Does anyone have the file?
  21. Dalton63841, Jun 25, 2013
    Last edited: Jun 25, 2013

    macrumors 65816


    I did notice that the download for that file seems to be sporadic... Sometimes it works and sometimes it drops a 404. Give me a bit to upload it to my Skydrive. It's a 452Mb download.

    EDIT: Added a dropbox link since the main link for Lion Recovery HD Update is wonky.
  22. macrumors 65816

  23. Dalton63841, Jun 27, 2013
    Last edited: Jun 30, 2013

    macrumors 65816


    Thanks for that...

    In other news, I built an ApplescriptObjC application that can:

    1. Check whether or not you have a recovery partition.
    2. Destroy the recovery partition and add that space back into the root volume.
    3. Create a standard recovery partition.
    4. Create an offline recovery partition.

    You choose which one you want to do, and if it is option 3 or 4 you choose your InstallESD.dmg and it handles the rest. Works on Lion, ML, and Mavericks.

    If anyone is interested in it just let me know.
  24. macrumors 65816

    Yeah. I'm interested. Why don't you just attach it here somewhere so we can download it?
  25. macrumors member


Share This Page