*BSD News Article 16917


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!uwm.edu!ogicse!psgrain!ee.und.ac.za!tplinfm
From: barrett@lucy.ee.und.ac.za (Alan Barrett)
Newsgroups: comp.os.386bsd.questions
Subject: Re: [NetBSD] installing with DOS
Message-ID: <1uvm7l$mdt@lucy.ee.und.ac.za>
Date: 7 Jun 93 19:18:13 GMT
Article-I.D.: lucy.1uvm7l$mdt
References: <1ul119$iof@nz12.rz.unikarlsruhe.de> <S> <C88p8p.2Hy@cvt.stuba.cs>
Organization: Elec. Eng., Univ. Natal, Durban, S. Africa
Lines: 89
NNTP-Posting-Host: lucy.ee.und.ac.za

In article <C88p8p.2Hy@cvt.stuba.cs>,
valo@cvtstu.cvt.stuba.cs (Valo Roman) writes:
> OK, this is approximately what I done , I use pfdisk to create my
> partitions. After installing the files from install 1 floppy to my
> NetBSD partition, my partitions was untouched and I was happy ...
> But when I rebooted the machine from kernel floppy and
> wanted to copy a kernel, fsck said:
> wd0 : can't find disk label (no disk label).
> 
> Seems I'm in trouble again...

This sort of problem happens when you try to install NetBSD in a
partition of a disk whose controller does geometry translation.  I have
not had time to find the bug that causes the problem.  One option is to
disable the geometry translation:  Use ide_conf to find the true
geometry, use the CMOS setup program to tell your BIOS about the true
geometry, and reformat everything.  I successfully did that on one of
my systems.

If you are not able to, or do not wish to, disable the geometry
translation then the following workaround might work for you.  This
requires that the disk have unused space on {cylinder 0, head 0}, from
sector 2 to sector 16.  Almost all DOS disks that I have ever seen
satisfy this condition, because they usually start the DOS partition in
{cylinder 0, head 0, sector 1}, leaving most of {cylinder 0, head 0}
unused apart from the partition sector in {cylinder 0, head 0, sector
1}.  However, many partitioning programs like to hide this fact from
you, and pretend that the DOS partition starts at the front of the
disk; don't believe them until you have checked with a raw disk
editor.

0.  Make sure you have adequate backups.

1.  Use a partition sector editor (fdisk, pfdisk, os-bs, booteasy,
    norton utilities, whatever) to mark the partition that you want
    for NetBSD as bootable with type 0xA5 (decimal 165).

2.  Halt the system.  Boot the NetBSD kernel copy floppy.  When it asks
    you to insert the floppy for the root file system, switch to the
    Install-1 floppy and press enter.

3.  Answer all the installation prompts, using numbers based on the
    translated geometry.  When it asks if you really want to label the
    disk, be brave and say yes.

4.  Halt the system.  Boot to DOS.  Run a disk editor program, such as
    norton utilities.

5.1.  Verify that the partition sector in {cyl 0, head 0, sec 1} is
      undamaged.  Verify that the disklabel program run as part of the
      NetBSD install has written the NetBSD primary boot block to
      {cylinder xx, head 0, sector 1}, written the disk label to {cyl
      xx, head 0, sec 2}, and written the secondary boot program to
      {cyl xx, head 0, sectors 3 to 16}.  ("xx" represents the
      translated cylinder number you chose for the start of the NetBSD
      partiton.  You did choose to start on a cylinder boundary, I
      hope.)

5.2.  Verify that the space in {cyl 0, head 0, sectors 2 to 16} is
      still available.  Copy the fifteen sectors containing the NetBSD
      disk label and secondary boot block from {cyl xx, head 0, sectors
      2 to 16} to {cyl 0, head 0, sectors 2 to 16}.

5.3.  Edit the partition table in {cyl 0, head 0, sec 1}.  Change the
      system ID of the NetBSD partition from 0xA5 (decimal 165) to
      something else (I use 0xA4, decimal 164), but keep it flagged as
      bootable.  This will let you boot to the NetBSD primary boot
      block.

5.4.  Edit one of the previously unused partition table
      entries (I hope you have one), to contain the following
      information: {sys id = 0xA5, boot flag = 0, start
      cylinder/head/sector = 0/0/1, end cylinder/head/sector =
      anything, initial offset = 0, total size = anything}.  
      This will tell the NetBSD primary boot block, or a NetBSD
      system booted from a floppy, that it should look for the
      NetBSD disk label in {cyl 0, head 0, sec 2}.

6.  Halt the system.  Boot the NetBSD kernel copy floppy.  When it asks
    you to insert the floppy for the root file system, just press enter
    without changing disks.

7.  Copy the kernel, and proceed with the rest of the installation as
    per the instructions provided with NetBSD.  It should now work
    because of the trickery with the partition table etc.

--apb
Alan Barrett, Dept. of Electronic Eng., Univ. of Natal, Durban, South Africa
RFC822: barrett@ee.und.ac.za