OSX & Ubuntu Linux on an iBook G4

My iBook G4 wasn’t being used much so I decided to install Ubuntu Feisty on it. Here’s how it was done, and I give you the warts and all procedure, as it happened, in the hands of an average tinkerer.
First things first, back up all critical files and extra applications on the iBook to another disk of some kind. Your existing OS X will be overwritten.
Then download the “Mac (PowerPC) and IBM-PPC (POWER5) desktop CD” from here:
http://cdimage.ubuntu.com/ports/releases/feisty/release/
You’ll find it at the top of the page. Burn the ISO to disk.
Then boot up the iBook using your Mac OS X setup CD 1. Once up and running, launch the Disk Utility program. This is going to be used to partition the disk so that you can put OS X on one partition and Ubuntu on the other. Remember, the present OS X is going to be overwritten—there is no turning back once the disk is partitioned, so double check that you’ve got everything you want.
Partition sizes will depend on you. I just split everything down the middle. Some people use around 10GB for OS X, but that doesn’t leave any space to play around with, and you would have to omit or delete things like the Garage Band program.
Just make each partition Mac OS X Extended HFS or HFS+. Don’t use HFS+ Journaled, as you won’t be able to write to the OS X partition from Linux. But even if you do, you can disable journaling later, as I had to do, anyway (see below).
When it came to naming each partition, I named the first one “Ubuntu” and the second one “OSX”. That was supposed to prevent confusion about where things were going. Then I went straight ahead and installed OS X on the OSX partition.
Some people advise to install Mac OS X on the partition at the end of the disk. Well, I thought I was doing that by installing to the partition I had named OSX, but I may have misread the Disk Utilities setup, or it may have made up its own mind where it was going, because it ended up at the front of the disk. Not to worry, as it just doesn’t seem to matter, in my experience.
Now the fun starts. Eject the Mac OS install disk and insert the Ubuntu Feisty install disk you burned earlier. Boot from this disk by holding Option + c during start-up. Type “expert” at the boot-loader prompt. This will give you more control during the installation process. Also, make sure you have a network connection so that networking is automatically configured and the system can get any necessary downloads.
Go through the installation process as usual. Everything is straight forward, until you come to the partitioning section. I mean, if you don’t accept the default, letting the installer auto partition for you, you have to put some thought into it to set up your own partitions. First, delete the Ubuntu partition you created earlier, then go back and choose to use maximum free space.
Now, if you don’t care to have customized partitioning , just accept the defaults and skip the next three paragraphs.
I have a confession to make at this point. I used what was the latest build of Ubuntu Gutsy PPC Server as part of my experiment—blame my tinkering gene. The Gusty install calculated the partitioning nicely for me, which desktop versions don’t do, as far as I know. I let it write the partitions.
But then I reflected, if should things not work out, I don’t want to be dealing with a command line. So, I stopped the install process and began again with a Feisty desktop CD, and when it came to the partitioning section, I simply reused what the Gusty disk had set up. I had to rename them, though.
It was lucky I did install Feisty because I learned later after an upgrade that Gutsy is buggy and as slow as hell on an iBook. Abandon all hope ye who enter that zone of hell! I reinstalled Feisty after that little adventure.
Once past partitioning, Ubuntu will continue installing everything smoothly and will eventually install the Yaboot boot manager for choosing your preferred system to boot-up time, OS X or Ubuntu.
That should be it. It’s time to restart, and then you can check that you have ended up with a disk structure something like this:
/dev/hda
- type name length base ( size ) system
/dev/hda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/hda2 Apple_Bootstrap untitled 1954 @ 29302624 (977.0k) NewWorld bootblock
/dev/hda3 Apple_HFS Apple_HFS_Untitled_2 29040416 @ 262208 ( 13.8G) HFS
/dev/hda4 Apple_UNIX_SVR2 untitled 585938 @ 29304578 (286.1M) Linux native
/dev/hda5 Apple_UNIX_SVR2 untitled 10443360 @ 29890516 ( 5.0G) Linux native
/dev/hda6 Apple_UNIX_SVR2 untitled 5328126 @ 40333876 ( 2.5G) Linux native
/dev/hda7 Apple_UNIX_SVR2 swap 1494141 @ 45662002 (729.6M) Linux swap
/dev/hda8 Apple_UNIX_SVR2 untitled 781251 @ 47156143 (381.5M) Linux native
/dev/hda9 Apple_UNIX_SVR2 untitled 10667726 @ 47937394 ( 5.1G) Linux native
/dev/hda10 Apple_Free Extra 262144 @ 64 (128.0M) Free spaceBlock size=512, Number of Blocks=58605120
DeviceType=0×0, DeviceId=0×0
Lovely. Boot into OS X, fire up a terminal window and type in “fdisk -l” to get the list.
That was easy for me to do because it just booted into OS X all of the time. Yaboot’s little menu screen should have appeared, where you can hit “l” to boot into Linux or “m” to boot into Mac OS X, or you can leave it for Ubuntu to start loading by default, but that isn’t what was happening for me. For some reason, Yaboot just wouldn’t kick in.
That was no problem. If Yaboot is a no-show, open up the Mac’s open firmware console. You do this by booting up while holding the Mod + Option + o + f keys. (The Mod of Cmd key is the one with the Apple logo.) This will put you in “Open Firmware” mode. Once you have the console type this:
boot hd:2,yaboot
At least, that’s what I needed to enter. (The hd:2 here just means hda2, where Yaboot is loaded. You can see that hda2 is called Apple_Bootstrap untitled in the fdisk list above).
After I did that it booted up into the Yaboot menu and after a few seconds, by default, Ubuntu started loading. Everything worked fine. Good, now’s the time to fix it so that Yaboot gives you a dual boot option, and you can tweak it a bit while you’re at it. So open up a terminal and run these commands.
sudo yabootconfig
sudo gedit /etc/yaboot.conf
That yaboot.conf is of course Yaboot’s configuration file. Add the following lines to it:
macosx=/dev/hdXX
defaultos=macosx # add this only if you like mac os x to be the default
Save the file. Most instructions say that you now type the following
ybin
This loads the config settings for you. However, this wasn’t enough for me. It worked until I booted into OS X again. After that Yaboot abandoned me, and I had to go into firmware mode again to get it back in the same way I specified earlier. This is the command that makes the Yaboot config settings stick for me.
ybin -b /dev/hda2
Yaboot hasn’t failed me once since I did that.
Here is an example of what else can go in yaboot.conf:
boot=/dev/hdc2
device=hd: # should be an alias check /proc/device-tree/aliases/hd (thanks <sourdough>)
partition=5
root=/dev/hdc5
timeout=50
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot # Adds an entry to boot from a cdromfgcolor=yellow
bgcolor=blueimage=/vmlinux
label=Linux
macosx=/dev/hdc3
The follow is what is presently in my yaboot.conf
boot=/dev/hda2
device=/pci@f4000000/ata-6@d/disk@0:
partition=4
root=/dev/hda4
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
delay=5
bgcolor=white
fgcolor=redmacos=/dev/hda3
image=/boot/vmlinux
label=Linux
read-only
initrd=/boot/initrd.img
initrd-size=8192
append=”quiet splash”enablecdboot
enableofboot
Those last two instructions add two more options to your Yaboot menu at startup, allowing you to also choose whether to boot from a CD or to bring up the firmware console.
The next step is to enable file sharing between OS X and Ubuntu. You should be able to copy from OS X to Ubuntu already. But enabling file sharing in the other direction could be a problem. I was stuck on this for a while.
However, I worked it out. To view the files in the shared partition, do this:
sudo mkdir /media/OSX
And then
sudo mount -t hfsplus /dev/hda3 /media/OSX
My iBook’s /etc/fstab has the following entry so that it is automatically mounted:
/dev/hda3 /media/OSX hfsplus rw,exec,auto,users,gid=31 0 0
Or just go through Administration > Shared Folders and make it a shared folder.
Now, probably, you still will not be able to copy files over to OS X from Ubuntu. So reboot into Mac OS X, then go to Utilities and fire up the Disk Utility program. Select and highlight the OS X disk icon. Now go to menu and under File you will see the Disable Journaling option. Click that to disable journaling. Reboot back into Ubuntu. You should now be able to copy files over to OS X. You can also disable journaling in OS X from the command line in Ubuntu with this:
sudo diskutil disableJournal /Volumes/<OS X Volume Name>
I’ve seen discussions on changing your Linux user uid and gid to match that of OS X to try and access the Mac partition. This also means changing all permissions system wide in to match your new uid and gid. Seems like a big hassle to me.

I’ve heard that Airport doesn’t work, or tweaks need to be done to make it work. It wasn’t so hard for me after I knew how. Finding out how was the hardest part.
What I did, after discovering with the command iwconfig that I had a Broadcom “4306″ card, was to follow the instructions on this site here.
I began at point 1.3, “Using the native drivers,” and did everything down to 1.3.3. I had already set up the details in Network Manager beforehand, when fiddling around, trying to get things to work. All I did after following those instructions was to reboot, and I had wireless up and running.
For now, everything I need is working on my iBook, plus things I don’t need like fancy desktop effects.
I like my iBook even more now.


This one of my old PIII servers, which I still have for backup and for my webcams, but that is definitely not my monitor, so no abuse please.


