Restoring a lost Recovery Partition (Volume) in Lion

March 14, 2012 by Christopher Silvertooth

*****  IMPORTANT *****  I have updated the script for Mountain Lion.  Please follow this link.

http://musings.silvertooth.us/2012/08/recovery-partition-creator-v2-0/

Also I have a brand new version that at this time only works with 10.8.  It is done in Applescript and can add a recovery partition to any drive.

http://musings.silvertooth.us/2013/05/recovery-partition-creator-3-0/

I was on site working with a customer when we realized that we could not enable Filevault 2.  A quick look at the output of “diskutil list” from the terminal told us the recovery partition had gone missing (required if you want Filevault disk encryption).  Well, we had already spent a good deal of time deploying and configuring the Mac Image as well as the Boot Camp image so we didn’t want to “re-install lion” just to regain the Recovery Partition – which in turn allows us to encrypt the drive.

Sooo… We scoured the internet looking for the best way to recover this.  I found a post from a Google employee, Clay Caviness, who figured out how to put the recovery partition back.  I tested his commands and they worked as described.

I decided to go a step further and script those commands so I could save myself some typing and any human errors.

The script will, if you are connected to the internet, download the Recovery Image from Apple and then create the Recovery partition on the primary drive.  If you already have the Recovery image file and it is named “RecoveryHDUpdate.dmg” then put that in the directory you run my script from.  It will save you the step of downloading the 450MB file from Apple.

Here is the download for the script.  The file has a filetype of .command which allows you to run it from the Finder more easily.

NOTE:  Make sure you run Disk Utility and verify that your hard disk does not have any errors.  If there is something wrong the process will not work correctly.

If you have a botched Recovery Volume then you need to remove it before running my script.  To do this  follow these directions.

1.  Find the botched Recovery Volume by running “diskutil list” in the terminal app.  You need the identifier e.g. disk0s3

2.  Now erase the data on the bad Recovery HD


diskutil eraseVolume HFS+ ErasedRecoveryHD disk0s3

3.  Now merge the erased disk with the “Macintosh HD”


diskutil mergePartitions HFS+ "Macintosh HD" disk0s2 disk0s3

4.  Now you can run my script and it will create a brand new “Recovery HD”

Cheers,

Chris

Keywords:  missing, volume, partition, mac, lost, filevault, find my mac

apple / google / Mac Fixes / tools

