Subject: disk basics (i386)
To: None <netbsd-users@netbsd.org>
From: Jim Breton <jamesb-netbsd@alongtheway.com>
List: netbsd-users
Date: 01/06/2002 09:16:15
Howdy, I just installed 1.5.2 on an x86 system with a ~405 MB IDE disk.
The installer handled all the drive geometry for me so that was not an
issue.

This is not my first installation of NetBSD, but it was my first time
_adding_ a disk to an already-installed BSD system, and I was muddling my
way through it.  I seem to have learned a few things about disks in the
process but a few questions remain.

The IDE disk is wd0, the disk I added was a scsi disk, sd0.  At the end
of this message I will paste a bunch of (slightly snipped) info to which
I refer in my questions.

The questions are:

Why does the installer appear to use the last "DOS" partition on the
drive, rather than the first?  (Partition 3 rather than 0.)

Why does the NetBSD geometry disagree with the BIOS geometry?  Is this
to deal with BIOS limitations (with which I'm familiar, but I wasn't
aware of _how_ OSes "worked-around" them)?

When I fdisked sd0, I wasn't sure at first what to specify as the
"size."  After a while I figured out it's the cyls * sec/cyl (- offset
if you need one for an MBR IIUC).  But, I wasn't sure which idea of the
geometry I should use -- the NetBSD one, or the BIOS one.  So to be on
the safe side I went with the NetBSD geometry since it was a bit smaller
in total sectors (better to guess on the small side than on the large
side); however the installer seems to have gone with the BIOS geometry:
838*92-62=831234.  How do I know which one to use?

Thanks!  Btw if anyone has any URLs that might help in understanding all
this, I'd love to read them.


Pertinent info:

# grep wd0 /var/run/dmesg.boot                                                 
wd0 at pciide0 channel 0 drive 0: <Conner Peripherals 425MB - CFS425A>
wd0: 406 MB, 839 cyl, 16 head, 62 sec, 512 bytes/sect x 832288 sectors

# grep sd0 /var/run/dmesg.boot  
sd0 at scsibus0 target 4 lun 0: <CONNER, CFP1080S, 3939> SCSI2 0/direct
fixed
sd0: 1030 MB, 3658 cyl, 6 head, 96 sec, 512 bytes/sect x 2110812 sectors

# fdisk wd0
NetBSD disklabel disk geometry:
cylinders: 839 heads: 16 sectors/track: 62 (992 sectors/cylinder)

BIOS disk geometry:
cylinders: 838 heads: 16 sectors/track: 62 (992 sectors/cylinder)

Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 169 (NetBSD)
    start 62, size 831234 (405 MB), flag 0x80
        beg: cylinder    0, head   1, sector  1
        end: cylinder  837, head  15, sector 62

# fdisk sd0 
NetBSD disklabel disk geometry:
cylinders: 3658 heads: 6 sectors/track: 96 (576 sectors/cylinder)

BIOS disk geometry:
cylinders: 1015 heads: 33 sectors/track: 63 (2079 sectors/cylinder)

Partition table:
0: sysid 169 (NetBSD)
    start 0, size 2107008 (1028 MB), flag 0x0
        beg: cylinder    0, head   0, sector  1
        end: cylinder 1013, head  15, sector 36
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>