*BSD News Article 2875


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!news.hawaii.edu!ames!decwrl!access.usask.ca!regina!udevdiv!roe
From: roe@Unibase.SK.CA (Roe Peterson)
Subject: SCSI drive geometry woes...
Message-ID: <1992Jul30.220055.15150@Unibase.SK.CA>
Organization: Unibase Telecom Ltd.
Date: Thu, 30 Jul 1992 22:00:55 GMT
Lines: 39

Well, 386BSD is up and running, and working well (except for the occasional
hangup which I'm attributing to the very small swap space).

I've just received a new fujitsu 640MB SCSI disk drive, and I'd like to take
full advantage of the UFS cylinder grouping scheme.

However, I'm having some major problems.  It seems that 386BSD does not
care about the disk geometry specified in the disk label during boot.

With an adaptek 1542B controller, the disk BIOS reports a geometry of
640 cylinders, 64 heads, and 32 sectors.  The _actual_ drive geometry
is 1658 cylinders, 15 heads, and 53 sectors/track, with 3 sectors/cylinder
spared for alternates, with 15 cylinders also spared (giving 1643 cylinders).

I've used a little fdisk-like utility (called pfdisk) to change the drive
geometry, and lay out partitions on cylinder boundaries.  I actually had
to lie through my teeth here, since the master disk partition table has
no concept of spares/cylinder;  hence, I've told the fdisk partition
table that the drive has 1642 cylinders of 24 heads with 33 sectors,
for a total of 792 blocks/cylinder ((15*53)-3).

Then, I've created a disktab entry with the same lie in place, and
created the disklabel for the driver.  Everything looks good so far.
When I run newfs, I override the defaults from the disklabel, and give
it the _real_ drive geometry, as well as the number of spares/cylinder.
Makes the file system OK, and the _sound_ seems to indicate that I've
got things laid out correctly on cylinder boundaries.

Mount the new disk (/dev/as1a), proceed to copy the whole distribution
from drive zero.  Everything looks just fine.

Then, I re-address the new drive to unit 0, and attempt to boot.  I get
as far as checkpoint e, and the whole system reboots.

My theory is that some (or all) of the bios drive geometry is being
paid attention to by boot, regardless of the information in the disk label.

Anyone got any comments or ideas?  I think this would be a big disk
performance win if I can get it working correctly.