PDA

View Full Version : [ubuntu] Adding Ubuntu to Multiboot Drive on PPC G4 DA


motsteve
May 16th, 2009, 09:00 AM
I have a 300G drive (/dev/hdi) with 100 G devoted to a booting distro of Debian
5.04 on the first half of the drive. I want to make the drive multi-boot
with both Debian and Ubuntu sharing the drive. I've tried several different
methods of obtaining this the last of which has been to put on another 100G,
ext3 fsfile partion following the 2G swap partition used in the Debian
installation. I used the root partition from a working installation of
Ubuntu on another drive in my system using the cp -a method of copying and
I also changed the fstab of this copy on the /dev/hdi5 partition to which
it was copied. Below is my present partition map:


/dev/hdi
# type name length base ( size ) system
/dev/hdi1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/hdi2 Apple_Bootstrap bootstrap 1600 @ 64 (800.0k) NewWorld bootblock
/dev/hdi3 Apple_UNIX_SVR2 / 209715200 @ 1664(100.0G) Linux native
/dev/hdi4 Apple_UNIX_SVR2 swap 4194304 @ 209716864 ( 2.0G) Linux swap
/dev/hdi5 Apple_UNIX_SVR2 / 209715200 @ 213911168 (100.0G) Linux native
/dev/hdi6 Apple_Free Extra 201516080 @ 423626368 ( 96.1G) Free space

Block size=512, Number of Blocks=625142448
DeviceType=0x0, DeviceId=0x0


Yaboot Menu items: debian hdg-ubuntu hdb-debian hdi-ubuntu

Note: The fstab file of /dev/hdi5 (root partition) is using /dev/hdi4 as swap.

I also added the Ubuntu item to the yaboot menu using ybin and yaboot.conf.
Using this yaboot menu when starting up, it will boot all my menu items,
but when it tries to load the Ubuntu menu item on /dev/hdi5, it returns the
error message:

"/pci@f2000000/ACARD,6280M@14/@2:5,/boot/vmlinux:Unknown or corrupt filesystem".

Obviously yaboot is working correctly as it launches all the menu items
including this one, but this file system is not to the liking of OpenFirmware
and so it won't boot. I have the same problem trying to start using the menu
pick from the other drives. (Their menu picks also point to the hdi5 partition.)
I have also run the fsck utility app and everything checks fine on /dev/hdi5.

Ideas?:confused:

Steve


System: /dev/hda(30G) = MacOSX10.4.11 /dev/hdb(30 G) = Debian 5.04 /dev/hdg(80G) = Ubuntu 9.04 /dev/hdi(300G) = multiboot
466 MHz G4 DA 1.5G ram DVR-115D

tiresia
May 16th, 2009, 09:51 AM
Sorry, but I get confused reading your post.
How many HD's do you have in you PowerMac?
How many GNU/Linux OS's do you have on your Mac?
Can you please post your file /etc/yaboot.conf?

motsteve
May 16th, 2009, 12:28 PM
Please look at the bottom of my post. I describe each of the four drives I have as well as my basic computer system.

Here is my yaboot.conf:

## yaboot.conf generated by debian-installer
##
## run: "man yaboot.conf" for details. Do not make changes until you have!!
## see also: /usr/share/doc/yaboot/examples for example configurations.
##
## For a dual-boot menu, add one or more of:
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ
## Modified: 5/15/09

fgcolor=yellow
bgcolor=black

boot=/dev/hdi2
device=/pci@f2000000/ACARD,6280M@14/@2:
partition=3
root=/dev/hdi3
timeout=100
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot
macosx=/dev/hda3

image=/boot/vmlinux
label=debian
read-only
initrd=/boot/initrd.img
append="quiet splash"

# This entry automatically added by the Debian installer for an existing
# Linux installation on /dev/hdg3.
image=/pci@f2000000/ACARD,6280M@14/@0:3,/boot/vmlinux
label=hdg-ubuntu
root=/pci@f2000000/ACARD,6280M@14/@0:3
append="root=/dev/hdg3 ro quiet splash"
initrd=/pci@f2000000/ACARD,6280M@14/@0:3,/boot/initrd.img

# This entry automatically added by the Debian installer for an existing
# Linux installation on /dev/hdi5.
image=/pci@f2000000/ACARD,6280M@14/@2:5,/boot/vmlinux
label=hdi-ubuntu
root=/pci@f2000000/ACARD,6280M@14/@2:5
append="root=/dev/hdi5 ro quiet splash"
initrd=/pci@f2000000/ACARD,6280M@14/@2:5,/boot/initrd.img

