Yaboot fails to load from second hard disk on Apple G5

Bug #8136 reported by Joey Stanford
This bug report is a duplicate of:  Bug #18474: ofpath handles SATA disks incorrectly. Edit Remove
10
Affects Status Importance Assigned to Milestone
yaboot (Ubuntu)
Confirmed
Medium
Colin Watson

Bug Description

Howdy!

Installed Warty on my dual G5 tonight. It installed to my 2nd disk. The
install went flawlessly. I rebooted and, unlike with YDL, it went straight to my
OS X disk. So I did the 'hold down option' trick and it found the Linux disk.
I selected the Linux disk and voila, yaboot appears. HOWEVER, when you select
(I think it was L for GNU/Linux) it goes right back to the disk chooser (in
grayscale this time) and just loops.

I did a custom-expert-power4 install and was able to look at yaboot.conf. It
looked fine (would prefer to see a defaultos=macosx which is chosable during the
install instead of that option completely missing). I went in search of ybin to
 force a reload of yaboot and couldn't find it anywhere at which point I hit
#ubuntu and then this bug report.

I'm not sure this is related to bug # 7256 but I'm sure there are some items whic
overlap, at least for this one.

Footnote: I'm headed out from Colorado to Berlin and will be back on the 29th
and can provide more detail then.

Revision history for this message
Colin Watson (cjwatson) wrote :

I think this is quite different from bug #7256, judging from the symptoms you report.

I bet that the first stage bootloader as written to the bootstrap partition has
the wrong path to the second stage bootloader wired into it. From the installer,
could you please:

  * run through the UI up to partitioning (don't finish partitioning, though)
  * change to the second virtual console (Command-F2, Command-Fn-F2, or similar)
  * mkdir /target
  * mount /dev/discs/disc1/part<your Ubuntu root partition number> /target
  * chroot /target
  * mount -t proc proc /proc; mount -t sysfs sysfs /sys
  * ofpath /dev/hdb<your bootstrap partition number>
  * umount /proc; umount /sys
  * exit
  * umount /target

I'd also like to know what kind of disk hardware you've got.

Revision history for this message
Joey Stanford (joey) wrote :

Howdy!

Here are the results:

for me it was /dev/discs/disc2/part3 for linux
my in-linux boot part is /dev/sdc2 and linux is sdc3

ofpath yielded /k2-sata@0/disk@0:2

Checking yaboot.conf revealed that boot=/dev/sdc2 and device=/k2-sata@0/disk@0:

...note that it was 0: and not 0:2. Root was /dev/sdc3

On a whim I added the 2 and this time found ybin, ran it, rebooted, and had the
exact same problems as previously described.

Revision history for this message
Joey Stanford (joey) wrote :

ps.

k2-sata-root:

ATA Bus:

  Name: k2-sata

ST3160023AS:

  Capacity: 149.05 GB
  Model: ST3160023AS
  Revision: 3.05
  Serial Number: 3JS17PXC
  Removable Media: No
  Detachable Drive: No
  BSD Name: disk0
  Protocol: ATA
  Unit Number: 0
  Socket Type: Serial ATA
  bay_name: A (upper)
  OS9 Drivers: Yes

Macintosh HD:

  Capacity: 149.05 GB
  Available: 83.92 GB
  Writable: Yes
  File System: Journaled HFS+
  BSD Name: disk0s9
  Mount Point: /

ATA Bus:

  Name: k2-sata

ST3160023AS:

  Capacity: 149.05 GB
  Model: ST3160023AS
  Revision: 3.18
  Serial Number: 5JS1X730
  Removable Media: No
  Detachable Drive: No
  BSD Name: disk1
  Protocol: ATA
  Unit Number: 0
  Socket Type: Serial ATA
  OS9 Drivers: No
  bay_name: B (lower)

Revision history for this message
Joey Stanford (joey) wrote :

Howdy... more info.

I had some time to test today (I had to cancel my trip to Berlin so I'm all
yours :-)

I compared my successful install on my powerbook G4 with the G5 and, except for
the harddisk info, it was exactly the same.

I then went at ybin and ofpath with the -v and --debug options and found
something interesting.

For my first drive (/dev/sdb) I get something massively different (and more
correctly looking) than for the second drive (/dev/sdc)

I get: /ht@0,f200000/pci@7/k2-sata-root@c/k2-sata@0/disk@0:

So I tried adding that to the device= in yaboot.conf with no luck and I also
forced ybin to use that with the -o option with no luck. The man pages say to
send a tarball with some specific items to the yaboot maintainer but since I
can't actually boot the partition, I can't save anything and get access to it later.

Ideas?

Revision history for this message
Colin Watson (cjwatson) wrote :

I'd be inclined to rummage through /proc/device-tree until you find the correct
path to the disk, drop "/proc/device-tree" from the front of the full path, add
":" to the end, and use that as the value for device= in yaboot.conf.

Is the G5 network-connected? If so, the installer environment has nc, and you
could use that to get data out of it. I'd be interested in seeing the same
things as the yaboot maintainer requests in ofpath(8).

Revision history for this message
Joey Stanford (joey) wrote :

Ok Rummaged. :-)

