This is not a yaboot problem. The partitioner is what's borking the partition map. Here is how I circumvented the problem, and got my iBook dual-booting. Total time for this procedure (not including coming up with it) was about 4 hours.
Part 0: Acquire documentation.
It is frustrating to need a manpage and not be able to get to it. At least print out (or otherwise give yourself access to) the manpage for mac-fdisk. This is where you are most likely to deviate from what I did, and if you do, you may want the docs. If you are extremely risk averse, consider printing the manpage for every command listed here. If you have another computer available with the operative documentation installed, you're good to go.
Part 1: Install Debian Etch on a memory stick:
As part of a previous attempt to fix this, I had installed the base and standard system on a USB memory stick. It's not bootable on my system, and it was very slow to install, but I did use it in this procedure, so I recommend doing the same before you start this. If you know a better way, use it (and post it).
Part 2: Mac OS 9:
Start up with the Mac OS 9 install CD. Use 'Drive Setup' to partition the drive into 4 partitions. The last one should be 'Mac OS Extended'. (Standard may also work.) The first three should all be 'Unallocated'. The sizes don't really matter as long as they add up to the same sum as what you want for your boot, swap, and root partitions. Install Mac OS 9 on its partition, including the reboot and Setup Assistant.
Part 3: Install Debian Etch on the hard drive:
Insert the memory stick in the USB port and boot from the Debian Install CD. Start the install with the expert option. Perform the first several steps of the install through and including 'Detect disks'. DO NOT 'Partition disks'; instead 'Execute a shell'. The idea here is to do the things that would have been done in the 'Partition disks' step without using the default partitioner, and thereby avoid the problem.
In my case, I put Linux on the drive hda. If you have made a different choice, adjust accordingly. I start up an alternate partitioner with 'mac-fdisk /dev/hda'.
Print the partiton map to see what you have, i.e. issue the 'p' command. In my case, partitions 9, 10 , and 11 are the ones I'm going to use for Linux, and partition 12 is the one that contains Mac OS 9.
I now delete the middle one of the 3 Linux partitions with 'd 10'. Issuing another 'p' command shows that this has had the effect of combining the 3 free partitions.
Now, I start making partitions. The 'b 9p' command creates a new bootstrap partition at the beginning of the free space. Issuing another 'p' command shows that the bootstrap is now partition 9 and the free space is now partition 10.
Now, I create a swap partition with 'c 10p 192M swap'. I used 192 MB for swap, but the size doesn't matter. Issuing another 'p' command shows that the swap is now partition 10 and the free space is now partition 11.
I want to use the remaining space for my root file system so I issue the command 'c 11p 11p root'. Issuing another 'p' command shows me the result.
Since I'm happy with the partition map, I write it to the disk with 'w', confirm with 'y', and quit with 'q'. Here is the operative portion of the map:
Code:
# type name length base ( size ) system
---------- --------------- ---------- -------- -------- -------- ------------------
/dev/hda9 Apple_Bootstrap bootstrap 1600 @ 1544 (800.0k) NewWorld bootblock
/dev/hda10 Apple_UNIX_SVR2 swap 393216 @ 3144 (192.0M) Linux swap
/dev/hda11 Apple_UNIX_SVR2 root 10619328 @ 396360 ( 5.1G) Linux native
/dev/hda12 Apple_HFS untitled 4 717409 @ 11015688 (350.3M) HFS
The next step is to put a file system on the root partition. The utility 'mkfs' wasn't available, so I used it off the stick. First 'mkdir /stick' to make a place to mount the stick. (In my case the system on the stick was on /dev/sda3. Use 'mac-fdisk -l' to find out this info on your system. In my case, it scrolled off the screen before I could read it. If that happens to you, try 'mac-fdisk -l /dev/sda', and if necessary keep poking around until you find
it.) Then to find out what to mount issue the command 'ls -l /dev/sda3' to find out where it points. In my case it was 'scsi/host0/bus0/target0/lun0/part3'. Now mount the stick with 'mount -t ext3 /dev/scsi/host0/bus0/target0/lun0/part3 /stick'. This gave me access to 'mkfs' to make the root filesystem; '/stick/sbin/mkfs -t ext3 /dev/hda11' does the trick. Out of an abundance of caution I 'umount /stick'.
The next step is to mount the partition where the installer wants it to be. First create the target location with 'mkdir /target'. Then find out where the device points with 'ls -l /dev/hda11'; in my case it was 'ide/host0/bus0/target0/lun0/part11'. Then mount the partition with 'mount /dev/ide/host0/bus0/target0/lun0/part11 /target'. You're done, so 'exit' to go back to the installer.
Start with 'Configure time zone' and continue. At 'Configure the clock' answer <No>. At 'Install base sytem' DO NOT 'Partition disks'; instead choose <Go Back> -- repeatedly if necessary. When yaboot loads, it will not recognize Mac OS 9. We add that in a later step. At 'Finish installation' it will once again ask you to 'Partition disks'; DO NOT do this. Instead choose <Go Back>.
Part 4: Clean up
When you boot your new system, some things still aren't quite right. First, you will get a warning that /etc/fstab does not contain the fsck passno field; this just means that it's not configured at all. So the first thing you should do is log in as root, edit it ('nano /etc/fstab'), and fix it. In my case, I like to automatically mount my mac partition as well so I did 'mkdir /mac' first. Here's my fstab (in part) as a sample:
Code:
# <file system> <mount point> <type> <options> <dump> <pass>
# ------------- ------------- --------- ---------------------------- ------ ------
proc /proc proc defaults 0 0
/dev/hda10 none swap sw 0 0
/dev/hda11 / ext3 defaults,errors=remount-ro 0 1
/dev/hda12 /mac hfsplus defaults 0 0
/dev/hdc /cdrom iso9660 ro,users,noauto 0 0
Once you've saved that and gone back to the shell, you'll also need to get your swap working
with 'mkswap /dev/hda10' and then 'swapon -a'. Then you can mount everything correctly with
'mount -a'.
Now you'd probably really like to be able to boot into Mac OS 9. You'll need to edit
/etc/yaboot.conf to add that and then run 'ybin' to activate it. Here's my yaboot.conf (in part)
as a sample:
Code:
fgcolor=yellow
boot=/dev/hda9
device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:
partition=11
root=/dev/hda11
timeout=50
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
macos=/dev/hda12
enablecdboot
image=/boot/vmlinux
label=Linux
read-only
initrd=/boot/initrd.img
append="video=ofonly"
image=/boot/vmlinux.old
label=old
read-only
initrd=/boot/initrd.img.old
append="video=ofonly"
Now you should be able to boot into either Linux or Mac OS 9. If you have to reinstall Mac OS 9 after this, the startup changes; it still works, but it's weird. You can fix that by rerunning ybin.
Good luck.
sdp