jump to navigation

iMac triple-boot (Part 1): The perfect partitioning scheme ;) June 18, 2008

Posted by idebian in Apple, MacOS.
Tags:
trackback

Hi Guyz,
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:

  1. Mac OS 10.5.3 Leopard
  2. Debian GNU/Linux 5.0 “Lenny” (64 bit)
  3. Windows Vista (32 bit)

In order to achieve this we will go through the following steps:

  1. Repartition the Hard Drive in order to accommodate the other OSs
  2. Install a boot manager (rEFIt)
  3. Install Debian
  4. Install Vista
  5. 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.

Background theory

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 🙂

Considerations/Restrictions:

  • 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)

Action

For those of you who just skipped the technical details, I ended up with the following partitioning scheme:

The triple-boot 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

diskutil list output

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:

“a boot menu and maintenance toolkit for EFI-based machines like the Intel Macs.”

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.

Stay tuned!
Ciao

Advertisements

Comments»

1. jeremy - October 11, 2008

Hey nice write up. I’m going to give it a try. One though, for me I luv tinkering with linux / ubuntu and as a result I sometimes need to reformat the linux partition. So using the linux partition as a share drive is a bit scary to me. 🙂

However, to my knowledge GRUB doesn’t have to be installed on the root (” / “) partition for linux. So could you just have /dev/sda3 be the /home partition for linux and have /dev/sda6 or /dev/sda5 be the root partition of linux. Then when you install linux even though you are installing the root on /dev/sda5 you install grub to /dev/sda3.

That way you still meet all the constraints listed in your article (I think) and you can have a separate data partition allowing you to re-install any os while keeping your data.

I think theoretically that should work but I haven’t tried it out yet. I’ll give it a go and report back

2. idebian - October 17, 2008

jeremy,
I’ll glad to hear test results. Let me know.

Ciao

3. Jeremy - October 17, 2008

OK, worked pretty well. So I’ve got the third partion formated at ext3 and is used to share data. With Windows on the 4th partition and linux on the 5th. Only issue I’m having is I cant figure out how to get osx 10.5 to read write ext3… any ideas?

4. a - January 2, 2009

I have the same problem. I’ve been searching all day, and the only thing I find is an old app (2006) that doesn’t seem to work in an Intel Mac…

5. Robert - January 18, 2009

How big did you make the /home partition for GRUB?

6. alam - January 24, 2011

How we can understand syntax in linux? :p


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: