5.8/sparc64 - boot from softraid(4) fails?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

5.8/sparc64 - boot from softraid(4) fails?

Alexander Bochmann
I recently tried to install OpenBSD 5.8 on a Sun Fire,
using a RAID-1 softraid as boot device. System doesn't
boot though, and ends up with this:

 > Sun Fire V245, No Keyboard
 > Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 > OpenBoot 4.25.10, 4096 MB memory installed, Serial #67141234.
 > Ethernet address 0:12:33:0:11:aa, Host ID: 8400123a.
 >
 > Rebooting with command: boot
 > Boot device: disk0  File and args: sr0a:/bsd
 > OpenBSD IEEE 1275 Bootblock 1.4
 > >> OpenBSD BOOT 1.7
 > Unknown device: sr0
 > Cannot boot from softraid: Unknown error: code 19
 > Program terminated

As the documentation for booting from softraid on sparc64
feels somewhat sparse, I'm not actually shure I set things up
correctly:

- from the install cd, created disklabels with a RAID
  partition on sd0 and sd1
- assembled softraid with bioctl:

 > # bioctl -c 1 -l /dev/sd0a,/dev/sd1a softraid0
 > sd4 at scsibus2 targ 1 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct fixed
 > sd4: 70004MB, 512 bytes/sector, 143369136 sectors
 > softraid0: RAID 1 volume attached as sd4

(the system has two other disks)

- ran ./install to install OpenBSD to sd4
- rebooted and set boot parameters as per boot_sparc64(8)

Any steps I am missing? Any hints how to further debug this?

Thanks,

Alex.

Reply | Threaded
Open this post in threaded view
|

Re: 5.8/sparc64 - boot from softraid(4) fails?

Stefan Sperling-5
On Sat, Dec 05, 2015 at 09:34:35PM +0100, Alexander Bochmann wrote:

> I recently tried to install OpenBSD 5.8 on a Sun Fire,
> using a RAID-1 softraid as boot device. System doesn't
> boot though, and ends up with this:
>
>  > Sun Fire V245, No Keyboard
>  > Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
>  > OpenBoot 4.25.10, 4096 MB memory installed, Serial #67141234.
>  > Ethernet address 0:12:33:0:11:aa, Host ID: 8400123a.
>  >
>  > Rebooting with command: boot
>  > Boot device: disk0  File and args: sr0a:/bsd
>  > OpenBSD IEEE 1275 Bootblock 1.4
>  > >> OpenBSD BOOT 1.7
>  > Unknown device: sr0
>  > Cannot boot from softraid: Unknown error: code 19
>  > Program terminated
>
> As the documentation for booting from softraid on sparc64
> feels somewhat sparse, I'm not actually shure I set things up
> correctly:
>
> - from the install cd, created disklabels with a RAID
>   partition on sd0 and sd1
> - assembled softraid with bioctl:
>
>  > # bioctl -c 1 -l /dev/sd0a,/dev/sd1a softraid0
>  > sd4 at scsibus2 targ 1 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct fixed
>  > sd4: 70004MB, 512 bytes/sector, 143369136 sectors
>  > softraid0: RAID 1 volume attached as sd4
>
> (the system has two other disks)
>
> - ran ./install to install OpenBSD to sd4
> - rebooted and set boot parameters as per boot_sparc64(8)
>
> Any steps I am missing? Any hints how to further debug this?
>
> Thanks,
>
> Alex.
>

Can you show the output of 'devalias' at the ok> prompt?
If your disks are more than 4 levels deep inside the device tree
then the diskprobe loop in the boot loader won't see them.

If so, the following (untested) diff might fix the problem (adjusting
to an arbitrarily chosen higher recursion level of 10).

The easiest way to try this diff is to build a new release on another
sparc64 system (see man release(8)) and install that.

Alternatively, the following might work as a shortcut:
(If you're unsure about how to follow those steps, building a full
release will be easier!)
Compile all of /usr/src/sys/arch/sparc64/stand/ and run make install in
/usr/src/sys/arch/sparc64/stand/ofwboot, then copy /usr/mdec/ofwboot
onto a httpd server's webspace where a bsd.rd can fetch it from.
Boot the sun fire into bsd.rd and fetch the patched ofwoot to /tmp/.
Now mount your installed system's root partition at /mnt and its
/usr partition at /mnt/usr, and run:
  /mnt/usr/sbin/installboot sd4 /mnt/usr/mdec/bootblk /tmp/ofwboot
to install the patched boot loader.

Index: diskprobe.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc64/stand/ofwboot/diskprobe.c,v
retrieving revision 1.3
diff -u -p -r1.3 diskprobe.c
--- diskprobe.c 9 Dec 2014 18:05:16 -0000 1.3
+++ diskprobe.c 6 Dec 2015 16:47:23 -0000
@@ -110,12 +110,12 @@ void dump_node(int node)
 
 /*
  * Hunt through the device tree for disks.  There should be no need to
- * go more than four levels deep.
+ * go more than 10 levels deep.
  */
 void
 diskprobe(void)
 {
- int node, child, stack[4], depth;
+ int node, child, stack[10], depth;
  char buf[32];
 
  stack[0] = OF_peer(0);
@@ -146,7 +146,7 @@ diskprobe(void)
  }
 
  child = OF_child(node);
