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.

39 thoughts on “How to repair your REAL Mac if you broke it with the chameleon bootloader.

  1. Thank you so much !!! I restored the MBR of my MacBookk air after a fail installation of chameleon. The “OS X Recovery Disk Assistant” can by used for create a USB recovery tool.
    Also, normally the fist disk is the Mac OS X Installation “/dev/disk0” and no “sudo” command is needed…. so the commands i used was this:

    fdisk /dev/disk2
    fdisk -u /dev/disk2
    fdisk -e /dev/disk2

    fdisk: 1> flag 2
    Partition 2 marked active.
    fdisk:*1> quit
    Writing current MBR to disk.

    Thank you again…

  2. I find the dire warning on the Chameleon installer about not installing on “a real Mac” somewhat misleading.

    A genuine problem does occur when installing Chameleon onto an existing MacOS boot drive installed on real Apple (ie, non-Hackintosh) hardware. But many of us have successfully installed Chameleon to separate MBR-partitioned drives on our “real Macs” for the purposes of, say, running Mountain Lion on “unsupported” Mac mobos.

    • That is why this article, which was written long ago, was specifically only for those who made the mistake of installing chameleon to the root device of a real mac.

      myHack is used to install chameleon on devices attached to a real mac all the time…

  3. Hi I did the same stupidity by installing chameleon on the real mac hdd.
    How did the trick of resizing the partition work? I have not restarted the mac yet.
    When i try to resize the partition using disk utility it goes on for soem time and then says ” Partition failed with error Couldn’t unmount disk”
    Is there a way to reset the MBR without shutting down the MAC?

    • If it won’t allow you to resize it to begin with, which only works on GUID partitions btw – on MBR partitions it will destroy all your data – the only other option you have is to use an OS X installation boot disk and run disk utility/terminal from there.

  4. So, I guess I’m one of these idiots who installed this on my main HD. I haven’t restarted the computer yet so I guess I haven’t suffered the consequences of my mistake. Is there a way to do uninstall it without rebooting the mac? I am in way over my head and should not have messed with Chameleon (following a guide to install ML on a 2,1 Mac Pro).

    Can I undo this before I reboot the computer? Thanks for your understanding and patience.

    • Maybe, try the disk utility method (resize your partition) before rebooting.

      Have a boot DVD/USB handy just in case…

  5. Pingback: 24" iMac Early 2008 Audio Chipset - Page 2

  6. thank you for the tip i resized the partition and it worked – too bad the chameleon interface does not warn you and defaults to installing chameleon on the HD