Subject: Re: two NetBSD partitions
To: None <tlaronde@polynum.com>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 12/20/2006 21:14:47
On Wed, Dec 20, 2006 at 03:27:22PM +0100, tlaronde@polynum.com wrote:
> On Wed, Dec 20, 2006 at 01:27:21PM +0800, Feng Yu wrote:
> > Hello tech-userlevel,
> >      How to install two NetBSD into two partitions in one disk? When I try to make two NetBSD partions, sysinst can't find any one.
> 
> The layout of the disks may differ from one machine to another.
> 
> I will make the assumption that you are trying an install on some i386
> flavor.
> 
> The answer is then: you can't or, at least, you can not easily.

You really want to check your facts before spouting.....

> On i386, only one disklabel is used. If, with fdisk(8), you create
> several slices flagged NetBSD, the disklabel will be put in the area of
> the first NetBSD slice, and the code will use this one.

Nope, the same disklabel gets written to the start of ALL the type 169
mbr partitions.
 
> This means that you can't create two slices flagged NetBSD with fdisk(1)
> and hope that they are really independant: they will share the
> disklabel.

True....  having 2 different disklabels for the same disk is a good way
to cmompletely destroy teh contents.

> Consequence: if you install a NetBSD into the second fdisk
> slice flagged NetBSD and, later, decide to suppress the first one (where
> you think nothing at all is installed), you may destroy the disklabel
> that was indeed in the first slice.

No, the labe is in the other one as well.

> Knowing this, you can install a second NetBSD, but this means
> configuring a kernel with a root partition explicitely set to something
> else than the 'a' partition (since there is only one disklabel used, the
> 'a' is probably not where you want a second install to have its root),
> you have to put into the disklabel all the partitions of the second
> slice, and you can probably not use normal install program since this is
> definitively not a standard installation (and not the way partitionning
> was intended: a slice dedicated to NetBSD, and only one slice).

No again.
Provided you use the netbsd mbr_bootsel (or mbr_lba) code you can use
it to boot different mbr partitions which contain a bootable root
filesystem at the start of the partition.

You can also just intercept the /boot timeout and type 'boot hd0h:netbsd'
or similar to make partition 'h' (of the netbsd disklabel) root.

Actually if you get sysinst to do the partitioning for you, it should
'just work' (tm).

	David

-- 
David Laight: david@l8s.co.uk