- if (child != 0 && child != -1 && depth < 3)
+ if (child != 0 && child != -1 && depth < 9)
  stack[++depth] = child;
  else
  stack[depth] = OF_peer(stack[depth]);

Reply | Threaded
Open this post in threaded view
|

Re: 5.8/sparc64 - boot from softraid(4) fails?

Alexander Bochmann
Hi,

thanks for your answer.

...on Sun, Dec 06, 2015 at 06:02:35PM +0100, Stefan Sperling wrote:

 > Can you show the output of 'devalias' at the ok> prompt?

Will need a couple of days, as the machine is currently at
a friend's place. I'll post an update as soon as I have the
devalias output.

 > The easiest way to try this diff is to build a new release on another
 > sparc64 system (see man release(8)) and install that.

That will need even more time, as I don't currently have
another sparc64 box on 5.8 :) I can probably try that sometime
late next week.

Alex.

Reply | Threaded
Open this post in threaded view
|

Re: 5.8/sparc64 - boot from softraid(4) fails?

Alexander Bochmann
In reply to this post by Stefan Sperling-5
Hi,

coming back to this after some time...

...on Sun, Dec 06, 2015 at 06:02:35PM +0100, Stefan Sperling wrote:

 > Can you show the output of 'devalias' at the ok> prompt?
 > If your disks are more than 4 levels deep inside the device tree
 > then the diskprobe loop in the boot loader won't see them.

I guess that's the reason then:

ok devalias
vx-rootmirr    /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@1,0:a
net            /pci@1e,600000/pci@0/pci@9/pci@0/network@4
net0           /pci@1e,600000/pci@0/pci@9/pci@0/network@4
net1           /pci@1e,600000/pci@0/pci@9/pci@0/network@4,1
net2           /pci@1e,600000/pci@0/pci@a/pci@0/network@4
net3           /pci@1e,600000/pci@0/pci@a/pci@0/network@4,1
cdrom          /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/cdrom@0,0:f
ide            /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f
disk           /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@0,0
disk0          /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@0,0
disk1          /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@1,0
disk2          /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@2,0
disk3          /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@3,0
scsi           /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1
ttya           /ebus@1f,464000/serial@2,80
ttyb           /ebus@1f,464000/serial@2,40
sc-control     /ebus@1f,464000/rmc-comm@2,0
name           aliases

 > If so, the following (untested) diff might fix the problem (adjusting
 > to an arbitrarily chosen higher recursion level of 10).

Ok, I'll try that now.

Alex.

Reply | Threaded
Open this post in threaded view
|

Re: 5.8/sparc64 - boot from softraid(4) fails?

Alexander Bochmann
Hi,

 > ...on Sun, Dec 06, 2015 at 06:02:35PM +0100, Stefan Sperling wrote:
 >  > Can you show the output of 'devalias' at the ok> prompt?
 >  > If your disks are more than 4 levels deep inside the device tree
 >  > then the diskprobe loop in the boot loader won't see them.

Finally got around testing your patch (probably just barely,
as disk0 is the 10. entry in the devalias list, see previous
reply on the list):

 > Rebooting with command: boot disk0 sr0a:/bsd
 > Boot device: /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@0,0  File and args: sr0a:/bsd
 > OpenBSD IEEE 1275 Bootblock 1.4
 > >> OpenBSD BOOT 1.7
 > Can't read disk label.
 > Can't open disk label package
 > sr0*
 > Booting sr0:a/bsd
 > 8311464@0x1000000+3416@0x17ed2a8+209312@0x1800000+3984992@0x18331a0

Thanks!

Alex.

Reply | Threaded
Open this post in threaded view
|

Re: 5.8/sparc64 - boot from softraid(4) fails?

Stefan Sperling-5
On Sat, Dec 19, 2015 at 02:17:53PM +0100, Alexander Bochmann wrote:

> Hi,
>
>  > ...on Sun, Dec 06, 2015 at 06:02:35PM +0100, Stefan Sperling wrote:
>  >  > Can you show the output of 'devalias' at the ok> prompt?
>  >  > If your disks are more than 4 levels deep inside the device tree
>  >  > then the diskprobe loop in the boot loader won't see them.
>
> Finally got around testing your patch (probably just barely,
> as disk0 is the 10. entry in the devalias list, see previous
> reply on the list):
>
>  > Rebooting with command: boot disk0 sr0a:/bsd
>  > Boot device: /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk@0,0  File and args: sr0a:/bsd
>  > OpenBSD IEEE 1275 Bootblock 1.4
>  > >> OpenBSD BOOT 1.7
>  > Can't read disk label.
>  > Can't open disk label package
>  > sr0*
>  > Booting sr0:a/bsd
>  > 8311464@0x1000000+3416@0x17ed2a8+209312@0x1800000+3984992@0x18331a0
>
> Thanks!
>
> Alex.

I've just committed this fix.

Thanks for testing.