# This entry automatically added by the Debian installer for an existing
# Linux installation on /dev/hdb3.
image=/pci@f2000000/mac-io@17/ata-4@1f000/disk@1:3,/boot/vmlinux
label=hdb-debian
root=/pci@f2000000/mac-io@17/ata-4@1f000/disk@1:3
append="root=/dev/hdb3 ro quiet splash"
initrd=/pci@f2000000/mac-io@17/ata-4@1f000/disk@1:3,/boot/initrd.img

tiresia
May 16th, 2009, 07:54 PM
Did you format /dev/hdi5 (hdi-Ubuntu) as ext4?
Can you boot Ubuntu on /dev/hdg3 (hdg-ubuntu)?

motsteve
May 16th, 2009, 08:27 PM
It's formatted as ext3 like my other Linux root partitions.

tiresia
May 17th, 2009, 03:23 AM
Can you please try following. Back up yaboot.conf, and then edit the entry of /dev/hdi5, adding root=/dev/hdi5 instead of the Open Firmware Path
I know that it should be same (and that it is given as boot argument), but I noticed a difference between Debian and Ubuntu (and Fedora as well) on this point.
Of course run 'ybin -v' after editing.

motsteve
May 17th, 2009, 04:45 AM
I forgot to answer your previous post about the /dev/hdg3. I can and do launch that Ubuntu (on hdg3) using the yaboot configured menu on /dev/hdi. hdb,hdg, and hdi all have their own New World boot block on their drives and an accompanying yaboot.conf installed yaboot. All three launch their primary distro of Linux contained on them as well as have the ability to launch the distro's on the other drives. The first stage portion of yaboot on all drives launch my MacOSX on /dev/hda also.

As far as the addition of the root=/dev/hdi5 goes, doesn't the line:
append="root=/dev/hdi5 ro quiet splash" do just that?
According to the info I have (yaboot is not very well documented), the append adds more options to the configuration just as if you were putting everything on one line.

tiresia
May 17th, 2009, 05:25 AM
I forgot to answer your previous post about the /dev/hdg3. I can and do launch that Ubuntu (on hdg3) using the yaboot configured menu on /dev/hdi. hdb,hdg, and hdi all have their own New World boot block on their drives and an accompanying yaboot.conf installed yaboot. All three launch their primary distro of Linux contained on them as well as have the ability to launch the distro's on the other drives. The first stage portion of yaboot on all drives launch my MacOSX on /dev/hda also.
Even if you have different Linux Distros on differnt HD's, usually you need only one Apple_Boostrap_Partition (it is a small partition where yaboot is placed). But it can be, that you go that way for other reasons

As far as the addition of the root=/dev/hdi5 goes, doesn't the line: append="root=/dev/hdi5 ro quiet splash" do just that?
According to the info I have (yaboot is not very well documented), the append adds more options to the configuration just as if you were putting everything on one line.
I know that, but as I said, I have noticed that Ubuntu and Debian Installer work a bit different about Yaboot. Please, try as I suggested you. If it does not work, you can always restore your configuration.

About Yaboot you can read a short how-to I wrote some time ago.
http://ubuntuforums.org/showthread.php?t=994882
I guess you now this
http://www.alaska.net/~erbenson/
http://yaboot.ozlabs.org/

Btw, can you please tell me, why are you running 2 Debian and 2 Ubuntu System on one machine. Are they different versions?

motsteve
May 17th, 2009, 08:13 AM
I'll try what you said.

I'm learning Linux and creating and manipulating partitions, files, configurations, etc make for a good learning experience. Books and manuals are fine, but by doing one learns.

I'll let you know what I find out.

motsteve
May 17th, 2009, 08:56 AM
I modified the portion of my config file launching Ubuntu from hdi5 as follows:

# Linux installation on /dev/hdi5.
image=/pci@f2000000/ACARD,6280M@14/@2:5,/boot/vmlinux
label=hdi-ubuntu
root=/pci@f2000000/ACARD,6280M@14/@2:5
# append="root=/dev/hdi5 ro quiet splash"
root=/dev/hdi5
initrd=/pci@f2000000/ACARD,6280M@14/@2:5,/boot/initrd.img

I did a ybin on the config and got the following:

# ybin -b /dev/hdi2 -v

ybin: Finding OpenFirmware device path to `/dev/hdi2'...
ybin: Finding OpenFirmware device path to `/dev/hda3'...
ybin: Installing first stage bootstrap /usr/lib/yaboot/ofboot onto /dev/hdi2...
hcopy: "/tmp/ofboot.eCScOc": write nonexistent logical block (Input/output error)
ybin: An error occured while writing to /dev/hdi2


It didn't like that one change. It is probably due to two root defines being made. I commented out the other root, but got the same error. It could be happy if I changed the whole section concerning /dev/hdi5 and not use the ofpath for anything. I'll put all the lines concerning the device, boot, image, ramdisk and root like is done for the first menu item (Debian, in this case). No matter what, we still have to talk to OpenFirmware.

