Subject: Re: i386 + cylinder boundaries
To: Garry Dolley <garry@linuxstart.com>
From: Pierre Bourgin <Pierre.Bourgin@lip6.fr>
List: tech-install
Date: 01/09/2000 15:40:25
On Sun, 9 Jan 2000, Garry Dolley wrote:

 > I successfully installed and configured NetBSD 1.4 on my Pentium III
 > 450Mhz w/ two IDE disks.  I installed it on the first IDE disk which is
 > 27 Gigs and put it in the 3rd primary partition.  Everything went A-OK
 > :)  Trouble is, I've been reinstalling NetBSd to try to get it to end
 > it's partition on a cylinder boundary so Partition Magic and Linux LILO
 > won't complain.  I'm not so concerned with Lilo, but Partition Magic
 > won't even start it if detects a partition does not end on a cylinder
 > boundary.  SOO.. my question is, how should I go about calculating where
 > I need to end my netbsd partition to achieve the results I want?  Thanks
 > for the help guys..

Notice I'm not very shure to tell the really truth....

As I remember, NetBSD/i386 is abble to use the _real_ goemetry of
a disk (number od Cylinder/Head/Sector), but win* and Linux uses
the C/H/S values from the BIOS.

So you can end a partition on the _real_ end of a cylinder, but
that won't necesseraly the end of a 'BIOS' cylinder.

for example, my disk is wd0:

$fdisk wd0
NetBSD disklabel disk geometry:
cylinders: 13328 heads: 15 sectors/track: 63 (945 sectors/cylinder)

BIOS disk geometry:
cylinders: 784 heads: 255 sectors/track: 63 (16065 sectors/cylinder)

Partition table:
0: sysid 6 (Primary 'big' DOS, 16-bit FAT (> 32MB))
    start 63, size 4096512 (2000 MB), flag 0x0
        beg: cylinder    0, head   1, sector  1
        end: cylinder  255, head   0, sector  1
1: sysid 169 (NetBSD)
    start 4098465, size 8496495 (4148 MB), flag 0x80
        beg: cylinder  255, head  30, sector  1
        end: cylinder  784, head   0, sector  1
------
So the DOS partition ends at (63+4096512) = 4096575 sectors
4096575 is a multiple of 16065 (16065*255 = 4096575), that means
my DOS partition ends on a 'BIOS' cylinder.

(16065 = heads(BIOS) * sector/track(BIOS) = 255 *63)

My NetBSD partition ends at 4098465 + 8496495 = 12594960 sectors
and 12594960/16065 = 784.00 so is "right" for LILO

and 12594960/945 = 13328.00 so this partition ends on a 'real'
cylinder too.

So you must consider the BIOS geometry if you wan to use OS that
use it !

Tip: most of the time, it _really_ usefull to fix the way the
BIOS watchs the hard disk (choose LBA instead of 'auto') before
installing anything; you will avoid bad suprises when adding
another OS in the future ...

Hope this help,

Pierre Bourgin