Subject: Re: disktab(5)
To: None <port-sparc@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 11/26/2001 22:37:16
>> I don't know about disktab specifically, since I never use disktab.
>> But I can say that in my experience, neither of the constraints you
>> mention applies to the label.

> Then how does the driver know:
> - where partitions begin and end

The label, which it reads off the disk (usually sector zero) when the
drive is first accessed.

> - the extents of the physical drive

The drive reports its sector count at probe time.

> - where to "avoid"

Huh?  I don't know what you're referring to here.  Perhaps I'm just
misinterpreting your smiley....

> I note that the installer *always* comes up with a geometry that
> doesn't satisfy the ns/nt/nc criteria mentioned above.

I'd guess you've *always* used ZBR drives, for which there is no single
true geometry triple, as you mention.

> And, often doesn't seem to correspond to the documented geometry of
> the drive (from published specifications, etc.).

This I've never seen, except on i386 boxen, where the BIOS gets
underfoot.  There, I've always just let it do whatever it defaults to
doing and it's always gotten it right so far.  (The fragility of this
procedure and the underlying lack of understanding of what's really
going on are among the reasons I tend to avoid i386 boxen.)

> Of course, with zone density recording, there is no true "sectors per
> track".  But, does *anything* in the system examine these parameters?
> Or, does it just treat the drive as an array of sequential block
> numbers?

"Yes."

If you use FFS filesystems, the FFS code uses the geometry information
in an attempt to do "good" block layout.  Of course, this effort is
futile in these days of caches larger than tracks, delayed-writeback
caches, ZBR, DMA that can't keep up with the platters, etc.  But it's
easier to let it have its little delusions than to try to rip all that
code out.  So yes, something does look at those numbers.  But if
they're wrong, it may impair performance (and probably not even that by
much, these days), but won't impair correctness.

At the filesystem<->driver interface, the drive is just a big linear
array of blocks.

Below that, it depends on the interface.  SCSI disks are addressed by
sector number.  IDE disks may or may not be; I think this is LBA
addressing versus CHS addressing.  (Fuzzy memory says there is a third
option, but I know nothing more about it.)  Others, well, it depends.
I think most floppy hardware is fundamentally cyl/hd/sec addressed.
MSCP I'm not sure of (it's been too long) but I think they're big-array
addressed.  HP-IB, etc, who knows?  Maybe people who know other
architectures can speak to the idiosyncracies of their architectures.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B