BTW, thanks for the references. I'll check them out when I get back to all of this later in the day.

tiresia
May 17th, 2009, 10:16 AM
You should edit yaboot.conf as following

# Linux installation on /dev/hdi5.
image=/pci@f2000000/ACARD,6280M@14/@2:5,/boot/vmlinux
label=hdi-ubuntu
#root=/pci@f2000000/ACARD,6280M@14/@2:5
root=/dev/hdi5
append="ro quiet nosplash"
initrd=/pci@f2000000/ACARD,6280M@14/@2:5,/boot/initrd.img


I suggest to use 'nosplash' because the splash image can make some problems on PPC, and you can see what happens during booting
As you did before, you will get an error because you give two values of root.

motsteve
May 17th, 2009, 04:10 PM
Things are taking longer than usual. When I got to my Linux experiment, I redid the .conf file and produced the following:

## This is the config file for the /dev/hdi drive
##
## run: "man yaboot.conf" for details. Do not make changes until you have!!
## see also: /usr/share/doc/yaboot/examples for example configurations.
##
## For a dual-boot menu, add one or more of:
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ
## Modified: 5/17/09

fgcolor=yellow
bgcolor=black

boot=/dev/hdi2
device=/pci@f2000000/ACARD,6280M@14/@2:
partition=3
root=/dev/hdi3
timeout=100
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot
macosx=/dev/hda3

image=/boot/vmlinux
label=debian
read-only
initrd=/boot/initrd.img
append="quiet splash"

image=/boot/vmlinux
root=/dev/hdi5
label=ubuntu
read-only
device=/pci@f2000000/ACARD,6280M@14/@2:
partition=5
initrd=/boot/initrd.img

image=/boot/vmlinux
root=/dev/hdg3
label=hdg-ubuntu
read-only
device=/pci@f2000000/ACARD,6280M@14/@0:
partition=3
initrd=/boot/initrd.img

image=/boot/vmlinux
root=/dev/hdb3
label=hdb-debian
read-only
device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@1:
partition=3
initrd=/boot/initrd.img


This operated the same as the other .conf file, launching all of the distros on the hdb, hdg, and the hdi3 disks. I still received the unknown or corrupt filesystem error message when trying to launch Ubuntu from /dev/hdi5. I think this more or less throws out any chance that the .conf file construction is at fault. There has to be something wrong in the /dev/hdi5 root partition or in the partitioning of the /dev/hdi drive. More exploration is now required.

motsteve
May 17th, 2009, 09:27 PM
With a lot of work and perseverance I've got a working multiboot drive. Since the first four partitions of the hdi drive contained a working distro, I left that alone. I made the last 200G of the drive unallocated. I then used mac-fdisk to create a New World Boot block on hdi5, a 100G root partition on hdi6 and a 2G swap partition on hdi 7. I used mkofboot to correctly format and install yaboot on the hdi5 boot partition. I used mkfs -t ext3 /dev/hdi6 to format the hdi6 partition to accept the files for the root. I also used mkswap to set hdi7 up to be used at the next boot up for the swap area for Ubuntu on hdi6.

Using my hdb drive I made two mount points: one for the Ubuntu partition now working on my hdg drive and one for the empty hdi6 partition. I mounted both partitions with hdg on a point I called old and the hdi6 partition on a point I named new. I then did a "cp -a old/* new" to copy all the files and subdirectories as well as all the symbolic links from the hdg partition to the hdi6 partition. Note: it is good practice if you are copying partitions that you be in an environment where both partitions are idle and not being used at the time. I sometimes use Finnix on CD as it gives me a command line environment and a guarantee that none of my partitions are being used.

After the copy was completed I umounted /dev/hdg3 and used vi to change the /etc/fstab file on hdi6 so that /dev/hdi6 was mounted as / and /dev/hdi7 was mounted as swap. I then unmounted the /dev/hdi6 partition and created a yaboot.conf file on my hdb drive pointing to /dev/hdi6 as primary and all the other distro's as additional menu picks. In my hdb environment I did a:
ybin -b /dev/hdi5 -C newyaboot.conf.file -v,
which configured the yaboot partition for the /dev/hdi6 Ubuntu. I then restarted with the option key down on power up so that I was in the startup manager. I verified that I had four distro's and my MacOSX showing and that when I selected the hdi5 distro icon (that is the one selected as it was just configured) and hit the right pointing arrow key, that I got the right menu. I selected the hdi6 Ubuntu and I was in. I later verified that the other menu picks also picked the other distro's and my MacOSX. Whew!:D

petcarseats
May 18th, 2009, 05:16 AM
Its Nice reading for me !

Dzone