Comments

  1. matt says:

    The download link is broken. I came here from your Google+ follow-up to the how to

    • Christopher Silvertooth says:

      Thanks for the update Matt. I made a quick change to the file last night because I realized it didn’t work if you had a directory with a space in it. So I updated the file but forgot to fix the links.

      It should work for you now if you refresh the page.

  2. tyler says:

    Thank you so much! I am running your script now. When i upgraded my hdd to ssd, i lost my recovery in the process and thus lost my find my mac feature. I will post when it works.

  3. tyler says:

    Worked! Thank you.

    • Christopher Silvertooth says:

      Awesome. I have tested the script on both a Macbook Air and Macbook Pro. Glad to know it works beyond my environment ;-)

  4. Keith says:

    Nice job with the script. Works great. I booted into an external drive with Lion 10.7.3 and ran it. Nice not to have to type all the Terminal commands. :)

  5. upperaust says:

    Worked for me too, on my MacBook Air SSD – You are great man, and you made my day!!!

  6. LucasDOG says:

    I lost my Recovery Volume on my MBA after restoring from Time Machine. Your script worked perfectly. Thanks to you and Clay Caviness!

  7. Eric says:

    It’s not working for me, any ideas? Below is the errors I am getting

    This script installs a recovery partition. It is advisable to backup your data in case this goes horribly wrong. That said, it has worked for me. Do you wish to Continue? (y/n)?y
    yes
    /dev/disk3 Apple_partition_scheme
    /dev/disk3s1 Apple_partition_map
    /dev/disk3s2 Apple_Driver_ATAPI
    /dev/disk3s3 Apple_HFS /Volumes/Mac OS X Lion Recovery HD Update
    Problem extracting file from package: /tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/RecoveryHDMeta.dmg
    /dev/disk4 Apple_partition_scheme
    /dev/disk4s1 Apple_partition_map
    /dev/disk4s2 Apple_Driver_ATAPI
    /dev/disk4s3 Apple_HFS /Volumes/Recovery HD Update
    /recoveryImageCreator-v1.2.command: line 70: /tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest: No such file or directory
    “disk4″ unmounted.
    “disk4″ ejected.
    “disk3″ unmounted.
    “disk3″ ejected.
    logout

  8. Tyler Stringer says:

    This rocks! You sir are a master and rock the mic!

  9. Shane says:

    Get this error right at the end. Any idea?

    Creating recovery partition: finished
    Error (async): File system verify or repair failed (-69845)
    “disk7″ unmounted.
    “disk7″ ejected.
    “disk5″ unmounted.
    “disk5″ ejected.
    logout

    • Christopher Silvertooth says:

      I wonder if something is wrong with your “Macintosh HD”? It may need to have disk utility run and do a verify disk/repair disk. If there is something wrong you will need to boot off an external device like a usb drive to complete the repair. I hope that helps.

      • Nir says:

        Hi,

        I got this kind of error too:

        Creating recovery partition: finished
        Error (async): A GUID Partition Table (GPT) partitioning scheme is required (-69773)
        “disk3″ unmounted.
        “disk3″ ejected.
        “disk2″ unmounted.
        “disk2″ ejected.
        logout

        I did a disk repair before and at says that it fixed all errors. Any idea please?

        Thanks

        • Christopher Silvertooth says:

          A GUID Partition Table is the required format for all Intel Mac’s. The drive must be formatted with this option in order to boot. See this Apple KB for instructions on setting this correctly. It will require a complete format of the drive in order to fix that.

          http://support.apple.com/kb/TS1600?viewlocale=en_US&locale=en_US

          Chris

          • Nir says:

            You are totally right!

            Funny, I didn’t ever noticed that when I replaced my HDD – it was formatted to NTFS and I had my OSX Lion installed on it. Strange thing.

            Thank you so much for all your help! You’re awesome!

  10. Josh Kerr says:

    Worked like a champ for me. Thank you so much for putting this together.

  11. ThifFoos says:

    thanks mate i just downloaded it ran the script and that was that

  12. Physicist says:

    It actually worked! So awesome. Thank you so much for making this script.

  13. allaeddin says:

    sir is it working with MacBook Air (13-inch, Mid 2011).
    if yes , how can i use your script . for your information , i am only able to inter the reinstall osx lion.

    • Christopher Silvertooth says:

      It should work with the 13″ Macbook Pro from last year. I tried it on that model and had no problems. If it is the new model Macbook Air or Pros that came out in June I don’t think it works.

      Chris

  14. Saurabh says:

    reating recovery partition: finished
    Error (async): File system verify or repair failed (-69845)

    Hi Chirstopher , after getting this above error as you said , i went into disk utility to verify and repair the disk. But as the verification process start it tells me that disk can be repaired via restarting the mac and pressing “cmd+R” which will take u to the Recovery HD . But Obviously It doesnt work because i dont have the recovery hd.

    When i click “Cmd+R” this is the message -> please insert a bootable device and press any key”

    • Christopher Silvertooth says:

      In order to repair your drive you will need to boot off of an external device to complete the repair. If you can burn a disk (DVD) of Lion or install it on a USB hard drive you can accomplish this.

      Good luck.

      Chris

  15. sam says:

    I have just purchased a macbook with 10.7.4 lion but the Recovery HD got messed up while installing windows.

    I downloaded the script and ran it and the Recovery HD partition got created but on booting with alt+R when i choose Recover HD , it is just showing a no entry or block sign and booting further.

    I even tried creating a Recovery pen drive using recovery disk assistant and tried booting from it and got the same no entry/block sign.

    Can you plz help?

    Thanks

    • Christopher Silvertooth says:

      I assume that is one of the brand new Macbook Pro’s or Airs. I haven’t had a chance to test on either of those since I don’t have one. My guess is that the Lion Recovery Image I get from Apple is not updated with the latest drivers for the new Macbook’s. I would hold off a bit until there is an update to the Image. The image will either be updated with the new OS for Mountain Lion later this month or when Apple releases the 10.7.5 patch — I am guessing here. I will check their image as soon as I can and post when I see an updated one.

      Chris

  16. Sfreek says:

    fantastic, everything’s fine again! Many thanks!!!

  17. Paul says:

    Same issue here with the 2012 MacBook Pro.

    Hopefully you are able to update this.

    Many thanks :)

  18. Bradley says:

    Will this work for Mountain Lion? I just imaged to a new SSD and lost my Recovery Partition. I need it to enable FileVault. :)

  19. MJJ says:

    Thank you very much. Used on two of my Macs and worked like a charm!

  20. Dreamy says:

    Hi,

    what about the recovery partition for mountain lion?
    Is your script able to create this partition too?
    Which file i have to use to create the partition?

    • Christopher Silvertooth says:

      I am not sure yet. I just upgraded to Mtn. Lion last night and haven’t had a chance to delve into the differences in the recovery partition. Assuming I can get my hands on the recovery partition installer my script should be able to work. For now please don’t use it on mountain lion as I am unsure of the repercussions.

      • Simon says:

        Ooops,

        I just ran the script and realised I am on Mountain Lion and not Lion. No problems occurred (at least for now) and the script failed.

        Could you email me if you update the script or have a work around?

        Cheers

        Simon

  21. Piel says:

    Hi from France,

    Working with Imac Mid-2010.
    I was enable to install Mountain Lion because i repartition on the fly my boot hard drive .

    You’ve saved me a lot of time.

    Many thanks !

  22. Sherman Homan says:

    Two of my Lion Macs did not have recovery partitions.
    I ran your script and voila!
    Nicely played!
    Thanks!

  23. Packridge says:

    Great, great job. I couldn’t get Mountain Lion to install because the install claimed I have no Recovery HD. I followed these instructions, ran the script and I’m good to go. Great job and thank you.

  24. Matt says:

    Getting a different error when I try:

    Creating recovery partition: async call initiate
    Creating recovery partition: async call exit success; operation now in progress
    ->-[Local dmAsyncStartedForDisk:]: del callback: DADR=0x7fbc2bb01140
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7fbc2bb012e0=disk0s2 pole/pct=0/100.000000
    -[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]: del callback: DADR=0x7fbc2bb012e0=disk0s2 errMain=-69726 errAux=0 infoDict=(null)
    <–[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]
    Creating recovery partition: finished
    Error (async): Unable to write a Windows boot.ini file (-69726)
    "disk2" unmounted.
    "disk2" ejected.
    "disk1" unmounted.
    "disk1" ejected.
    logout

    Any thoughts?

    • Christopher Silvertooth says:

      What version of OS X are you running? Can you send me the output of “diskutil list” from the terminal?

      • Jintao says:

        Same issue as his. Lion is on my Mac right now.

        Prior to the commands:
        /dev/disk0
        #: TYPE NAME SIZE IDENTIFIER
        0: GUID_partition_scheme *320.1 GB disk0
        1: EFI 209.7 MB disk0s1
        2: Apple_HFS Macintosh HD 298.5 GB disk0s2
        3: Apple_Boot Recovery HD 650.0 MB disk0s3
        4: Microsoft Basic Data

        Then
        diskutil eraseVolume HFS+ ErasedRecoveryHD disk0s3
        Started erase on disk0s3 Recovery HD
        Unmounting disk
        Erasing
        Initialized /dev/rdisk0s3 as a 620 MB HFS Plus volume
        Mounting disk
        Finished erase on disk0s3 ErasedRecoveryHD
        jintao:~ jintao$ diskutil mergePartitions HFS+ “Macintosh HD” disk0s2 disk0s3
        The chosen disk supports resize; disregarding your new file system type and volume name
        Merging partitions into a new partition
        Start partition: disk0s2 Macintosh HD
        Finish partition: disk0s3 ErasedRecoveryHD
        Started partitioning on disk0
        Merging partitions
        Waiting for the disks to reappear
        Growing disk
        Finished partitioning on disk0
        /dev/disk0
        #: TYPE NAME SIZE IDENTIFIER
        0: GUID_partition_scheme *320.1 GB disk0
        1: EFI 209.7 MB disk0s1
        2: Apple_HFS Macintosh HD 299.0 GB disk0s2
        3: Microsoft Basic Data 20.7 GB disk0s4

  25. Roy says:

    Is there anyway we can get a script to reinstall the recovery partition for Mountain Lion? I would really appreciate it, and I am sure many more will appreciate it as well. Thanks!

  26. desertvisitor says:

    Chris, your script literally had me jumping up and down with JOY at 10pm after my work day started at 7am. Thank you, Thank you, Thank you. Something finally went right today!

    This newbie has already been through quite a bit with a 1 month old MBP (late 2011), but you sir are my first post for anything Apple! Awesome Script – Worked as Advertised!

  27. mario says:

    Hi, could you confirm if its compatible with mountain lion ? Thank you.

    • Christopher Silvertooth says:

      I am testing with Mountain lion right now. I hope to have a working version by tonight or tomorrow.

  28. Kevin says:

    Hi,

    I tried to run the script and hot this error message. boot helper partition failed… Christopher, can you tell what is wrong? thanks!

    Donor=disk0s2 Image=/Volumes/Recovery HD Update/BaseSystem.dmg DoVerifyImage=0 DoRepairDonor=0
    ChunkList=/Volumes/Recovery HD Update/BaseSystem.chunklist
    Creating recovery partition: async call initiate
    Creating recovery partition: async call exit success; operation now in progress
    ->-[Local dmAsyncStartedForDisk:]: del callback: DADR=0x104116bb0
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x104116bb0=disk0s2 str=Attaching disk image /Volumes/Recovery HD Update/BaseSystem.dmg dict=(null)
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0×0=(null) pole/pct=0/6.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0×0=(null) pole/pct=0/15.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x104116bb0=disk0s2 pole/pct=0/16.000000
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7fca4b502bf0=disk0s2 str=Re-using existing recovery partition dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7fca4b502bf0=disk0s2 str=Checking booter volume dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7fca4d002db0=disk0s3 str=Volume repair complete. dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7fca4d002db0=disk0s3 str=Updating boot support partitions for the volume as required. dict=(null)
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7fca4d002db0=disk0s3 pole/pct=1/28.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7fca4b502bf0=disk0s3 pole/pct=0/28.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7fca4b502bf0=disk0s2 pole/pct=0/32.000000
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7fca4d002db0=disk3 str=Detaching disk image dict=(null)
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7fca4d002db0=disk0s2 pole/pct=0/100.000000
    -[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]: del callback: DADR=0x7fca4d002db0=disk0s2 errMain=-69840 errAux=0 infoDict=(null)
    <–[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]
    Creating recovery partition: finished
    Error (async): File system check on boot helper partition failed (-69840)
    "disk2" unmounted.
    "disk2" ejected.
    "disk1" unmounted.
    "disk1" ejected.

    • Christopher Silvertooth says:

      You need to run disk utility and do a repair on your hard disk. Most likely you will need to boot off an external device to accomplish this.

  29. François says:

    hello

    I’ve got

    Error (async): Unable to modify a Windows boot.ini file because it is set up in a customized configuration (-69729).

    Could you help me ? Thanks in advance…
    François

    I just ran your script because of pb with recovery partition after dual boot installation. my mbp is a late 2011 model with Lion (10.7.4)

    I follow your “algorithm” :
    a – identify botched recovery volume
    b – erase data from diskslot disk0s3
    c – merge diskslots disk0s2 disk0s3
    d – run the script

    At the end of the process, I’ve got:

    Creating recovery partition: async call initiate
    Creating recovery partition: async call exit success; operation now in progress
    ->-[Local dmAsyncStartedForDisk:]: del callback: DADR=0x1059167b0
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0×105918570=disk0s2 pole/pct=0/100.000000
    -[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]: del callback: DADR=0×105918570=disk0s2 errMain=-69729 errAux=0 infoDict=(null)
    <–[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]
    Creating recovery partition: finished
    Error (async): Unable to modify a Windows boot.ini file because it is set up in a customized configuration (-69729)
    "disk3" unmounted.
    "disk3" ejected.
    "disk2" unmounted.
    "disk2" ejected.
    logout

    diskutil list is
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *121.3 GB disk0
    1: EFI 209.7 MB disk0s1
    2: Apple_HFS Macintosh HD 90.2 GB disk0s2
    3: Microsoft Basic Data WINDOWSXP 30.8 GB disk0s4
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *1.0 TB disk1
    1: EFI 209.7 MB disk1s1
    2: Microsoft Basic Data FLAMELAREA 1000.0 GB disk1s2

  30. Rob says:

    Hi Chris, great script. Any more news on mountain lion compatibility?

  31. paul says:

    I guess if there’s not even a botched or lost recovery partition on the drive to begin with I’m out of luck? Unfortunately I used carbon copy to clone an existing lion drive and somehow forgot to clone the recovery partition.

    • Christopher Silvertooth says:

      This works if you don’t have a recovery partition. It recreates the partition as well as installs the tiny os that goes there.

  32. zman58 says:

    awsome!
    Your script worked perfectly! I got my recovery partition back after losing it.
    My Macbook Air has OSX v10.7.4 and was purchased only about 2 months ago. 1.8 GHz i7 4Gb RAM 250GB SSD.

    I installed Ubuntu 12.04 Linux for MAC on an external USB HD which is working perfectly on the Macbook Air. I decided not to put Linux on the SSD for now.

    • zman58 says:

      …Update…But now that I have restarted the system it is gone. After running the script I could see the Recovery partition in Disk Utility, but after restarting the system it has disappeared. Any thoughts on why it disappeared?

    • zman58 says:

      I expected to see a separate partition for Recovery in Disk Utility after running your script–and i did. But after a restart, there is no longer a visible recovery partition. However I can select Recovery on startup when I press the “alt” or “option” key. It takes me to a menu that allows me to install Lion.
      I am relatively new to MAC so was not sure what to expect. Before I ran your script I was not able to select Recovery during startup with the “alt” key pressed.

      • Christopher Silvertooth says:

        Unfortunately that is a side affect of my script. I think there is a fix for this and will see about posting that separate as well as integrating it into the current script.

  33. Rai says:

    Chris,
    Just wanted to say thank you for your efforts. This is a great service you are providing. I look forward to seeing how far you progress with Mountain Lion

  34. skot_e says:

    Real big thank you for this.

    After trawling for help to upgrade to ML due to having the recovery error, I was resigned to the thought I would need to re install Lion to get the drive, except that it is no longer avaiable on the app store (even with the option click method I found). I was at a loss to what to do when I stumbled on this page , and low and behold everything worked perfectly.

    Your efforts with this are so greatfully appreciated!!!

  35. Great job Chris!

    Just FYI I have found a manual way how to restore Recovery HD:
    http://hints.binaryage.com/recover-lost-recovery-hd-for-filevault

    I believe it might be simpler in some scenarios.

  36. Bob says:

    Worked like a dream for me! Wonderful work. Thank you very much for sharing! :)

  37. Remy says:

    On my iMac I am getting this error message:
    “Error (async): This partition map modification would make a Windows partition unbootable (-69728)”

    Thanks for offering this solution and it has worked for me on my Macbook Pro! If only my iMac would behave the same…

  38. moja says:

    I’m running lion an older 2007 MBP. According to Apple, I do not have a recovery partition due to incompatible drive. Didn’t have much hope, but decided to run this script. To my surprise, it worked. I now have a recovery partition. Thank you Chris.

  39. Ricardo says:

    Thank you very much! Now I can locate my Macbook Pro! It worked like a charm!

  40. Pat Wright says:

    Chris this is genus!!! Thanks for your work and thanks a million for sharing it with a wanna be geek!

  41. Ty says:

    Lifesaver. Thanks so much!

  42. Tim-oth says:

    Actually i apologise, i misunderstood the instructions.
    Now, when i run your script, it returns the following…

    Checksumming Driver Descriptor Map (DDM : 0)…
    Driver Descriptor Map (DDM : 0): verified CRC32 $E43B1327
    Checksumming (Apple_Free : 1)…
    (Apple_Free : 1): verified CRC32 $00000000
    Checksumming Apple (Apple_partition_map : 2)…
    Apple (Apple_partition_map : 2): verified CRC32 $4B6015F5
    Checksumming Macintosh (Apple_Driver_ATAPI : 3)…
    Macintosh (Apple_Driver_ATAPI : 3): verified CRC32 $F1E8BA9E
    Checksumming (Apple_Free : 4)…
    (Apple_Free : 4): verified CRC32 $00000000
    Checksumming disk image (Apple_HFS : 5)…
    ……………………………………………………………………
    disk image (Apple_HFS : 5): calculated CRC32 $FE7B75B1, expected CRC32 $5C5AFC1B
    Checksumming (Apple_Free : 6)…
    (Apple_Free : 6): verified CRC32 $00000000
    calculated CRC32 $B6BCE969, expected CRC32 $3436F997
    hdiutil: attach failed – invalid checksum
    Could not open package for expansion: /Volumes/Mac OS X Lion Recovery HD Update/RecoveryHDUpdate.pkg
    hdiutil: attach failed – No such file or directory
    /Users/Tim/Desktop/Recovery/recoveryImageCreator-v1.2.command: line 70: /tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest: No such file or directory
    hdiutil: eject failed – No such file or directory
    hdiutil: eject failed – No such file or directory
    logout

    [Process completed]

  43. Phuong Nguyen says:

    It worked! Thanks in advance!

  44. John says:

    Perfect! Thanks.

  45. Sripathi says:

    I kept try different options, deleted all non-boot partitions using disk utility, running various tools, trying to boot from USB drive etc… to upgrade my os to Moutain Lion from Lion, but keep failing with various errors, mostly due to unable to create recovery partition.

    Even though, for some reasons, disk0s3 only shows as Apple_Boot and Recovery HD text is missing, I have followed your instructions and able to recreate the recovery partition and able to upgrade to Mountain Lion.

    Thank you very much for your script. Otherwise I would have to wipe everything and install OS and spend few days to get back all the apps up and running.

  46. [...] korzystalem z tego rozwiazania, gdy zniknela mi partycja Recovery: Musings Komputer:  Mac mini Mid 2011 – i5 2,5 GHz | 16 GB | 6630M +  MacBook Air Mid 2012 [...]

  47. Johan says:

    The sript no function for me :
    diskutil list give the same result before and after the script execution :
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *320.1 GB disk0
    1: EFI 209.7 MB disk0s1
    2: Apple_HFS Macintosh HD 319.2 GB disk0s2
    3: Apple_Boot Boot OS X 650.0 MB disk0s3

    Script execution displays :

    This script installs a recovery partition. It is advisable to backup your data in case this goes horribly wrong. That said, it has worked for me. Do you wish to Continue? (y/n)?y
    yes
    2013-03-20 07:53:43.058 hdiutil[847:707] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:53:43.060 hdiutil[847:707] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x101e17a70 (bundle, not loaded)
    2013-03-20 07:53:43.206 diskimages-helper[849:2703] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:53:43.207 diskimages-helper[849:2703] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x108b2b0d0 (bundle, not loaded)
    2013-03-20 07:53:43.268 diskimages-helper[849:2703] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:53:43.268 diskimages-helper[849:2703] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x108b2b0d0 (bundle, not loaded)
    prévue CRC32 $3436F997
    /dev/disk1 Apple_partition_scheme
    /dev/disk1s1 Apple_partition_map
    /dev/disk1s2 Apple_Driver_ATAPI
    /dev/disk1s3 Apple_HFS /Volumes/Mac OS X Lion Recovery HD Update
    2013-03-20 07:54:14.802 hdiutil[872:707] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:54:14.803 hdiutil[872:707] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0×105318590 (bundle, not loaded)
    2013-03-20 07:54:14.949 diskimages-helper[874:2703] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:54:14.949 diskimages-helper[874:2703] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x104429ea0 (bundle, not loaded)
    2013-03-20 07:54:14.953 diskimages-helper[874:2703] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:54:14.953 diskimages-helper[874:2703] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x104429ea0 (bundle, not loaded)
    Calcul de la somme de contrôle de Driver Descriptor Map (DDM : 0)…
    Driver Descriptor Map (DDM : 0) : vérifiée CRC32 $264CB364
    Calcul de la somme de contrôle de (Apple_Free : 1)…
    (Apple_Free : 1) : vérifiée CRC32 $00000000
    Calcul de la somme de contrôle de Apple (Apple_partition_map : 2)…
    Apple (Apple_partition_map : 2) : vérifiée CRC32 $2D79E5C0
    Calcul de la somme de contrôle de Macintosh (Apple_Driver_ATAPI : 3)…
    Macintosh (Apple_Driver_ATAPI : 3) : vérifiée CRC32 $F1E8BA9E
    Calcul de la somme de contrôle de (Apple_Free : 4)…
    (Apple_Free : 4) : vérifiée CRC32 $00000000
    Calcul de la somme de contrôle de disk image (Apple_HFS : 5)…
    ……………………………………………………………………
    disk image (Apple_HFS : 5) : vérifiée CRC32 $E25EAD8E
    Calcul de la somme de contrôle de (Apple_Free : 6)…
    (Apple_Free : 6) : vérifiée CRC32 $00000000
    vérifiée CRC32 $6499E274
    /dev/disk2 Apple_partition_scheme
    /dev/disk2s1 Apple_partition_map
    /dev/disk2s2 Apple_Driver_ATAPI
    /dev/disk2s3 Apple_HFS /Volumes/Recovery HD Update
    Donor=disk0s2 Image=/Volumes/Recovery HD Update/BaseSystem.dmg DoVerifyImage=0 DoRepairDonor=0
    ChunkList=/Volumes/Recovery HD Update/BaseSystem.chunklist
    Creating recovery partition: async call initiate
    Creating recovery partition: async call exit success; operation now in progress
    ->-[Local dmAsyncStartedForDisk:]: del callback: DADR=0x7f8a55000e60
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x100816c00=disk0s2 str=Attaching disk image /Volumes/Recovery HD Update/BaseSystem.dmg dict=(null)
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0×0=(null) pole/pct=0/6.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0×0=(null) pole/pct=0/15.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7f8a55000e60=disk0s2 pole/pct=0/16.000000
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7f8a55112840=disk0s2 str=Re-using existing recovery partition dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7f8a55112840=disk0s2 str=Checking booter volume dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x100816c00=disk0s3 str=Checking file system dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7f8a53502ff0=disk0s3 str=Checking Journaled HFS Plus volume. dict={
    “fsck_msg_number” = 213;
    “fsck_msg_string” = “Checking Journaled HFS Plus volume.”;
    “fsck_msg_type” = VERIFY;
    “fsck_verbosity” = 0;
    }
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x100816c00=disk0s3 str=Invalid B-tree node size dict={
    “fsck_msg_number” = 4294966739;
    “fsck_msg_string” = “Invalid B-tree node size”;
    “fsck_msg_type” = ERROR;
    “fsck_verbosity” = 1;
    }
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x100816c00=disk0s3 str=The volume could not be verified completely. dict={
    “fsck_msg_number” = 106;
    “fsck_msg_string” = “The volume %1$@ could not be verified completely.”;
    “fsck_msg_type” = FAIL;
    “fsck_verbosity” = 0;
    parameters = (
    {
    volumename = ” “;
    }
    );
    }
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x100816c00=disk0s3 pole/pct=0/28.000000
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7f8a53502ff0=disk0s3 str=Volume repair complete. dict=(null)
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7f8a53502ff0=disk0s3 str=Updating boot support partitions for the volume as required. dict=(null)
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7f8a53502ff0=disk0s3 pole/pct=1/28.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7f8a53502ff0=disk0s3 pole/pct=0/28.000000
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7f8a55000e60=disk0s2 pole/pct=0/32.000000
    -[Local dmAsyncMessageForDisk:string:dictionary:]: del callback: DADR=0x7f8a55000e60=disk3 str=Detaching disk image dict=(null)
    -[Local dmAsyncProgressForDisk:barberPole:percent:]: del callback: DADR=0x7f8a55112840=disk0s2 pole/pct=0/100.000000
    -[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]: del callback: DADR=0x7f8a55112840=disk0s2 errMain=-69840 errAux=0 infoDict=(null)
    <–[Local dmAsyncFinishedForDisk:mainError:detailError:dictionary:]
    Creating recovery partition: finished
    Error (async): File system check on boot helper partition failed (-69840)
    2013-03-20 07:54:30.395 hdiutil[908:707] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:54:30.397 hdiutil[908:707] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x7fdc6b200570 (bundle, not loaded)
    “disk2″ unmounted.
    “disk2″ ejected.
    2013-03-20 07:54:30.530 hdiutil[911:707] Error loading /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: dlopen(/Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, 262): no suitable image found. Did find:
    /Library/Plug-ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: mach-o, but wrong architecture
    2013-03-20 07:54:30.532 hdiutil[911:707] Cannot find function pointer MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 in CFBundle/CFPlugIn 0x7f844be01560 (bundle, not loaded)
    “disk1″ unmounted.
    “disk1″ ejected.
    logout

    [Opération terminée]

    Can you say me please why the script no function.

    • Christopher Silvertooth says:

      I am looking into this issue. What version of the script are you running? 2.0.5? Is this for Lion or Mountain Lion?

      Thanks,

      Chris

  48. Levi says:

    Downloading the recovery dmg right now. Thanks so much for the script – you saved me from having to do a reinstall!

  49. David says:

    Chris – will the script work if my internal disk is named “Mac HD” rather than “Macintosh HD” (as a result of a reinstall after wipeout)? If not, what do I need to change? I am on OS Version 10.8.3

    • Christopher Silvertooth says:

      It should work. To be safe you can quickly rename your hard drive by clicking on its name in the finder then renaming it.

  50. Eric says:

    Any way to make this work on raid volume?

    • Christopher Silvertooth says:

      To be honest I don’t really know. If I get a chance today I will create a VM with a RAID boot volume and see what happens :-)

  51. Dirk says:

    Great script !
    still works…aug 2013 (replaces HD with SSD on Lion machine, just did TM restore, then this script…I’m happy. (Thank you also ‘uncle’ Google for finding this page)
    Many thanks…saved me many hours

  52. Bob Williams says:

    Worked brilliantly, many many thanks. I got an error message right at the end of the process (which I didn’t catch unfortunately), but it didn’t seem to have affected the core process (or any peripheral process for that matter), but only time will tell.

    Bob

    • Christopher Silvertooth says:

      Usually the error is related to my trying to unmount some of the files used to recreate the partition. Most likely it is nothing. Glad it worked.

      Cheers,

      Chris

  53. Tendo says:

    I owe you a beer sometime… No make that a case!

    Having replaced my HDD, using a bootable recovery flash drive (made with Apple’s RecoveryDiskAssistant) then restoring to a freshly formatted SSHD from my last Time Machine backup, I too found myself without the recovery partition.

    I wouldn’t have noticed, if the “Find My Mac” feature hadn’t alerted me either…

    Using your script was as easy as pie and saved 4.5GB of data to download the OS again (never mind all combo updates on top of that)

    Cheers again!!!

  54. [...] Rede kurzer Sinn, mit dem praktischen Applesript Recovery Partition Creator von Chris Silvertooth lies sich die defekte Recovery HD bequem [...]

  55. ernesto says:

    Worked like a charm! Just created the Recovery Partition in a few minutes and can now start encryption.
    Thank you SO MUCH for putting this together!

  56. Daniel Herrera says:

    Hi and thank you very much indeed for all this effort. I have the same problem after a clean install of Mavericks, do you think it will work? has anyone tested on 10.9? Thanks again!

  57. tushar says:

    for me it says –
    lion recovery update can’t be installed on this disk. An error occurred while evaluating javascript for the package.

    please help

    • Christopher Silvertooth says:

      It sounds like Apple’s program doesn’t like your system. I don’t use any javascript so it must be an error with a program outside of mine.

      Chris

  58. joverparas says:

    hi would this script work on OSX mavericks?

  59. andrew says:

    Hi Christopher, this fix sounds brilliant! like Daniel i lost the partition when clean installing mavericks… do you know if there is something like this that will work on the new os? Many thanks :)

  60. Joel says:

    Most awesome!

    I ran into some trouble when attempting to triple boot my late 2011 MBP with OS X Lion 10.7.5, Win 8.1 and Linux Mint 16 Cinnamon. Had to revert and after removing the Windows partition in Disk Utility my Recovery HD partition was suddenly and mysteriously removed as well.

    Apple Care was of no use prescribing the whole re-install Lion path as usual.

    I was able to put it back with your script in minutes.

    Thanks!

  61. Paul says:

    I just installed a Samsung 840 SSD into my Mid-2009 13MBP Unibody and I did a fresh install of OSX Mavericks. Whiling doing so I lost my recovery partition.

    I ran you script and it worked flawlessly. I can now use the Find my Mac in my iCloud Options.

    TL;DR – SUCCESS on OSX Mavericks – Late 2009 13″ MBP

  62. capone says:

    Astounding thanks a million …

  63. Steven says:

    Worked a treat – replaced HDD with SDD and lost partition. This simply added it – awesome! Thanks Mike

  64. vladimiro says:

    It works for me! Thanks for the great help and the sharing of the script. Now I can use Find My iPhone on iPhone to locate my MBA if it will be necessary. ;) Great job!

Leave a Reply

Your email address will not be published. Required fields are marked *