Upgrade to mountain lion from dual-boot ubuntu configuration

I have a Lion installation dual-booted with Ubuntu using refit. Upon trying to upgrade to Mountain Lion, I reboot into the mountain lion installer, and get a message about OS X not being able to be installed on this disk since it can't be booted.

How can I recover from this situation? My machine is not having a problem being booted (I can work around that).


Solution 1:

I also had this problem (on a 2012 MBA). Running rEFIt's partition table tool and accepting the "update the partition table" dialog it offered fixed it for me. (The Ubuntu install instructions at https://help.ubuntu.com/community/MacBookAir4-2 do tell you to do this to resync the partition tables; but not doing it didn't seem to cause a problem at the time.) For me the only partition table change it made was to change the type of the recovery partition to Apple Boot: probably best to look carefully at what it is proposing on your system before accepting it.

Solution 2:

Basically, I ran into the issue discussed on the apple message board. One of the partitions had been altered (probably by rEFIt), and I had to "fix it". I'll list the steps I went through while troubleshooting. I guess it goes without saying you should have good backups before you do this. Not an issue for me.

  1. I'm running a MBA 2011, one internal disk, 6 partitions on it in total.
  2. I repaired the disk with disk utility, reboot (not sure that this did anything).
  3. I tried to use fdisk -u /dev/disk0, reboot (not sure that this did anything).
  4. I tried an article about resizing a partition with disk utility, it didn't work. Some error about wrong partition type, even though it was an HFS+ partition.
  5. I installed gptfdisk -- installed using brew brew install gptfdisk. I'm sure you can get it another way.
    • once installed, you run with sudo gdisk /dev/disk0
    • find your "Recovery Partition", for me that was partition 3 i <CR> 3 <CR>
    • Change the type t <CR> 3 <CR> to Apple Boot
    • Write the table w <CR>
    • Reboot
  6. Upon reboot I could successfully upgrade to mountain lion

To get Ubuntu back booting I had to do a combination of fixing up the MBR, and re-installing grub to /dev/disk0 (/dev/sda in ubuntu) which should be familiar to most people. For my case (Macbook air 4-2), I had to follow ubuntu's instructions (skipping things associated with installing the OS of course), especially the part about the bios_grub partition. This must be something that was done for me in the past, since this is the first I remember seeing it.