Triple Booting Your Mac

by Steven Noonan

As a software developer, I find it important to ensure that my programs work well on all platforms. Windows, Mac OS, Linux, whatever. So I decided I should triple-boot my MacBook Pro instead of juggling between a Mac/Windows or Mac/Linux setup.

I’m annoyed that every article I’ve found about setting up a Mac to triple-boot makes it sound like it’s impossible to have greater than four partitions (especially for triple-booting). This simply isn’t the case, and it is hazardous for Linux’s performance in particular because you’re forced to set up a swap file instead of a swap partition and in the case of Gentoo, the /usr/portage mountpoint can’t be separate from the main filesystem (/usr/portage changes frequently and quite randomly, generating awful fragmentation). I’ve had Gentoo installs which had 8 partitions just for Gentoo itself (split up the filesystem to better optimize the usage).

In the past, the problem has been that Intel Macs use the GUID Partition Table (GPT) scheme for representing partition information on disk. Since Windows even now only recognizes the Master Boot Record (MBR) format, Apple came up with a trick that basically makes the disk use a GPT/MBR hybrid. It stores two copies of the partition table. One in GPT format, and one in MBR format. Seems straightforward? It gets tricky.

With MBR, you are limited to 4 ‘primary’ partitions. Once MBR was designed and out the door, people began to realize that 4 partitions just wasn’t enough, and an extension to MBR was developed that would not break compatibility with the existing MBR definition. The extension allowed for one of the primary partitions to be marked as an ‘extended’ partition. Extended partitions sort of store their own partition table which keeps track of the ‘logical’ partitions contained in them.

With the GPT/MBR hybrid, Mac OS X will synchronize the tables when the MBR doesn’t match the GPT table. Unfortunately, GPT doesn’t understand extended/logical partitions and Apple’s sync tool refuses to sync when it detects the MBR has extended partitions defined. So the limitation here is that we cannot have any extended partitions in the MBR if we want GPT/MBR syncing to work.

The solution is pretty simple, really. Windows requires MBR partitioning, but the Linux kernel does not. Simply set up the partition tables with gparted, run the gptsync tool (which can be run pretty easily if you have rEFIt), install Windows, and finally install Linux. Windows will only see the MBR partitioning scheme, and if your Linux distro supports GPT, Linux will see the GPT scheme. Detailed steps are below:

  1. Install Mac OS X. One partition spanning the entire disk for now.
  2. Run the Boot Camp Assistant and allocate however much space you want for Windows/Linux. I allocated roughly two thirds of the drive. When you get to the last step, just say ‘Quit’ instead of ‘Start install now’.
  3. Get a Linux distribution with a LiveCD that supports GPT. There are quite a few, but off the top of my head, I can only say with certainty that Ubuntu’s LiveCD supports this.
  4. Boot the Linux LiveCD and run gparted
  5. Boot Camp sets up a solitary partition for Windows; wipe it out. Add a 100MB partition (this will later be an ext2-formatted /boot partition), an NTFS partition immediately following this, and then whatever other partitions you need (for Ubuntu, you should have /, /home, and a swap partition).
  6. Write the partition tables to disk when you’re satisfied. If your gparted is too old, it will trash the MBR. It’s not terribly bad news. Just run the GPT sync tool (detailed below), and then continue from the next step.
  7. Now bring up a terminal, run ‘cfdisk’, and mark the NTFS partition bootable. Write that table to disk. Reboot.
  8. Assuming you have rEFIt installed, it should show the rEFIt bootloader. Run the partition table sync tool found on this screen. Make sure that the settings it shows are right. It will show that the new MBR will only have 4 partitions listed, but that’s fine. If things look peachy, tell it ‘y’ and hit enter. Now turn the machine off. I have found that if you use the sync tool or anything EFI related before selecting something to boot, the system will just sit there and hang. It’s not destructive; it’s just annoying.
  9. Go ahead and install Windows on the NTFS partition. Things should go fine. I assume you have used Boot Camp before, so you can do your Windows driver installs and updates, etc. on your own.
  10. Now install Linux. In the case of Ubuntu, don’t let it auto partition. Select ‘Manual’ when it asks about it. Tell it what you wanted the partitions to mounted as (100MB is /boot, etc). Once ready, click Next. Once you get to the summary screen that tells what the installer is about to do, click ‘Advanced’. The field which indicates where GRUB will be installed needs to be altered. You don’t want to alter the disk’s MBR, you just want to modify the boot sector on the /boot partition. Figure out the partition name (in my case, /dev/sda3), and put that in there. This ensures that you can boot Windows, Mac and Linux directly from rEFIt instead of being forced to use GRUB for both Windows and Linux.
  11. You should now have a Mac+Linux+Windows machine. Great for software development!

I kind of whipped this article up in a hurry. If there are any questions about this, email me.

Stumble it!

7 Responses to “Triple Booting Your Mac”

  1. MacBook Pro - Can I have XP and Linux on my mac? - Mac-Forums.com Says:

    [...] here is a link for info on triple booting [...]

  2. Rob Garth| Mildly Useful Stuff » Blog Archive » Triple boot Mac/Linux/Windows Says:

    [...] http://www.anomalousanomaly.com/2008/10/31/triple-booting-your-mac/ [...]

  3. Anomalous Anomaly Blog Archive Triple Booting Your Mac Says:

    [...] Anomalous Anomaly Blog Archive Triple Booting Your Mac No Comments, Comment or Ping [...]

  4. Geek Perspective » Blog Archive » My recommended Mac programs. Says:

    [...] Triple Booting Your Mac The Right Way Anymore, Linux is the easiest operating system to install of all (seriously). However, I will grant that it’s a little bit different and thus slightly harder than normal to do on a Mac. You can just use Boot Camp to install it super easily if you want instead of Windows, but every time you turn on your computer the little button will say Windows since that what Apple thinks you’re using Boot Camp for. And what if you want to have Mac OS X, Windows, and Linux? Well, you could use Boot Camp again and just have the Windows button go to a second boot loader to let you choose between Windows and Linux, but that’s lame. So here’s a guide on setting it up so that your computer will present you with the options that actually say Mac, Windows, and PC. And it has pretty icons to go with them, too. That’s important, right? Right? [...]

  5. QuickLinks vom 24. November bis zum 28. November — instant-thinking.de Says:

    [...] Triple Booting Your Mac – Nice walkthrough… [...]

  6. b.l.o.g. » Blog Archive » Bookmarks for December 9th Says:

    [...] Triple Booting Your Mac – Schritt für Schritt Anleitung um Windows, Linux und MacOS X also "Tripple Boot" auf einem Mac (Book Pro) zu installieren. [...]

  7. ivanko1111 Says:

    Анальный сексДовольно интересный сайт о общения, не имет ничего общего с известнами сервисами .
    Сравнительно молодой проект но имеет уже огромный выбор пользователей и
    различные услуги для посетителей , как платные, так и бесплатные. Так же нужно сказать что сайт имеет очень |удобный| понятный] интерфейс! Анальный секс.

Leave a Reply

You must be logged in to post a comment.