Subject: Re: NetBSD and FreeBSD co-existing
To: None <jonathan@DSG.Stanford.EDU>
From: Chuck Cranor <chuck@dworkin.wustl.edu>
List: port-i386
Date: 06/22/1997 19:58:11
>>Thinking about it now, I don't think I've ever installed a dual boot
>>NetBSD system (NetBSD and DOS) where the NetBSD partition was the first
>>on the disk (previously DOS has always been first, and I've noticed that
>>typically DOS partitions start on the 2nd track).

>I have never, ever gotten this to work, and (as you know:) I'm pretty
>persistent with such things.  


hi-

	i've a number of systems that have dos, netbsd, and freebsd
installed on the same boot disk.  i set it up that way a year or two
ago and it is pretty easy to do once you figure out the easy way of
doing it.   the main problem is that only one fdisk partition can
have ID 165 at a time.   so if i want to switch from one BSD to the
other I have to boot DOS and run a simple batch file that runs pfdisk
and swaps which BSD fdisk partition has the magic 165.

	i believe life would be easier for multi-BSD os people if 
netbsd choose a new fdisk ID number to use.   for example, the openbsd
i386 boot process first looks for a "166" partition, and if it can't 
find a 166 fdisk partition then it falls back to 165 (for backwards
compat.)

	anyway the install process i use for this sort of thing goes
like this:
 [1] use DOS fdisk to delete all fdisk partions and setup the new
	dos partion.  format and install DOS/windows in it.
 [2] use DOS fdisk to create an extended dos fdisk partition for freebsd
     and then use pfdisk to change its ID to 165
 [3] use freebsd boot floppy to install freebsd the usual way
 [4] use DOS fdisk to create an extended dos fdisk partition for netbsd.
     and then use pfdisk to change its ID to 165.     then use pfdisk to
     change the ID of the freebsd fdisk partition to anything other than
     165 (you don't want to confuse the netbsd bootup).
 [5] use freebsd boot floppy to create netbsd filesystems, and then
     abort the freebsd install when it goes to start ftp'ing the files.
     (why?  because freebsd install program can create netbsd filesystems
      and you don't have to worry about cyl or sector numbers... the freebsd
      user interface handles it for you).
 [6] after aborting the freebsd install, boot the netbsd boot disk
     to the single user prompt (don't worry with the netbsd install
     shell scripts).  fsck and mount the filesystems freebsd
     boot just created.   "rm -rf" all freebsd files from them.
 [7] ftp the netbsd tar files, unpack them in the correct places.
     make sure /dev is populated, make sure there is a kernel installed
     in /, and install bootblocks (either with disklabel or installboot).
 [8] boot netbsd off hard disk and configure the rest of /etc.

once that is done you can set up the disklabel so that DOS and freebsd
can be mounted and you end up with something like this;

Filesystem          1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd0a               39152    19882    16136    55%    /
/dev/sd0e             1439576   607306   717102    46%    /usr
/dev/sd0f              208592    81728   126864    39%    /dos
/dev/sd0g               31775    14016    15217    48%    /emul/freebsd
/dev/sd0h              160002    65231    81970    44%    /emul/freebsd/usr


to switch which BSD has id 165 i use the following sort of DOS
batch files:

far-superior> cat netbsd.bat
@echo off

type c:\dos\netbsd.pfd | pfdisk 0

echo set for netbsd

far-superior> cat netbsd.pfd
2 164 26 63
3 165 64 260
w
q
far-superior> cat freebsd.pfd
2 165 26 63
3 164 64 260
w
q
far-superior> 


works for me....

chuck