Triple Boot install on early 2011 Macbook Pro

Here Is my guide for triple booting MacOS Lion, WindowsXP, and openSUSE 12.3. There is a lot of very good info about setting up a Hybrid MBR, a necessary evil for Macs and their weird EFI, on this page: and I recommend reading as much as you can.

This is my walk through, for which I will try and give reasons for what I did to avoid the problems I encountered, and maybe some others can better explain the errors or think of better ways around them.

First of all I tried booting a Live openSUSE USB, but immediately ran into issues with the EFI boot on the install media and macs weird EFI implementation (and maybe the combination intelHD and ATI graphics?). Early on the grub2 boot gives “error: terminal ‘gfxterm’ ins’t found.” The EFI Grub2 menu doesn’t allow passing variables like nomodeset, so all you can do is start the Live environment, installation, or media check. Whichever you select, it will drop into a log console, sometimes with the last entry reading “/usr/sbin/klogconsole”. If you started a live environment, after a minute you would hear the startup sound play, and I got the sense that my clicks and key presses were doing something, but the screen would never change. Tried Ctl-Alt-F7, and plugging in an external monitor, but still nothing. I know Ubuntu has released a specific EFI boot file and live installation media specifically for macs to get around this, and I hope openSUSE does as well.

So, Grub2 EFI boot is out of the question for openSUSE, but I knew I needed a legacy BIOS boot for Windows XP anyway, So I will use it for booting linux as well. Here begins the tutorial.

Boot Manager:

The boot manager that the mac comes with (holding down ‘option’ key during startup) is rather limiting, so I installed rEFIned. You can download it here, and follow these instructions to install it.

Disk Partitioning:

I used the default mac Disk Utility app to do most of the partitioning. You will need to turn on debug mode on Disk Utility for some of the steps we will take.

The first step is to resize your MacintoshHD partition. I made mine 100GB smaller.

Next, if you have a recovery partition and want to keep it, you will need to move it to the end of your drive. I made 2 partitions in the empty space, the first a filler, the second one I made 1.5 GB. After committing the changes, it ended up actually being 850MB, and we need it to be at least 650MB. Use the restore tab to copy your existing Recovery HD to the new one. When done, erase the old recovery partition and the filler partition. I think I had some issues removing the old recovery partition, and I can’t remember if I used a combination of mounting it, erasing it, removing it, or if I had to use gdisk to remove it.

Now define your new partitions. You should see a first hidden partition for the system EFI info and the second partition for the Macintosh HD. You need to add a 3rd partition for Linux, a 4th partition for WindowsXP, and a 5th Partition for SWAP (I guess you could add a 6th for /home if you wanted). Partition Type here doesn’t matter so much, so i just went with FAT. What is important is that GRUB doesn’t want the linux root/boot partition on a partition # > 3, and Windows XP will give a missing or corrupt hal.dll error if there is a partition it doesn’t like after it in the MBR list. Any partition # > 4 won’t show up in the hybrid MBR, but after grub has booted the linux kernel it will find the other partitions. As a side note in case you wanted to try something crazy (as I first tried), the first 4 partitions in the hybrid MBR and GPT partition tables have to have matching partition numbers 1-4, no skipping over GPT partitions when defining the hybrid MBR.

**Creating Hybrid MBR:
**
Again, more info on this here. For this step I used gdisk. You can download it here. Start gdisk and view your GPT partition disk. It should look something like this:


$ **sudo gdisk /dev/disk0**

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Command (? for help): **p**

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640      1269940887   605.4 GiB   AF00  Macintosh HD
   3      1270204416      1319215103   23.4 GiB    0700  OPENSUSE
   4      1319215104      1455673343   65.1 GiB    0700  WINDOWXP
   5      1455673344      1463488511   3.7 GiB     0700  SWAP
   6      1463489016      1465149127   810.6 MiB   AF00  Recovery HD

Command (? for help): 

Next you will want to enter recovery mode and create the hybrid MBR. More info on this is available here. But here is exactly what I did (my key entries in bold):


Command (? for help): **r**

Recovery/transformation command (? for help): **h**

WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.

Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: **2 3 4**
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): **y**

Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF): **af**
Set the bootable flag? (Y/N): **n**

Creating entry for GPT partition #3 (MBR partition #3)
Enter an MBR hex code (default 07): **83**
Set the bootable flag? (Y/N): **n**

Creating entry for GPT partition #4 (MBR partition #4)
Enter an MBR hex code (default 07): **07**
Set the bootable flag? (Y/N): **y**

Recovery/transformation command (? for help): **o**

Disk size is 1465149168 sectors (698.6 GiB)
MBR disk identifier: 0x0FBA0FBA
MBR partitions:

Number  Boot  Start Sector   End Sector   Status      Code
   1                     1       409639   primary     0xEE
   2                409640   1269940887   primary     0xAF
   3            1270204416   1319215103   primary     0x83
   4      *     1319215104   1455673343   primary     0x07

Recovery/transformation command (? for help): **w**

Installing:

Put in your WindowsXP install CD and reboot the computer. Hold down the ‘c’ key to boot from the CD. rEFIned doesn’t always show a legacy boot CD as an option, so the ‘c’ key is the way to go. Install windows as normal, being careful to only use the partition you created for windows (reformat it, but do not create or destroy any other partitions). Hunting down all the drivers you will need is a post all unto itself.

As for linux, to avoid the EFI boot, you will have to burn a cd (no legacy boot from USB) and once again hold the C key while booting your mac. The only caveat for installation is that you need to enable booting from the MBR, or else you will again be stuck with an EFI boot that doesn’t work with Mac’s EFI implemetation. In openSUSE at the confirm installation page you can click on the “boot loader” section to enable it.