Subject: Re: NetBSD and FreeBSD co-existing
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Duncan McEwan <duncan@mcs.VUW.AC.NZ>
List: port-i386
Date: 06/22/1997 22:47:54
Jonathan (jonathan@DSGStanford.EDU) said:

> I have never, ever gotten this to work [...]

OK -- I've got a little further now, but am still not sure what is going on!

A couple of responses I got to my message suggested that the NetBSD install 
might have trouble with two partitions of type 165.

Since I had to reinstall my FreeBSD system, I did it at the start of the
disk.  Then before doing the NetBSD install, I temporarily changed the type
of the FreeBSD partition from 165 to 6, and created another partition covering
the 2nd half of the disk, with type 165.

The installation of NetBSD seemed to go OK, and when it was done, but before
trying to reboot, I used it's fdisk to change the freebsd partition back to
type 165.

The result was that I was still able to boot the FreeBSD system, but when I 
tried booting NetBSD the machine hung (before the NetBSD bootblocks had printed
anything).

But then, when I changed the FreeBSD partition type to 6 again, I was able
to boot NetBSD OK.  So perhaps the NetBSD bootblocks don't like two 165
partitions?

I'm not sure whether any of my other changes (switching the order of the
FreeBSD and NetBSD partitions on the disk, or having the first partition
skip the first track of the disk) made any difference.  I'll experiment 
somemore.  If I redo the installations with NetBSD first on the disk again, 
that might keep it's boot blocks happy, and I'll see how FreeBSD copes with 
being 2nd on the disk...

> Did you get a warning about `Erase the previous contents of the disk'
> from disklabel?  It *really* means that; it's about to overwrite the
> MBR with its own DOS bootrecord, tossing away any MBR partitions you
> might have. 

I did see this on one of the installs I did, but I've done quite few recently,
while trying to get this to work that I don't remember the exact circumstances 
:-(

I have also seen it in the past when I've been doing more "traditional" dual
boot DOS/NetBSD installations.  From what I remember from looking at the
disklabel code back then, it printed this message when it found that the 
geometry of the DOS partition table with type 165 didn't agree with the 
geometry of the 'c' partition in the NetBSD disklabel.  Hmm, I can see how
having two type 165 partitions could cause problems here!  I'm not sure whether
the current disklabel still does this (or whether my memory of the older
disklabel code is correct!).

> UTSLing, I *think* maybe the right way to do this is to write the
> label and bootblocks to the C partition, not the D partition.  Which
> did you use?

I don't know -- whatever the install for 1.2G snapshot uses...

Duncan