Retrieving disk geometry

Terry Lambert tlambert2 at mindspring.com
Mon Jun 2 08:51:08 PDT 2003


Andrew wrote:
> Under FreeBSD 4.x the ioctl DIOCGDINFO could be used to retrieve the
> number of cylinders, heads and sectors of a drive. This could be called on
> /dev/ad0 for example. Under FreeBSD 5 it seems to produce "Inappropriate
> ioctl for device" unless you call it on an individual partition
> (/dev/ad0s1a for example).
> 
> Is there a way around this?

All the geometries returned by this call are fictitous these days,
so there's really no value to it.

What you really want is the SCSI mode page 2, or the Maxtor or
Quantum vendor-private command, for IDE.  Anything else means
that you're going to be pessimising, rather than optimizing,
when you make decisions on the basis of disk geometry reported
by this call.

-- Terry


More information about the freebsd-hackers mailing list