svn commit: r216269 - head/sys/geom/part

Erik Trulsson ertr1013 at
Fri Dec 10 01:07:23 UTC 2010

On Thu, Dec 09, 2010 at 10:14:58PM +0000, Bruce Cran wrote:
> On Thu, 9 Dec 2010 19:58:56 +1100 (EST)
> Bruce Evans <brde at> wrote:
> > I had understood the ATA_FLAG_54_58 backwards.  It tells us if the
> > drive is not so old that it doesn't support IDENTIFY records for
> > words 54-58.  I think we rarely get here.  Drives old enough to use
> > CHS may be so old that they don't support words 54-58.  Only drives
> > manufactured during a few years or months in the 1990's will support
> > words 54-58 but not LBA. Maybe I'm misremembering the length of this
> > time.
> All modern drives (including ATA-8) seem to support reporting the
> current CHS geometry, so FreeBSD will use this for the geometry;
> however since when the BIOS chooses to use LBA mode the "current
> geometry" words aren't updated I think we use the wrong geometry on
> modern drives.

Modern drives do not really report 'the current CHS geometry'. They
report a fake geometry that normally do not have anything do with the
actual geometry.  (As an example just about all modern ATA/SATA drives
report having 16 heads, while in reality none of them have more than 10
heads and most of them have fewer heads than that.)

Finding out the real geometry of a disk is generally not possible and
typically cannot even be expressed with a simple C/H/S scheme, since the
'S' component is usually not a constant. (Modern drives put more
sectors per track on the outer tracks than on the inner tracks.)

The only reason for actually using the geometry reported by the disk
for anything is if you need to have the partitioning of the disk
compatible with some other OS which does use the reported CHS values.
 (E.g. if you have a dual-boot machine where FreeBSD shares the disk
 with some other OS that insists on having partitions start exactly on a
 track boundary, then FreeBSD would need to handle that somehow.)
But even then you are not really interested in using the 'correct'
geometry, but rather in using whatever geometry that other OS is using.

<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at

More information about the svn-src-all mailing list