Content Cleanup Required
This article should be cleaned-up to follow the content standards in the Wiki Guide. More info...

Configuring a Macintosh PowerPC computer for dual boot using yaboot & troubleshooting loss of the yaboot menu

Running Multiple OSes on one computer

When you install Ubuntu (or any GNU/Linux) onto your "NewWorld" Apple Macintosh PowerPC G3, G4 or G5 computer you can choose to boot between two or more operating systems. Ubuntu installs a "boot loader" called yaboot (Yet Another BOOTloader) to allow you to select which OS you'd like to boot.

Note: Newer G3, G4 or G5 Macintoshes provide an alternate method to choose which OS boots. Hold down the option key when you turn on or restart your computer and you will be presented with a list of the operating systems installed on your computer.

If you only have Ubuntu installed on your computer, yaboot loads the "kernel" and gets things started. However, if you also have Mac OS (8 or 9) and/or Mac OS X installed yaboot allows you to choose which OS you'd like to boot into.

Setting which OS yaboot automatically loads

After you install Ubuntu you will encounter a list of operating systems when you turn on or restart your computer, and, unfortunately for "newbies", Linux is set as the default. yaboot is the application that controls this list and the list will look something like this (Note: there will be variations determined by what operating systems are installed on your computer):

 l - linux
 m - macos
 x - macosx
 c - cdrom

If you wait a few seconds, linux is automatically selected and you boot into Ubuntu. Fortunately, it is possible to change which OS is automatically selected. If you are using the computer in a multi-user environment and the other users prefer Mac OS X you can (easily) configure yaboot to automatically load Mac OS X or OS 9 instead of Ubuntu.

To configure yaboot you will have to be at a command line in Ubuntu. From Ubuntu's graphical environment (GNOME) select Terminal from the menu Applications:System Tools, or use a non-graphical command line that you can activate with the keypress, control-alt-F1.

Note: If you use ctrl-alt-F1 (or any of the F1-F6 terminals) you can return to the graphical GNOME interface by pressing ctrl-alt-F7. If you really get stuck you can type sudo reboot to cleanly restart the computer.

You can use nano to edit the yaboot.conf file found in the /etc directory. They are simple and easy-to-use non-graphical text editors. Of course, you can use gedit too.


sudo cp /etc/yaboot.conf /etc/yaboot.conf.backup
sudo nano /etc/yaboot.conf

Note: sudo is short for 'super-user do' or 'substitute-user do' and allows you to modify anything. cp tends to make a backup for security. If you want to use gedit, just replace nano with gedit and sudo with gksudo.

You will be prompted for your password. Enter it. Note: you must also have "administrator" priviledges to be able to do this. You will have these if you are using the same account that you created when you installed Ubuntu.

Scroll down to the line that looks like:


Or, if you want to add a Mac OS 8 or 9 boot option:


Where x (this x refers to the x in hdxn, not in macosx) is a letter (usually a, b, c or s) and n is a number, likely between 9 and 12.

If you don't have a macosx or macos section, you'll need to know which partition your Mac OS is on. To find out, open a terminal and run "sudo mac-fdisk -l". Look for a partition that has a line like this:

/dev/hda3 Apple_HFS Apple_HFS_Untitled_2 20709376 @ 262208   (  9.9G)  HFS

Obviously, the number of gigs, and the block numbers may be different, but this is your Mac OS partition. In this case OSX is on /dev/hda3 so you would need to add a line "macosx=/dev/hda3" to your yaboot.conf. It can be at the beginning or end of the file.

After it, insert another line that reads:




I hope nobody else makes this stupid mistake like I did. I got confused with Grub, I typed in default=macosx in the process, instead of defaultos=macosx. when I try to reboot it won't boot up. Couldn't find a way to get back to Ubuntu to fix yaboot, so I ended up reinstalled Ubuntu all over again to save time. Thankfully not thing bad happen to my Mac partition.

Press ctrl-x to exit nano and follow the on-screen instructions to save your modifications. (If you use gedit, press ctrl - s or click the save icon, then close it.)

Changing how yaboot chooses the default OS

You must now make these changes permanent by running the ybin application from Ubuntu.

At the command line run the following command:

sudo ybin -v

If prompted for a password, enter it. Your bootloader should now be configured according to your wishes and is ready for action. Restart your computer and wait briefly (<30 seconds). If Mac OS (X) boots, then you did things right. If it doesn't, chances are you'll boot into Ubuntu anyway.

