Subject: Re: FW: Question/Help?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Erik E. Fair <fair@clock.org>
List: port-sparc
Date: 10/06/1998 11:55:57
At 5:09 -0700 10/6/98, der Mouse wrote:

>I think I don't quite understand.  In what sense does a partition
>*have* a notion of blks/cyl?

The partition table is part of the disk label. The disk label also has
values for sectors per track, tracks per cylinder, and so on (i.e. disk
drive geometry). If the number of blocks in any partition in the label is
not a whole number of cylinders, the PROMs (which do read the disklabel)
become unhappy.

Fortunately, the disk geometry in the disk label does not have to bear any
resemblance to the disk's reported geometry (when you query the SCSI
firmware for it) or the actual physical geometry (which, on a ZBR disk, is
going to vary by the cylinder anyway).

The NetBSD disklabel program will even show you which partitions are not
whole cylinders in size, thusly:

% disklabel sd2
# /dev/rsd2c:
type: SCSI
disk: SCSI disk
label: backups
flags:
bytes/sector: 512
sectors/track: 167
tracks/cylinder: 22
sectors/cylinder: 3674
cylinders: 4811
total sectors: 17780058
rpm: 7200
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  c: 17780057        0      unused        0     0         # (Cyl.    0 - 4839*)
  h: 17778486        0      4.2BSD     8192 65536    64   # (Cyl.    0 - 4838)

Note that the "c" partition has one less block than the "total sectors"
listed, which, for this drive, is the actual number (I seem to remember
setting it up that way), and if you divide out the number of sectors in "c"
by the number of blocks per cylinder, you will not get a whole number.
That's why there is a "*" in the comment about how many cylinders that
partition takes up. Fortunately, I don't boot from this disk, and never
will.

	Erik <fair@clock.org>