Triple Booting

From Mactel-Linux

There are two solutions, one for installing Slackware and one for installing Debian. Linux is an OS of choice after all!

See also: Boot Alternatives - Dual Booting

Contents

Using Boot Camp

see here

Using Windows Bootloader

Here the method of chainloading grub or lilo through the Windows bootloader is described.

Using xom and refit

Slackware

As of around 1AM on March 30th I have a working triple boot MacBook Pro running Slackware, Windows XP, and of course OS X. The biggest roadblock in the process seems to be the partition tables. Creating and deleting partitions in this order is the only method I have seen work so far. I'm working on a full set of instructions, but for now here is the dirty version:

  • You will need to create a modified XP disk from your own XP w/SP2 install CD. I used a volume license disk, but most XP-SP2 disks will work. Follow the Mac OS X instructions for building this CD, found on the OnMac Wiki.
  • Do the general steps for installing OS X, and create 3 partitions. The first should be formatted as MS-DOS, the second as HFS+ (Mac Extended with journal), and the third as UNIX. The size doesn't seem to matter much, but I went with 10GB, 40GB, and 61GB, because of my intended usage of the machine. (NOTE: if you want read-write access to the Windows partition, you will need to keep it under 32GB) I *HIGHLY* recommend choosing the custom install, and only installing the essential OS X files. Otherwise, you will be waiting for 15GB+ of programs to install, and if you screw up you have to do it all over again.
  • Once OS X is installed, and you've gone through the pretty introduction screens and registered, you need to put in your XP_ON_MAC CD created in the first step. Copy the xom.efi into the *root* directory of your OS X drive.
  • Open a terminal and bless the xom.efi file with (volume name may differ):
cd /Volumes/osx
sudo bless --folder . --file xom.efi --setBoot
  • Reboot. You will be presented with a crystal apple. This is the xom.efi boot loader. Press [down], [f4], then [f7]. Enter 640, then 480, then hit enter through the rest of the prompts.
  • Eventually the XP setup will run and give you the partition selection screen. You will need to choose the LAST partition and delete it. Then choose the un-partitioned space that is the size you made your ms-dos partition during the OS X install (this should be the first un-partitioned space if you followed directions). Press "C" to create a partition, then choose FAT (not the quick format). Let it format, and when it starts copying files force the Mac to power off (press power for 5 seconds).
  • Power on, and do the [down], [f4], [f7], 640, 480 thing again. You will have to strike a key to boot from the CD this time. When you get to the partition selection screen again, your partition should now properly be labelled C:, and you can choose it, press [enter], and do the full FAT format again (do not do quick format). Let the installer run, and then it will reboot.
  • At the crystal apple, press [down], [f2], and [enter]. The windows installer should load and walk you through the rest of the steps. At the end of the install, windows will lock up. You will know it has locked up when the mouse cursor stops working. Force the power off.
  • You now have a dual boot system.
  • Get yourself a copy of the LiveCD from this site (mactel-linux). Since I'm telling you how to install slackware, you will need a copy of the slackware package tree (I used slackware-current). I downloaded the slackware tree under OS X and saved it on the HFS+ drive.
  • Download rEFIt, and extract it. I placed it in the root of my HFS+ partition. Bless it: cd /Volumes/osx && sudo bless --folder . --file refit.efi --setBoot --labelfile refit.volicon
  • Reboot with the LiveCD in the drive. Instead of a crystal apple, you should get the nice rEFIt boot loader. Choose to boot linux (the penguin).
  • When you get to the console, start typing (these are off the top of my head, and need to be verified):
rmmod -f dm_mod
mke2fs -j -b 4096 -L 'Linux' /dev/sda4
mkdir /mnt/hfs
mkdir /mnt/ext
mkdir /install
mount /dev/sda3 /mnt/hfs
mount -t ext3 /dev/sda4 /mnt/ext
cd /install
tar -zxf /mnt/hfs/slackware/a/pkgtool-10.2.0-i486-6.tgz
export PATH=/install/sbin:$PATH
cd /mnt/hfs/slackware/a
installpkg -root /mnt/ext *.tgz
cd ../ap
installpkg -root /mnt/ext *.tgz
(... Continue doing this for each folder in the slackware tree ...)
cp /etc/X11/xorg.conf /mnt/ext/etc/X11/xorg.conf
chroot /mnt/ext
passwd
(... set your root password ...)
echo "/dev/sda3 / ext3 defaults 1 1" > /etc/fstab
exit
reboot
  • Boot into OS X. Once there, you need to drop a copy of vmlinuz, e.efi, and elilo.conf into your root OS X directory. Unlike on a BIOS machine, you will be booting your kernel straight off the HFS+ partition using elilo. You will need to set up an elilo.conf file that will point your kernel to the right location for root. I simply modified the elilo.conf found on this site (and used in the livecd) so it not longer used an initrd, and so that root=/dev/sda4. Be sure to remove the livecd from your drive, and reboot. (NOTE: no more blessing is required, rEFIt automatically detects changes to elilo.conf and such).
  • rEFIt should now present you with triple-boot options. Slackware is configured by default to boot to a command line. You can edit /etc/inittab to change this to runlevel 4 if you like.
  • You will need to compile a kernel and install the modules. Rather than placing your new kernel in /boot and doing the lilo thing, you need to copy the image over to the HFS+ partition and edit elilo.conf appropriately. This is an essential step, because you wont have a lot of your kernel modules until you do this.

Known issues:

  • XP will lock up when you shut it down. I imagine installing the drivers (links at the onmac.net wiki) for the Intel chipset will fix this.
  • The touchpad does not function properly in linux for some odd reason, though it does work when booting from the LiveCD.
  • When you choose the Windows option from the rEFIt screen, you get the crystal apple from xom.efi. This is because rEFIt simply executes xom.efi, and this is how xom.efi is written. Simply press [down] then [enter] to boot windows.

Hopefully this helps some people out.

~Coder7

Using a different approach

Debian

This method has a bit different approach. Actually anything you need to download for a bare minimum debian installation is already inside a 41MB package (you don't need the Live CD). Download the package from here, untar it somewhere and open the README FIRST file under the documentation folder. Follow the instructions there and you will be able to install debian (and windows) on your Mac.

Enjoy triple booting!

~teras

A Boot Camp, rEFIt, LILO method of triple-booting with Debian Etch is explained in this MacBook Triple-Boot HOWTO.