Recall that /ht@0,f200000/pci@7/k2-sata-root@c/k2-sata@0/disk@0: is what I'm
getting for both /dev/sdb and /dev/sdc

/ht@0,f200000/pci@7/k2-sata-root@c appears to be valid.

/k2-sata@0 appears to be the drive controllers. I have @0 and @1

/disk@0 this may be where the problem lies. There is only @0, there is no @1
for a second disk.

I also recalled that Yellow Dog Linux's yaboot DOES work on this box. I'll
install RC4 when it's released over Ubuntu and report back what it has in there.

Revision history for this message
Joey Stanford (joey) wrote :

Ok, here is what Yellow Dog installed into yaboot.conf. No help here.

[joey@futune]:/Volumes/UNTITLED 1/etc> sudo cat yaboot.conf
Password:
# yaboot.conf generated by anaconda

boot=/dev/sdb2
init-message="Welcome to Yellow Dog Linux! Hit <TAB> for boot options."
partition=5
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
delay=10
enablecdboot
macosx=/dev/sda9

image=/vmlinux-2.6.8-1.ydl.7g5-smp
        label=linux
        read-only
        initrd=/initrd-2.6.8-1.ydl.7g5-smp.img
        root=/dev/sdb3
        append="rhgb quiet"

image=/vmlinux-2.6.8-1.ydl.7g5
        label=linux-up
        read-only
        initrd=/initrd-2.6.8-1.ydl.7g5.img
        root=/dev/sdb3
        append="rhgb quiet"

[joey@futune]:/Volumes/UNTITLED 1/etc>

Revision history for this message
Joey Stanford (joey) wrote :

Ok, more information!

On YDL my entire disks are numbered differently. Recall in Ubuntu they were SDC
but in YDL there are SDB:

[root@localhost joey]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb3 151726620 3230164 140789100 3% /
/dev/sdb5 99150 29028 65002 31% /boot
none 1034812 0 1034812 0% /dev/shm

[root@localhost joey]# /sbin/ofpath /dev/sdb3
/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:3
[root@localhost joey]# /sbin/ofpath /dev/sdb5
/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:5
[root@localhost joey]#

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #8)
> Ok, more information!
>
> On YDL my entire disks are numbered differently. Recall in Ubuntu they were SDC
> but in YDL there are SDB:

I believe this is a separate issue (Bug #7256)

Revision history for this message
Jan-Frode Myklebust (jan-frode-myklebust) wrote :

Just wanted to let you know that I'm hitting this same problem with both Hoary
preview and array 7 on my PowerMac. The installation choices was pretty much all
default.. and I'm installing to disk #2 in the machine. Ripped out the #1 disk,
just to make sure the installer didn't touch my working OS-X.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #10)
> Just wanted to let you know that I'm hitting this same problem with both Hoary
> preview and array 7 on my PowerMac. The installation choices was pretty much all
> default.. and I'm installing to disk #2 in the machine. Ripped out the #1 disk,
> just to make sure the installer didn't touch my working OS-X.

If you changed your disk configuration between installing and booting Ubuntu,
this can interfere with the boot process.

Can you explain step-by-step what you did?

Revision history for this message
Jan-Frode Myklebust (jan-frode-myklebust) wrote :

1. installed new disk drive, and disconnected the old drive containing macosx.
2. Booted the ubuntu hoary preview installer (install-power4), using default
settings, reformatting the full drive.
3. After the first stage of the installation is over, it ejected the CD and
rebooted.
4. Then it starts up again, and shows a small menu stating it just loaded "stage
1" and
   asking if I want to boot GNU/Linux or CD. I hit 'l' for linux, and a small
time-glass-looking
   apple box shows up in the middle of the screen for a while, before it returns
to the same
   "boot gnu/linux or cd" menu. I'm unable to get past this menu.

So, no I didn't change any hardware during installation..

and here's a couple of links to others having the same problem:

  http://ubuntuforums.org/archive/index.php/t-13292.html
  http://www.ubuntuforums.org/showthread.php?t=17419 (just got an email from
Thomas Ferreira stating that he gave up after array4)

Revision history for this message
Jan-Frode Myklebust (jan-frode-myklebust) wrote :

Hope I'm not doing anything wrong, but I didn't see mdz on the CC-list,
you probably wasn't notified of my update, so I'll try assigning it to you
to give you a notify-of-my-update-email..

Revision history for this message
Colin Watson (cjwatson) wrote :

