Subject: Re: Two NetBSDs on one (i386) drive
To: None <tech-kern@netbsd.org>
From: David Laight <David.Laight@btinternet.com>
List: tech-kern
Date: 12/19/2001 22:32:08
> > > If we recognize more than one NetBSD partition on a disk, that means
> > > more than one disklabel.  Wouldn't that cause a bunch of problems?  For
> > > example, how do I write the second disklabel when I've booted from the
> > > first partition?  I would find it confusing because now there are two
> > > different NetBSD views of the disk (i.e. the meaning of "wd0a" depends on
> > > which partition you booted from - what if you boot from a floppy?)

There seems to be space before any bsd partition for a disklabel
(and pbr).  It isn't that difficult to put the disklabel before a
second partition.  I guess you'd get very confused if the layouts were
different - especially while setting it up.

I've loaded the pbr from a second partition - but it re-read itself
from ptn 0. 
> >
> > Isn't the disklabel inside the NetBSD partition on i386?  e.g. at offset
> > xyz from the start of the partition, not the start of the disk?
It's in sector 2 of the partition, following the pbr, and is followed by
the rest of the second (nth) level bootstrat (the one that loads boot).
> 
> Exactly!  That is why I think having more than one NetBSD partition could
> cause problems and confusion.  I still don't understand the need for being
> able to boot from more than one NetBSD partition on the same disk (since
> you could just use one boot partition, one bootloader and different
> root/data partitions for the seperate systems).

OK, so how do I tell the bootloader to pull in a different filesystem,
and how does the kernel find its root filesystem.
(Maybe I'll boot netbsd again and re-read the man page.)

Anyway I now have another mbr_bootsel code that will pass the start sector
through to the next level.  It is also smaller again, and can get some of
the error retry loops back (since it is none-destructive).
(editing that code makes my brain explode - and I haven't trashed a boot
block yet)

    David