If things don't work the way you think they should, don't panic. You should still be able to get to Mac OS 9 or X by holding down the option (alt) key when you restart your computer. This trick will only work on G4s, G5s and on the [PowerBook G4 1.5 MHz 17"] G3 "2000" ("Pismo", "[FireWire - IEEE 1394 - iLink]"), slot-loading iMacs and newer G3 iBooks.

On some machines, trying to boot Mac OS 9 by pressing 'm' at the yaboot prompt gives a blinking floppy disk icon. This is because the Ubuntu installer is not quite perfect and alters the Mac OS 9 drivers for the hard disk; the data on the partition is still safe. To fix this, start up from the Mac OS 9 install CD and open /Utilities/Drive Setup. Select the hard drive where your Mac OS 9 partition is, and select "Update Driver" from the "Functions" menu.

I glossed over a few concepts (e.g. yaboot itself doesn't do all of the stuff I ascribed to it) and I am no expert on configuring GNU/Linux so I suggest that your also read the man pages for the relevant applications and configuration files.

At the command line type the following to learn more:

man yaboot.conf
man yaboot
man ybin

You lost the yaboot menu! Now what?

You used to see the yaboot menu whenever you turned on your computer and now all it wants to do is boot into Mac OS? This (probably) happened because you set a Mac OS partition as the startup disk using Startup Disk.

If all you want to do is access files on your Linux partition and not run the Linux OS, I suggest you check out the Ext2FS Mac OS X tool at http://sourceforge.net/projects/ext2fsx/.

If your yaboot menu partition exists before all other bootable partitions (Mac OS, Mac OS X, *BSD, etc.) all you have to do is reset the PRAM by holding down the following keys while you restart the computer: command-option-P-R. Make sure you keep holding them until your computer restarts again (<15 seconds)! Your computer will now boot into the yaboot menu again.

If Ubuntu is NOT on your FIRST partition, hold down Option (alt) at boot and choose to boot from your ubuntu partition. Once you are logged in run

sudo ybin

from a terminal.

For details see http://www.fixstars.com/en/technologies/linux/support/solutions/ydl_general/reset_boot/ .

Remember: If you use the "Startup Disk" control panel (Mac OS 9) or preferences pane (Mac OS X) you will disable the yaboot boot process and will not be able to use your Linux partition until you "reactivate" the yaboot boot process.

From the terminal in Mac OS X

Added by: nic_fox 03/11/2007

You may have tried unsuccessfully to run the ybin application from Mac OS X's Terminal. The main sticking point is that the device name is not recognised from the yaboot.conf file or even if you specify it using the -b option. Perhaps there is a way, but I have not discovered it. Also, some of the older 'new-world' Macs do not support the use of the option key at startup to select the a bootable partition. In this case another approach is required to reactivate the yaboot process on these machines.

Before you start messing with these things, you should make a note of the current nmvram settings in case you need to restore them, so note/copy/save the output of the following OS X Terminal command:

nvram -p

just in case you need to refer to the values later in order to restore them.

By using the Terminal in Mac OS X to reset the nvram environment value for the boot-device you should be able to get your yaboot menu back at startup. On my mac this requires typing:

sudo nvram boot-device=bridge/ADPT,2940U2B@4/@2:12,\\:tbxi

This shows the open firmware alias 'bridge' (which aliases the lengthier path /pci@80000000/pci-bridge@d), the name of the pci card (/ADPT,2940U2B@4), the correct device and partition numbers for yaboot on this machine (/@2:12 which means disk 2, partition 12) and finally the name of the Tool-Box ROM Image (,\\:tbxi). The device names can vary quite a bit depending on your hardware, so how do you find out what the boot device should be for your computer? Well it should be available in the yaboot.conf file which you can find at /etc/yaboot.conf. If you need to mount the disk/partition containing the Ubuntu installation so that the OS X Finder can reach the /etc directory use ext2fs (which as noted above is available from http://sourceforge.net/projects/ext2fsx/).

For your peace of mind you may wish to find out the location of your Apple Bootstrap partition(s), so use:

diskutil list


sudo pdisk

and type 'L' for your top level command at the pdisk prompt.

Either of these commands will generate a listing which will have an entry for 'Apple_Bootstrap' with the corresponding partition number and disk details. If you have several bootstrap partitions listed, then either try to deduce which one is the one set up for use by Ubuntu, or simply use trial and error. Once you have figured out a successful command to correctly set the nvram boot-device value, you can save it somewhere safe and run it if your yaboot menu goes missing again. Many thanks to xurios and his helpful posts at the following thread: <http://ubuntuforums.org/archive/index.php/t-174663.html>. nic_fox 03/11/2007

Please feel free to modify this Wiki to fix any errors, improve it, etc.

Sincerely, Eric Dunbar.

YabootConfigurationForMacintoshPowerPCsDualBoot (last edited 2014-05-10 06:12:59 by host-92-29-174-199)