iMac triple-boot (Part 1): The perfect partitioning scheme ;) June 18, 2008Posted by idebian in Apple, MacOS.
Welcome to my 2 parts guide on how to configure the iMAC for a typical triple boot configuration topped with some little extra goodies.
The system I want shall definitively include:
- Mac OS 10.5.3 Leopard
- Debian GNU/Linux 5.0 “Lenny” (64 bit)
- Windows Vista (32 bit)
In order to achieve this we will go through the following steps:
- Repartition the Hard Drive in order to accommodate the other OSs
- Install a boot manager (rEFIt)
- Install Debian
- Install Vista
- Finalize the process (clean and minor other stuff).
The first two steps will be covered in this post, while the others will be covered in the upcoming post “iMac triple-boot (Part 2): OSs installation“.
If you are not interested in background theory boring details you can skip directly to the “Action” paragraph.
As most of you are probably aware there are some limitations/factors that need to be taken in account planning a partitioninig scheme for such an environment.
EFI systems (hence Apple’s Intel iMAC and Macbook) use a new layout for the hard drive’s partition table: the GUID Partition Table, aka GPT. GPT provides support for a maximum of 128 primary partitions.
In order to guarantee backwards compatibility, EFI systems also provide a legacy MBR entry (the so-called Protective MBR) as the first sector on the disk: this will be used by the OSs which are not GPT aware, as Windows for example.
Of course the GPT and the MBR partition table need to be consistent each other (i.e. synchronized with the same values). We will dig into this issue soon, don’t worry 🙂
- the EFI systems have a partition that contains EFI code: in the Apple systems this is a 200MB FAT32 partition which is unused since the EFI files are stored in the HFS+ partition;
- Windows partition of course needs to be located in the MBR legacy area, i.e. one of the first four primary partition; specifically, Windows must be on the last of the four primary partitions (don’t ask me why…);
- Linux partition needs to be located in one of the four primary partition as well since we are going to boot Linux with a legacy boot loader (lilo/grub) in order to get 3D acceleration;
- Mac OS could be located also outside the legacy area (from the 5th one and up), but in order to share data with the other OSs we prefer to leave it in the MBR visible area;
- since GPT only use primary partitions and MBR needs to be aligned with it, we end up having at most a maximum of four partition available to the legacy operative systems (Windows) and/or boot loaders (grub/lilo);
- since Linux kernel is GPT-aware we can add a swap partition out of the legacy area; even if using a swap partition with 4GB of RAM seems a waste, there are still some functions which relies on it (i.e. suspending).
With all the consideration above the partitioning scheme for a triple boot is then almost fixed as follow:
- /dev/sda1 -> EFI (FAT32)
- /dev/sda2 -> Mac OS X (HFS+)
- /dev/sda3 -> Linux (EXT3)
- /dev/sda4 -> Windows (NTFS)
- /dev/sda5 -> Linux swap (optional)
For those of you who just skipped the technical details, I ended up with the following partitioning scheme:
The EXT3 linux partition will be used as the main data repository, since both Mac and Windows are able to read/write EXT3.
So we are set: let’s going to start… 🙂
1 – Hard Drive partitioning
In order to create the partition I suggest to use MAC OS X tools since they are GPT aware.
We are going to shrink the HFS+ partition and create the other four partition on the fly with the resizeVolume feature of the diskutil command. Here is the command syntax:
$ sudo diskutil resizeVolume disk_identifier disk_size [partition type] ["Partition label"] [partition size]
To resize Macintosh volume to 50G and create the other volume we may simply issue:
$ sudo diskutil resizeVolume disk0S2 50G MS-DOS Linux 359G MS-DOS Windows 52G MS-DOS Swap 4G
Don’t worry about the fact that we created all MS-DOS partitions: we are going to modify the partition type during each OS installation process.
Press Enter when you feel comfortable; you will be asked for confirmation, just confirm.
Congratulations! you are now eligible to the first cup of coffee meanwhile the resize goes 😉
Once completed double-check that everything is fine with the command:
$ diskutil list disk0
Here is better to reboot in order to be sure that everything is up-to-date.
2 – The rEFIt boot manager
rEFIt as reported in their homepage is:
It’s a really nice piece of software… a boot-manager that manages both EFI and legacy MBR based OSs, providing also a tool to synchronize the GPT with the MBR.
To install rEFIt simply download the disk image distributions (.dmg) and once it has been mounted double click on the installer package (refit.mpkg) … piece of cake 😉
Make a couple of reboot and you the rEFIt menu should magically appear with the Mac OS icon.
We are now ready to Rock’n’Roll and proceed to OS installation, but that will follow in the upcoming post “OSs installation!” … it’s enough for tonight.