Installation Karmic Koala on MacBookPro 1,2 without rEFIt by chainloading from XP

One day I decided to install ubuntu linux 7.1 from the Linux Starter Kit DVD104 I got from the Linux Format magazine.

I am very familiar with the old linux, going al the way back to 1995 with Infomagic, Slackware and Red Hat distros.

I just upgraded the HD in my Macbook Pro 17” to 500 GB and dual boot Mac OS X and Windows XP.

The install of ubuntu was very easy. I noticed a customize | advance option where I could turn OFF the lilo boot loader. So I thought to myself I don’t want that, I prefer the Max OS X default boot method, so I turned off using the lilo bootloader.

OK, I’m going to omit the lengthy description of how the MBR got screwed up and rendered my boot camp partition unbootable, thanks to unbuntu, and that it took rEFIt to fix the MBR to regain bootability of Windows.

At this point I can dual boot OS X and Windows as before ubuntu installation. I removed rEFIt (nice tool, but prefer the “standard” Mac boot scheme).

I CAN boot the ubuntu installation using the Parted Magic CD I created from the partedMagic4.8.ISO image I downloaded. I do that by booting the CD and selecting the “Super Grub Disk 2” option on one of the sub menus. Selecting that option gives me the ability to boot ubuntu off my HD.

THE QUESTION is how can I install the grub(2?) loader onto the ubuntu partition to boot it? I’m not familiar with grub at all. I did find an excellent page on triple booting Macbooks at the onmac.net wiki titled “Tripple boot via bootcamp ubuntu”. It described several techniques, the one I favored is to boot NTLDR and select ubuntu. It copies the MBR from the ubuntu partition onto the windows partition and adds and entry to the windows boot.ini for it.

The problem is there is no boot loader on that partition (remember I skipped lilo with the ubuntu installation).

So how do I get a boot loader installed on the ubuntu partition? I would like to duplicate the parted magic “Super grub2” boot process and I think all I need is to get the boot loader on the ubuntu partition.

I have all the Op Systems installed and working, its just a matter of how to boot the ubuntu OS through Windows.

Here's what I did for a tripple boot setup. I went through alot of trials and I'm not sure if the order is important. Here is the setup I now have and it works for me on my Macbook Pro 1,2. But as they say, "your mileage may vary" :).

I have a 500GB disk partitioned like this:

Code:
   
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640       251281447   119.6 GiB   AF00  Apple_HFS_Untitled_1
   3       251543592       670187559   199.6 GiB   AF00  Apple_HFS_Untitled_2
   4       670449704       879902759   99.9 GiB    0700  Windows XP
   5       958028994       976773134   8.9 GiB     8200  Ubuntu Swap
   6       879902760       958027760   37.3 GiB    0700  Ubuntu 7.10

I use 2 partitions for OS X. Using the gdisk on the Parted Magic CD (version 4.8 ), I created a hybrid MBR:

 

Code:
   
Number   Boot    Start (sector)  Length (sectors)       Type
   1                        1            409639         0xEE
   2                   409640         250871808         0xAF
   3                879902760          78125001         0x83
   4       *        670449704         209453056         0x07

Now I can tell you that when I partitioned the 500GB I used the GUI disk utility on Max OS X, and left 50GB unallocated. After OS X and Windows XP were setup on a Boot Camp scheme I decided to install Ubuntu 7.10 from the Linux Format Magazine DVD. I installed it running Windows XP. I DID NOT install a boot loader, thinking it would screw up my Mac OS X booting. That was before I knew anything about EFI booting.

 

I found rEFIt, Parted Magic, gdisk, etc and various posts about triple booting Macbooks. I like rEFIt but for 2 reasons don't use it: 1) it interferes with Macbook updates, 2) it cannot be configured like lilo, grub or grub2 can be, at least not yet (I am using v0.12). I may go with rEFIt in the future however, as it looks like it will be the prefered way to boot EFI systems. The current version doesn't allow me to specify the boot rules for my setup. It didn't recognize my Ubuntu installation on partition 6 until I installed lilo. Plus, I kindof like to have the Linux OS hidden. So chainloading it from Windows XP is the setup I use.

 

Using the Parted Magic CD, I copied the lilo files and shared libs it requires and the Super Grub2 file sgd2.gz to the Ubuntu partition from the Parted Magic CD. Then I booted Ubuntu using the "Super Grub2 Disk" option under the "Other Features" menu.

 

I then created a /etc/lilo.conf":

 

Code:
# Global LILO settings
boot=/dev/sda6                            
timeout=0              
default=SuperGrub2

# Kernel specific LILO settings

image=/boot/vmlinuz-2.6.22-14-generic
append="figure out kernel command line to set proper root"
label=Ubuntu

# This loads the grub2 boot loader to boot Ubuntu. Eliminate when above is figured out 
image=/boot/syslinux/memdisk initrd=/boot/sgd/sgd2.gz
label=SuperGrub2

I didn't have the manpage for lilo.conf, and I couldn't figure out how to set the root, (I don't have Internet at the house!) so booting Ubuntu directly always caused a kernel panic when it failed to mount the root fs.

 

I then wrote the lilo boot sector to /dev/sda6 using:

 

lilo -v -P ignore

 

Then I copied the boot sector over to my Windows XP C:

 

dd if=/dev/sda6 of=/media/DOS_FAT_32_Untitled_3/sda6MBR.bin bs=512 count=1

 

The last step was to change the Windows boot.ini to chainload to the Ubuntu partition:

 

Code:
   
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(4)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="Windows XP SP3" /noexecute=optin /fastdetect
C:\sda6MBR.bin="Ubuntu Linux 7.10"

And thats it. Ubuntu is booted through the "Windows" boot camp partition.

Link to the original is here.

© 2002-2012 Jeroen Diederen. Drupal theme by Kiwi Themes.