2011年7月9日星期六

Dual boot linux and osx on powermac with 2 disks

I have a powermac with osx installed. I don't want to resize the first disk to install linux, so another disk was installed and linux was installed there.

The second disk's partition type can be normal MBR and can be partitioned using fdisk.

The installation is as simple as it can be found on gentoo's handbook.

The tricky part is to install the yaboot.
I decide the install the yahoot on the first disk because it's apple partition type and it actually has enough free space to host a bootstrap patron:

/dev/sda
# type name length base ( size ) system
/dev/sda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sda2 Apple_Free 262144 @ 64 (128.0M) Free space
/dev/sda3 Apple_HFS Untitled 700585936 @ 262208 (334.1G) HFS

Start mac-fdisk and using "b" to create a bootstrap partition:
The first block can be 64. Then it looks like this:

/dev/sda
# type name length base ( size ) system
/dev/sda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sda2 Apple_Bootstrap bootstrap 1600 @ 64 (800.0k) NewWorld bootblock
/dev/sda3 Apple_Free 260544 @ 1664 (127.2M) Free space
/dev/sda4 Apple_HFS Untitled 700585936 @ 262208 (334.1G) HFS


The yaboot.conf needs to specify the second disk manually:

* Because the linux is installed on /dev/sdb1, we have to use ofpath to get the device path first:

# ofpath /dev/sdb
/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:

* Then in the yaboot.conf:
boot=/dev/sda2 # This is the bootstrap partition we created
# This is the disk and partition where linux is installed.
device=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:
partition=1

Then use ybin to install yaboot.

Bingo!

没有评论: