Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dalton63841

macrumors 65816
Original poster
Nov 27, 2010
1,449
8
SEMO, USA
I built an app in ApplescriptObjC to work with the Recovery partition. It could probably be improved a lot, but it does work. At the request of others I will post it here. Please for the love of all things sacred, read the whole post before using it. It has been tested on my machine to work with Lion, Mountain Lion, and Mavericks.

It does use a signed Apple binary, as that is the only way currently that I know of to interact with the Recovery partition(in this manner) without breaking it. Because it uses a signed binary that is not my intellectual property, I will not distribute that file, but I will explain how to get it and add it to the app.

***Adding the binary that makes the application work***
This step MUST be done before you use the app, or it will NOT work.

1. Download the Lion Recovery Update. Make sure it is in your downloads folder.

2. Now open terminal and do the following commands.
Code:
hdiutil attach -nobrowse ~/Downloads/RecoveryHDUpdate.dmg
pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg ~/Desktop/Recovery\ Update

3. Now on your desktop you will see a folder called Recovery Update. Inside that folder, is a file called RecoveryHDUpdate.pkg. Right click that file and click "Show Package Contents". Then you will see a folder called Scripts. Inside that folder is a folder called Tools. Open that folder. There you will see a file called "dmtest". Just move that Finder window to the side for now.

4. Now download and unzip the Recovery Editor.app.zip file. Right click Recovery Editor.app and click "Show Package Contents". Open the Contents folder, then open the Resources folder, then open the Files folder.

5. Now go back to the other Finder window, and copy the "dmtest" file into the Files folder.

6. Delete the Recovery Update folder on your desktop. The app is now usable.

***Instructions for use***

1. REBOOT! Throughout normal use, plugging in external drives or flash drives, the mount points can change. While there is a certain amount of error handling in this app, it is always safest to remove any flash drives or external storage and then reboot before using apps that tamper with mount points.

2. Launch the app. Here you will see only 4 buttons. The first two have no options. Click and they run.
2a. "Check Recovery Partition Status"
After a new install, or after messing with partitions, this button will tell you yes there is a recovery, or no there isn't. Short and sweet. Most will probably find this one useless, but after multiple tinkerings I found it necessary to keep track.

2b. "Destroy Recovery Partition & Reclaim Space"
Just as it sounds. Some people prefer to not use a recovery partition at all. This removes it and adds that hard drive space back into the main partition.

The last 2 will pop up a window to have you choose the InstallESD.dmg for the version of recovery partition you want. Most if not all know how to get the InstallESD.dmg from the installer. It's not a hidden file. If you don't know how to get the InstallESD.dmg a 5 second google will show you.

2c. "Build/Update Standard Recovery Partition"
If you don't have a recovery partition, this will make one. If you have one, but want to change the OS X version it recovers to, this will update it. This is identical to the factory recovery partition.
It does take a few minutes to run, so just let it go.

2d. "Build/Update Offline Recovery Partition"
If you don't have a recovery partition, this will make one. If you have one, but want to change the OS X version it recovers to, this will update it. This one is special in that it can be used as an alternative to a flash drive installer. When you boot into it, you will see the exact same thing as with a flash drive installer. It works completely offline. It is recognized as a valid recovery, so FileVault and Find My Mac still work perfectly.
The downside is that it does take up 5.5GB of space, so if hard drive space is short you probably don't want this. Also, building this type of recovery is VERY slow. On my 2009 model it takes almost 30 minutes to finish. That is because it has to make a copy of the original recovery system, write 5GB worth of install packages, convert the copy to a compressed read only image then THEN write that 5.5gb image to the recovery partition. It does finish though. Just get the app running and then go have some coffee.
 

Attachments

  • Recovery Editor.app.zip
    86.1 KB · Views: 1,974
Last edited:

VMSwizard411

macrumors newbie
Dec 12, 2010
11
3
Charlotte, NC USA
No problem! Let me know how it works for you.

Thank you for the efforts!

For me, both this application and the recovery.sh script (output attached) fail because when the InstallBSD.dmg gets mounted, its name is

Mac OS X Install ESD​

but you're expecting it to be

OS X Install ESD​

I was able to easily hack my copy of recovery.sh so that it then worked in my case.

The source InstallESD.dmg is coming from my copy of Install OS X Mountain Lion.app dated July 25, 2012 with a version of 1.3.12.

Since the file chooser cannot go into packages, it might also be really helpful for some users if this application could allow choosing the saved copy of Install OS X [Mountain] Lion.app and you then look into the package for the needed dmg.
 

Attachments

  • recovery.sh output.txt
    3.4 KB · Views: 737

Dalton63841

macrumors 65816
Original poster
Nov 27, 2010
1,449
8
SEMO, USA
Thank you for the efforts!

