Subject: Re: Bootblocks ignore partition for kernel (plus LFS fun)
To: Andrey Petrov <petrov@netbsd.org>
From: David Brownlee <abs@netbsd.org>
List: port-sparc64
Date: 04/03/2003 23:13:19
On Tue, 1 Apr 2003, Andrey Petrov wrote:

> On Mon, Mar 31, 2003 at 12:07:07PM +0000, abs@mono.org wrote:
> >
> > 	At the 'Boot:' prompt given directly after 'boot -sa' it does not
> > 	appear to matter which partition is given the boot blocks always
> > 	try to load the kernel from 'a:'.
> >
> > 	eg: both of the following try to load a kernel from a:
> >
> > 	    Boot: /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:a/netbsd
> > 	    Boot: /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:h/netbsd
> >
>
> I'd try 'boot disk0:h -sa' to see if taht makes any difference, also
> you can build ofwboot with debugging prints to see what it actually
> does.

	No difference (assuming you have run installboot against sd0h).
	Will try the debugging printfs.

> > 	In order to get the kernel to boot with an lfs root I needed to
> > 	have a small ffs 'a' partition and the real root on 'e', then
> > 	'boot -a' and manually enter the root device (This could be
> > 	avoided with a custom kernel), but then the root device is not
> > 	accessible:
> >
> > 	    # fsck
> > 	    /dev/sd0e (Bad file descriptor)Can't stat /dev/sd0e
> > 	    /dev/sd0e (Bad file descriptor)Can't stat /dev/sd0e
> > 	    Can't stat /dev/sd0e: Bad file descriptor
> > 	    ** /dev/rsd0a
> > 	    ** File system is clean; not checking
> > 	    # ls -l /dev/sd0*
> > 	    ls: /dev/sd0e: Bad file descriptor
> > 	    brw-r-----  1 root  operator  7, 0 Mar 31 11:44 /dev/sd0a
> > 	    brw-r-----  1 root  operator  7, 1 Mar 31 11:44 /dev/sd0b
> > 	    brw-r-----  1 root  operator  7, 2 Mar 31 11:44 /dev/sd0c
> > 	    brw-r-----  1 root  operator  7, 3 Mar 31 11:44 /dev/sd0d
> > 	    brw-r-----  1 root  operator  7, 5 Mar 31 11:44 /dev/sd0f
> > 	    brw-r-----  1 root  operator  7, 6 Mar 31 11:44 /dev/sd0g
> > 	    brw-r-----  1 root  operator  7, 7 Mar 31 11:44 /dev/sd0h
> > 	    #
> >
> > 	This is a little more than bizarre. Netbooting the bootblocks
> > 	and kernel and specifying the root partition as sd0e results
> > 	in fsck panicing with:
> >
> > 	    Stopped in pid 9.1 (fsck) at sys_statfs+0x54: ldx [%i0 + 0 x10], %o0
> > 	    db> trace
> > 	    syscall(1133bed0, 9d, 0, 112f1300, 4052fb78, 4052fb74) at
> > 	    syscall+0x344
> > 	    syscall_setup(ffffffffffffdc6d, ffffffffffffcbf0, 212000, 406e0a80,
> > 	    0, 0) at syscall_setup+0xe8
> >
> > 	Netbooting with nfs root and mounting sd0e somewhere else works fine.
> >
>
> This deserves a PR.

	Oh yes :)

-- 
		David/absolute          -- www.netbsd.org: No hype required --