Subject: Re: Installation from PC Partition
To: None <port-i386@NetBSD.ORG>
From: Jim Howard <jiho@mail.c-zone.net>
List: port-i386
Date: 10/27/1996 20:59:28
At 05:08 PM 10/21/96 -0400, perry@piermont.com wrote:


> mount_msdos does come on the install floppies, so in theory you *can*
> mount the partition (mount it read only!) and copy the stuff off of
> it. However, doing it can be a bit tricky. In pariticular,
>
> 1) You have to make sure that the partitioning is right -- obviously
>    if you haven't preallocated a NetBSD partition already, you lose.
> 2) you have to properly point a NetBSD partition table entry at the
>    DOS partition. I don't quite understand how to do this myself;
>    perhaps someone here will volunteer the data.

I believe this depends on where your DOS partition is relative to your
NetBSD partition.  I only know the case where both are on the same drive,
and that's what I describe here....

With the current i386 installation scheme -- that is, with installation
identical for all ports -- you can do *most* of the installation from your
DOS partition, but only after first installing the base binary set from
floppies.

This catch-22 arises because you must edit your NetBSD disklabel to
reference the DOS partition, and the edit uses vi, which is in the base
binary set but not on the install floppies.  (Anyway, that's how it was when
I did this.)

This is the procedure:

1.  Locate all the sets you want to install (after the base binary
    set) somewhere in your DOS partition.

2.  Install the base binary set from floppies (I recall about 5
    or 6).

3.  Run 'fdisk /dev/r[x]d', where [x] is your drive (e.g., sd0).
    Write down the offset and size (both in sectors) of your DOS
    partition.

4.  Run 'disklabel -e -r /dev/r[x]d'.  This brings up vi with your
    NetBSD disklabel as the text to edit, basically.

5.  Using vi's appalling methods, change the line that reads:

       4 partitions

    to read:

       5 partitions

    and add a line at the bottom which reads:

       e: [size] [offset] MS-DOS

    where [size] and [offset] are the values (in sectors) you got
    from fdisk in step 3.

6.  Save and quit vi.  I've blissfully forgotten how you do that.

7.  Run 'mkdir /[name]', where [name] is whatever you want to call
    your DOS mounting point.

8.  Run 'mount -t msdos /dev/[x]e /[name]'.  (Insert the read-only
    option, '-oro', at your discretion.)

9.  Add a line in /etc/fstab which reads:

       /dev/[x]e /[name] msdos rw 0 0

    Your DOS partition will henceforth be mounted automatically
    when you boot NetBSD.

10. Install the sets you located in your DOS partition in step 1.
    For each set, run Set_tmp_dir and enter the path to the set,
    then run Extract on the set.  For example:  If DOS is mounted
    at /dos, and the next set has the DOS path C:\NETBSD\[NAME]\,
    tell Set_tmp_dir to use '/dos/netbsd/[name]' and then run
    'Extract [name]'.  (This assumes you retain the standard set
    directory and file naming scheme.)

FreeBSD 2.x has a very nice, curses-based fdisk/disklabel subsystem in its
installation program sysinstall (compiled from C).  If you have FreeBSD 2.x
install floppies, you can use their fdisk/disklabel step to prepare your
drive (including access to your DOS partition), then bail out of their
installation, clean up the resulting BSD partition, and proceed to install
NetBSD instead, starting at step 7 above.  I've done this and it works fine.

The last time, however, I just did a full floppy install.  Less stressful
than either of the above, but more time-consuming.

Finally, the InfoMagic "BSDisc" has instructions for installing NetBSD
directly off the CD-ROM.  You basically just mount the CD-ROM device and go,
like steps 8 and 10 above.  I've done this successfully.  It seems like that
*ought* to work for a hard drive *if* your DOS partition and NetBSD
partition are on *different drives*, but I haven't tried that.


> I also seem to remember another gotcha -- if your kernel isn't
> entirely in the section of an IDE drive that is visible to the BIOS (I
> believe it has to be before the 1024'th cylinder), you lose because
> the boot blocks use the BIOS to load the kernel.

This is true when the drive subsystem lacks geometry translation.  There's
no problem with the typical SCSI adapter, but I don't know about IDE.  I
believe many newer IDE drives have geometry translation, but don't ask me
how to know or make sure it's switched on.

With translation, during installation you just feed NetBSD the translated
geometry -- same as DOS sees, as reported by DOS's FDISK -- rather than the
drive's native geometry.


--Jim Howard
  jiho@mail.c-zone.net