Tag Archive for 'boot'

How to triple boot Mac Pro with OS X, Fedora, Windows

Here are some step by step instructions on how to triple boot a Mac Pro (and I guess any Intel based Mac) with OS X (Snow Leopard), Fedora 12 and Windows XP. I ran into trouble because of the Fedora 12 installer being clever and setting my Fedora partition to be bootable, which didn’t play nice with the MBR table and Windows.

Firstly, the Mac Pro I am using has a 500GB SATA drive, so the partition sizes that I choose reflect that fact. Your machine might be different, so adjust accordingly.

Step 1
Install OS X on single partition using the whole drive (insert DVD and boot with C key held down).

Step 2
Use the diskutil terminal command to resize the OS X partition and create one for Linux and Windows.

Open “Terminal” and then run:
sudo diskutil resizeVolume disk0s2 200G "MS-DOS" "Linux" 200G "MS-DOS" "Windows" 5G
(Note that the final number for the Windows drive doesn’t really matter, it will fill all remaining available space.)

Step 3
Under OS X, install rEFIt (a graphical EFI boot loader) and then bless the drive:
sudo /efi/refit/enable-always.sh

Step 4
Insert Fedora 12 disk and reboot, holding down the C key (or boot it from the Linux CD entry in rEFIt menu).
(Note: I had to install via FTP, because installing from DVD didn’t always work on my Mac Pro. If you have the same issue then at the boot menu hit the “Tab” key and add “askmethod” to the kernel line and boot the entry.)

Step 5
During the installer, select the 3rd partition for / (choose “Custom” partition), format ext4.

Next, switch to terminal 2 (CTRL+Alt+2) and toggle boot to off for the Linux partition, like so:
parted /dev/sda
toggle 3 boot
quit

Now sync the GPT and MBR partition tables:
gptsync /dev/sda
(Or you can do this step via rEFIt menu after the install if you prefer.)

Switch back to terminal 6 (Alt+6) and continue. Install the boot loader to /dev/sda3 (this is the default).

Complete Fedora install, reboot into OS X, eject disk, insert Windows XP install CD.

For reference, the GPT partition table should look something like this:

[chris@localhost ~]$ sudo parted -l

Model: ATA ST3500630AS P (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 20.5kB 210MB 210MB fat32 EFI System Partition boot
2 210MB 200GB 200GB hfs+ OS X
3 200GB 400GB 200GB ext4 Linux
4 400GB 500GB 99.9GB ntfs Windows

While the MBR table should look like this:

[chris@localhost ~]$ sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xcce7cce7

Device Boot Start End Blocks Id System
/dev/sda1 1 26 204819+ ee GPT
/dev/sda2 26 24325 195181428 af HFS / HFS+
/dev/sda3 * 24341 48656 195311616 83 Linux
/dev/sda4 48657 60802 97556480 7 HPFS/NTFS

Step 6
Reboot, holding down C key (or choose the Windows CD entry from rEFIt menu), install Windows XP to 4th partition, format NTFS.
If the Windows installer sees a single partition and can’t detect the file system, re-sync the GPT and MBR partition tables via rEFIt or Fedora gptsync command. Also, ensure that the Fedora partition is not set to be bootable (Step 5, part 2). The installer should see multiple drive letters, with the 4th partition being the C drive. Yes, Windows has to be installed on the last partition.

After install, the rEFIt menu should see Windows on the hard drive. Boot it and continue your Windows install. Once installed, insert the OS X Snow Leopard DVD and install the system drivers, etc.

That’s about it.

Fedora, Macs and EFI

When installing Linux beside OS X, Fedora toggles the boot flag on for its partition. This causes GPT to see it as an “EFI boot partition,” rather than “Basic Data”. This appears to cause a problem if you want to triple boot with Windows and under OS X the disk utility will see it as one whole partition, with the Linux half missing.

To fix this, toggle the boot flag to off using parted and then sync the GPT partition table to the master boot record partition table. It’s easiest to do this while the installer’s running (switch to TTY2) else you’ll have to install anaconda under your install to get gptsync (or run it from the rEFIt menu).

Simply run the following:
parted /dev/sda
toggle 3 boot
quit
gptsync /dev/sda

The gptsync command should spit out the “Current GPT partition table” which should show something like:
EFI System (FAT)
Mac OS X HFS+
Basic Data
Basic Data (if you have a fourth partition for Windows)

The “Proposed new MBR partition table” should show something like:
EFI Protective
Mac OS X HFS+
Linux
FAT32 (LBA) (or NTFS, depending if it's already been formated)

Now Windows should install cleanly on the fourth partition (if you’re doing that) and the partition structure under OS X should be correct.

More jackalope than jaunty

We have some IBM x3650 servers at work with Adaptec 8k ServeRAID controller cards and SAS drives.

For the life of me I can’t get Jaunty to boot on the machines. It installs just fine, but the initial reboot fails to find the root device and drops me to an “ash” shell which doesn’t ever actually appear. The keyboard also doesn’t work.

It doesn’t matter what RAID array I have, whether I’m using LVM or a standard partitioning scheme with an msdos partition table.. it just doesn’t work.

I’ve added aacraid and several other modules to the initramfs, still no joy.

Add the fact that the machine takes 10 minutes to boot each time I want to test a small change and it’s one super frustrating situation.

Oh, and 8.04 LTS works just fine.

One bug which appears to be a grub issue that I don’t have, which hasn’t been touched since April. There’s another about being unable to find the root device that also hasn’t received any love.

If anyone has some suggestions (install Debian?), let me know. The reason I’m using Ubuntu is because we have a local mirror and Jaunty because it’s a virtual machine and KVM is the way I want to go.

Update: Ahh, problem resolved and it was my fault. See comments..

Linux on an Apple Xserve EFI only machine

We have a few of these Apple Xserve machines at work which weren’t doing much, so I thought I’d make better use of them. Naturally, this meant installing Linux on them.

These machines do not have a BIOS (or even any emulation), they use EFI and as such won’t boot the standard Linux install media. I knew that Fedora could boot EFI, so that’s where I started, with Leonidas (version 11). Unfortunately, the install media just wouldn’t work on this device, presumably as it has no BIOS emulation.

To cut a long story short, I had to learn how EFI works in order to get it booting and it wasn’t an easy thing to discover!

Continue reading ‘Linux on an Apple Xserve EFI only machine’

Bootology [bōōt-ol-uh-jee] -noun. The art of booting Linux

Bootchart openSUSE 11.0I just came across bootchart, a tool for “performance analysis and visualization of the GNU/Linux boot process”.

Ever wondered what was causing that big delay in bootup? Install bootchart and check!

I installed bootchart on my openSUSE box at work with sudo zypper in bootchart, rebooted and edited grub on the fly, adding init=/sbin/bootchartd to the kernel line.

After your system has loaded, bootchart creates a log of the process which you can then turn into a chart with the command bootchart. You can also specify the log location if required, or change the output format of the chart from PNG to SVG or EPS.

Of course, what you do with this information is up to you :) Happy hacking.