Adding him to the CC list would be better than reassigning the work to him.

Revision history for this message
Jan-Frode Myklebust (jan-frode-myklebust) wrote :

Just tested the hoary rc installer. Same problem.

This time I tried installing ubuntu on the second disk, while also
having the first disk connected. But it didn't make any difference.
Still fails to load stage 2.

Can't understand that you/canonical/ubuntu-developers doesn't take
this more seriously. Isn't this a major bug that needs to be resolved
before releasing hoary final?

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #15)
> Can't understand that you/canonical/ubuntu-developers doesn't take
> this more seriously. Isn't this a major bug that needs to be resolved
> before releasing hoary final?

This is a significant bug, but the unfortunate reality is that our resources
(especially time) are finite, and there are other bugs which affect more users
than this one.

Others have been able to install Ubuntu on Apple G5 systems; it would help to
determine what is different about the systems which exhibit this problem.

Revision history for this message
Jan-Frode Myklebust (jan-frode-myklebust) wrote :

>
> Others have been able to install Ubuntu on Apple G5 systems; it would help to
> determine what is different about the systems which exhibit this problem.

The difference is probably that the others are installing ubunto to the
"primary" disk,
while me (and original bug-reporter) are trying to keep the original macosx-disk
as is,
and install ubunto to a second disk.

Originally I removed the connectors to the primary disk, and tried installing to the
second disk => failure.

Then I kept both disks connected, installing ubunto to the second disk => failure.

Then today I moved the second disk to the position/connectors of the primary disks,
and installed ubunto on it. That worked!

Revision history for this message
Aurelien Naldi (aurelien.naldi) wrote :

I ran into the same problem with hoary RC installer on a G5 system, I managed to
make it boot but it wasn't really painless:
the menu with the choice l for linux, x for macosx... isn't yaboot, it's still
openfirmware and the linux choice should run yaboot at least if it was working

I had to boot in rescue mode on the install CD, mount the newworld boot
partition and edit both the OF script and the yaboot.conf to change paths to the
hard drive.

I don't have acces to this system now (will have it back tomorow) but what I did
look like this:

the bootyaboot command in the OF script: changing
k2-sata-root@c/k2-sata@0/disk@0 to
k2-sata-root@c/k2-sata@1/disk@0

didn't solve the problem, I had to put
/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@1/disk@0

(the full path was avaible in the OF script in the bootmacosx command)

the autogenerated yaboot.conf had the same problem, putting the same
line in it finaly allowed me to boot to the second stage install

I hope this will help a bit...

PS:
of course there are two hard drives in this system, with macosx installed on the
first one, I didn't touch this disk, all linux related partitions (including the
newworld one) are on the second drive

Revision history for this message
Jan Pieter Kunst (greasetrap) wrote :

Bug confirmed with the Hoary installer on my G5: Ubuntu won't boot from the
second hard disk. I can't get to the second stage of the install. Also, the bug
still exists in the Ubuntu 5.10 (Breezy Badger) Colony CD 1.

Revision history for this message
Joey Stanford (joey) wrote :

I spent a few more hours on this tonight just trying to work around the bug so
that others can install Ubuntu on the G5's 2nd disk. Reading the past comments,
I couldn't mount the newworld partition using 5.04 (mount errors) but I was able
to update it in two different ways: The hard way using cat, sed, proc, and ybin,
and the easy way: from within Tiger I did a mount -t /dev/disk1s3 /Volumes/<temp
dir>.

I'm currently using:

boot=/dev/sde2
device=/ht@0,f200000/pci@7/k2-sata-root@c/k2-sata@1/disk@0:
partition=5
root=/dev/sde3
timeout=100
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot
macosx=/dev/sdd9

...as suggest in the previous comments but I still have the same
problem......selecting linux fails.

Not that in the above example there are 5 zeros as opposed to 6. I tried 6 by
accident, didn't work, and put it back to the correct 5....and it still didn't work.

The other problem I've noticed is that ybin isn't updating nvram. I have to
hold the option key down to select the linux disk which then launches yaboot.

Revision history for this message
Javier Pedemonte (jhpedemonte) wrote :

Created an attachment (id=5118)
working yaboot.conf

While installing Fedora Core 4 on a G5, I ran into this same issue. After much
searching, I got it working. Here's my yaboot.conf, hope it helps.

The main thing to get it working seems to be adding the correct "device=" and
"ofboot=" lines. In my case, the drives were at "pci@7", althought some people
seem to have them at "pci@5". Don't know if that's a mistake, but you can
check by running "dev / ls" in OpenFirmware to see your device tree.

Matt Zimmerman (mdz)
Changed in yaboot:
status: Unconfirmed → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

Although this bug was filed earlier, I'm going to mark it as a duplicate of bug 18474, as that one contains a reference to a diagnosis and a patch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.