How to repair your REAL Mac if you broke it with the chameleon bootloader.
This post is intended only for actual Apple (Mac) computer systems that are not booting due to accidental installation of the chameleon bootloader to the Apple computer system’s hard drive.
If you are one of the unlucky ones who ignored my numerous warnings or just accidentally pressed the wrong button while running the myHack installer from a real MAC here is an example of how to repair the partition scheme on a real MAC so that it will boot again – after accidentally installing the chameleon bootloader to the MAC’s internal hdd.
Note: I have not tested this myself – I’m not that adventurous when it comes to my real MAC, however these commands should work. Ultimately if nothing posted here works you will likely have to wipe the drive out completely and re-install OS X.
WARNING: Do not perform any of the following actions without backing up your critical data first. Fiddling with partition tables is dangerous. A simple typo could lead to complete data loss. You have been warned! [ You can backup critical data even if you can not access the system, if absolutely necessary, by removing the internal hdd and plugging it into another computer, the use of data recovery software may be required depending on circumstances. ]
GUID SOLUTION:
1) Boot your mac with an OS X Install DVD (doesn’t matter which version, whatever is installed on your system would be best).
2) Start Disk Utility
3) Select the OS X HDD/SSD that you screwed up (not specific partition)
4) Go to the Partition tab
5) Grab the lower right corner of your key partition and resize it a little bit (no matter how much/little you resize it as long as you change the partition size)
6) Click Apply. Relax, this will NOT erase your HDD/SSD, it only rewrites your GUID partition data that will fix your HDD/SSD.
7) Quit the Disk Utility and reboot.
8) Enjoy your restored Mac that should now boot normally!
MBR SOLUTION:
Boot your mac with an OS X Install DVD (doesn’t matter which version, whatever is installed on your system would be best) and use Terminal on it to run the following commands.
Once booted into the GUI, open a terminal and type
diskutil list
to get a list of all disks on your system. Assuming /dev/disk2 is your problematic disk with the MBR partition scheme, type
sudo fdisk /dev/disk2
to verify the current partitions on it (should list partitions on the disk, if not don’t worry it’s likely because of the chameleon bootloader). This command will not apply any changes. The drive with an “*” next to it is the active partition (if any). Now type
sudo fdisk -u /dev/disk2
which writes a new MBR (master boot record) while keeping current partition information.
In order to be able to boot from a partition, it must be flagged active. Type
sudo fdisk -e /dev/disk2
to open the drive in fdisk’s editing mode. It will possibly complain “could not open MBR file /usr/standalone/i386/boot0: No such file or directory”, this should be safe to ignore. The following transcript shows what to do next:
fdisk: 1> flag 2
Partition 2 marked active.
fdisk:*1> quit
Writing current MBR to disk.
You’re done! Cross your fingers and reboot your MAC…
If any of this is confusing to you please read the OS X fdisk man page for more information.
Tags: Bootloaders, Chameleon, Mac, OS X, PCEFI, Troubleshooting
This entry was posted on Sunday, October 18th, 2009 at 05:18 by Conti and is filed under Bootloaders, Working with OS X. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Hi Conti
Thanks for the response. Unfortunately, the “options” button is disabled, so I cannot access it to choose MBR. Fortunately, I do have a day-old Timemachine backup of my laptop, so I think I’ll just go ahead and do that. It’s just that I did lots on the last day and I was trying to avoid losing all that change, but it’s not that much compared to losing everything.
I also tried connecting it to my Hackintoch through Firewire to copy the files, but it was extremely slow. After 10 minutes and copying 6 MB (MB not a typo) it gave me an error message. It makes sense I guess since the file system is messed up.
Is it possible to put a BIG RED warning/reminder? I understand how they are limitations to the package maker.
Thanks a lot again. myHack made creating a Hackintoch a breeze. It took less than half an hour from start to finish. It’s too good to be true. Now that I have all of Kexts on a flash disk I can install OSX on a new system in about 20 minutes. Unbelievable!
Kian: Well I was trying to find a solution for your specific problem but nothing simple has revealed itself aside from my post here. You could try to write a clean MBR to the drive and then try the GUID method afterward (GUID still has an MBR, and that MBR could be corrupted – thing is I am uncertain if you write a clean MBR to a GUID partitioned disk if it will damage the GUID)… I was also trying to figure out a way to add an additional layer of confirmation to the installer as you suggested but there are limitations to what can be done with the OS X developer tools package maker…
There may still be another option – depending on what kind of Mac you have you may be able to either remove the hard drive and simply use a windows PC with recovery software to recover the data and restore the partition (I have used an application called R-Studio to do this in the past, another application called Partition Table Doctor also helped me to recover deleted partitions and corrupted partition tables in the past but I am uncertain if this product is still available or if it supports GUID partition schemes). Otherwise your best option is to try and boot to an installation DVD and try to repair the MBR & GUID as I just mentioned… Also you could at least plug in an external hdd and mount it and the HFS+ partition internally then use the terminal to backup any of the data on the drive that you need which would at least make a re-installation less of a hassle (I’d suggest you backup everything if possible, though you may only have to restore the apps and user directories post-install)….
I hope these ideas might be of some help to you, let me know how things turn out. Good luck.
Please help out! If not, I’d have to erase and reinstall which would suck. Thanks in advance for any help.
Thanks a lot for the awesome myHack tool and other cool things you’ve contributed to the community. I, too, made the mistake and messed up my GUID partition. I was doing way too many installing (trouble shooting, reinstalling, etc.) and one of those times I accidentally did not change the location. Anyway, now when I try to change my partition size I get an error message at “Verifying disk…”. It says, “Partition failed with the error. Could not modify partition map because filesystem verification failed.” I have a month old Hitachi 500GB drive.
Shouldn’t the tool ask for a second time, “Are you sure you’re going to …” when the destination is the primary disk instead of a USB? The prevention seems too easy, but the consequences are heavy. I’m not an idiot, and I knew of this, however, I forgot to change the default location (Macintoch HD) and now I’m screwed.
Again, thanks for all the help.
Indeed
:) just making sure. Point being the GUID solution should be the “first” one, as i’d venture to say 99% of ppl who make this mistake are on GUID
Not many but it does exist :P
Usually it’s people who are tweaking, running boot camp or custom loaders… I doubt many of those people would have made the mistake of installing chameleon to their mac lol, but I included the information here “just in case”.
Why would OS X be installed on an MBR Partition table on a real mac?? (not that it CANt be done, but how likely is it?)
Dogei22: I am sorry to hear you made that mistake, but I wanted to thank you for the info on GUID partitions. I am sure it will help someone if they find themselves in the unfortunate position you did.
I have included it in the original post with some minor alterations.
Good job on finding a solution that didn’t result in any data loss or too much downtime!
I went ahead and did it, yes, destroyed my Mac Mini 10.6 installation by mistake (became completely unbootable after installing myHack, stuck at the initial grey screen with no Apple logo).
In addition, I have a GUID installation so the instructions in this post intended for MBR installations were not very applicable for me. Luckily, I tested myself out of the situation and found a very simple fix for this.
GUID SOLUTION
——————
1) As described above, go ahead and boot from a OS X DVD. I used the 10.6 retail DVD.
2) Start Disk Utility
3) Select your OS X HDD/SSD that you screwed up (not specific partition)
4) Go to the Partition tab
5) Grab the lower right corner of your key partition and resize it a little bit (no matter how much/little you resize it as long as you change the partition size)
6) Click Apply. Relax, this will NOT erase your HDD/SSD, it only rewrites your GUID partition data that will fix you HDD/SSD.
7) Quit the Disk Utility and reboot when done
8) Enjoy your restored Mac that should now boot normally!
This is tried and tested, worked fine for me… ;-)