Re: Disk geometry from /sys

From: Alan Cox
Date: Wed Apr 09 2008 - 17:55:48 EST


> Why do you want to know what cylinder size the hard disk pretents to
> have? What use could it be? Harddisks have varying numbers of sectors

It matters on a CHS addressed device - vaguely.

> drive. All that matters on a modern drive is the total number of
> sectors since all access is done by requesting a specific sector number
> starting from the begining of the drive. Where it is physically located
> is none of software's business, and it may not even be adjacent to the
> sector with a number right next to the requested one due to defect
> management and various optimizations.

And some other OS's make certain assumptions about layout that must agree
with that OS view of the disk. A good general rule is to believe the
partition table information if present and if not use SG_IO to issue an
IDENTIFY to any ATA or CFA drive to see how it has mapped the device.

Even better make use fo the existing tools whenever possible - disk
partitioning is more like magic than science

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/