Subject: Big IDE disks -- install problems
To: None <Havard.Eidnes@runit.sintef.no>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-i386
Date: 09/15/1998 10:10:20
Havard,

The root problem here PC BIOS braindamage.  If you multiply out the
BIOS encodings for C/H/S you'll find it _cant_ represent disks bigger
than about 8G.  That's why the BIOS thinks the disk is only 8Gig.

I think what you need to do is accept an LBA-compatible, bootable,
BIOS geometry, like 2055c/255h/63s, for the MBR, but when you
construct a NetBSD disklabel, factor that down to 16h/63s to keep
Kirk's filesystem happy.

>I suspect that if I could just install with 255h and still use an
>8k/1k file system, nothing of this mess would have happened.

1. You shouldn't be frobbing the BIOS's idea of the geometry.  Going
down that path leads easily to non-bootable disks.

2.  If you mean 255h for the BSD disklabel, then no.  FFS won't let
you _do_ that. Its internal sizing heuristics (I think ultimately due
to the size of offset fields in a cylinder group?) require that you
use a 32k/4k filesystem with cylinder groups that big, even for a
one-cylinder CG. And that may be bigger than FFS supports.

With SCSI we can do a mode-page sense to figure out how many blocks
the disk really has, and then fudge with the gemoetry in the BSD
disklabel to get disklabel entries at least as big as the disk, but
with c/h/s factored down (factor h, divide it by a factor k, multiply
c by k) so that the BSD disklabel "geometry" matches FFS's
1984-vintage ideas of how big a disk is.

I dont know if we can do better for IDE, but maybe we should try.

BTW, I still think the problem is that people talk about "geometry"
without realizing that it means one of two _completely different and
fictitious_ geometries, BIOS or BSD disklabel.  The constraints on
those two fictions are different, and often incompatible.  When people
don't realize that and try and tailor things, all hell breaks loose.
users with reasonably modern hardware.

>Hmm...  I guess my next try will be to install with 255h and with a
>file system layout of 32k/4k to see whether that will work any

I'd try newfs with those parameters on a spare partition somewhere
else first, and see if it actually works. It's been a long time but I
suspect it won't.

>Sorry 'bout the rant, good hints and ideas welcome.

Good rant.  I dont know how to fix it. Short of encoding more
heuristics about FFS internals into sysinst, and fudging with the BSD
disklabel's "geometry" info accordingly, that is.  But that doesnt
help unless we can find the real disk size, and I dont know how to do
that for IDE disks bigger than ~8.5 gig.