For me, both this application and the recovery.sh script (output attached) fail because when the InstallBSD.dmg gets mounted, its name is

Mac OS X Install ESD​

but you're expecting it to be

OS X Install ESD​

I was able to easily hack my copy of recovery.sh so that it then worked in my case.

The source InstallESD.dmg is coming from my copy of Install OS X Mountain Lion.app dated July 25, 2012 with a version of 1.3.12.

Since the file chooser cannot go into packages, it might also be really helpful for some users if this application could allow choosing the saved copy of Install OS X [Mountain] Lion.app and you then look into the package for the needed dmg.

I knew it would end up being something like that to catch me... I'll tweak it a bit and make a new version when I have time.
 

ssn637

macrumors 6502
Feb 12, 2009
452
48
Switzerland
Hi Dalton

I really appreciate your work on this application, it's awesome!

One question: Could you please modify it to allow for the inclusion of additional utilities (such as iPartition or iDefrag) from the boot menu? And making Safari visible (if it is not)? I tried adding these manually and modifying the associated .plist file but they're not showing up in the menu.

Thanks

Geoffrey
 

jb510

macrumors regular
Sep 19, 2007
167
9
Thanks for this! Worked perfectly to recreate a recovery partition I lost doing to format and fresh install from flash drive.
 

mooninite

macrumors member
Oct 7, 2013
60
33
No worky!

When I run option #4, to create an Offline Recovery Disk, I get an error about being required to have 12GB free during the installation...

Uh...

i've got almost 3 TB free.

Any ideas???
 

Drzed

macrumors member
Oct 25, 2009
52
22
Thank you SOOO much for this tool! I have tried countless other methods to create a recovery partition after an Apple tech stuffed up my HDD after a repair without success. I followed your instructions and it's worked! Couldn't believe my eyes when the iMac successfully rebooted and started Filevault encryption that I've been trying for nearly a year without any luck.

Thanks again and your effort in posting all the details is hugely appreciated!:)
 

Vulkan

macrumors 6502
Apr 16, 2005
347
138
Useless, TX
Dalton;

I followed all your steps... I ran the Recovery Editor, and the partition checker works great. So when I choose the offline recovery, it tells me it cannot mount InstallESD.dmg:

Error! InstallESD.dmg failed to mount.

Then it goes back to the main menu. I tested the .dmg and its working fine...

Can you advice?
 

pa-geographer

macrumors newbie
Oct 26, 2013
2
0
PA
Dalton;

I followed all your steps... I ran the Recovery Editor, and the partition checker works great. So when I choose the offline recovery, it tells me it cannot mount InstallESD.dmg:

Error! InstallESD.dmg failed to mount.

Then it goes back to the main menu. I tested the .dmg and its working fine...

Can you advice?

Hi Dalton,

I'm having the same experience. I also tried mounting the .dmg then running the app again (choosing the third option to update the existing recovery partition) but still got the above error message. Using Mountain Lion 10.8.5.
 

UliB

macrumors newbie
Oct 29, 2013
1
0
Recovery Partition OS X 10.9.0 and 3,25 TB Fusion Drive

Thanks a lot for your Recovery Editor!
I just managed to upgrade my self-made Fusion Drive (although I read logical drives this size could not be repartitioned) with a recovery partition by running it with the InstallESD.dmg extracted from the Mavericks installer.
Excellent! :D
 

Kno-Blauch

macrumors newbie
Jul 29, 2011
2
0
no errors shown but not working

Hi,

I followed your guide and it should have worked as described, it showed a progress bar but quit wothout any messages yet when I check again if there is a valid recovery partition, it says there isn't YET FileVault 2 AND find my mac are both successfully activated and working perfectly YET I can't boot into my recovery HD (I have a fuison drive self built in my MacBook Pro Mid 2009). Any help/ideas how to solve this?
 

EskimOasis

macrumors newbie
Mar 1, 2014
1
0
Many, many thanks!

Dear Dalton63841,

I registered to MacRumors only to thank you.
I did run my MacBookPro for years without noticing that I didn't have any Recovery HD on my computer (for some mysterious reasons). And when my HD crashed last week, it was a pain in the ass, then making a clone of my old HD on the brand new installed HD inside my MacBook Pro didn't create a Recovery HD (neither an update from 10.9.1 to 10.9.2).

Now, I am more confident since I have created my partion Recovery HD 10.9 thanks to you and your work.
Thank you again and best from Paris (France).
:)
 

Edalincam55

macrumors newbie
Jan 1, 2015
5
0
PK
Pretty good post. I just stumbled upon your post and wanted to say that I have really enjoyed reading your posts.I've read your post and wish it again.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.