lkml.org 
[lkml]   [2008]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectDisk geometry from /sys
    Hi,

    I'm trying to know the geometry of my hard disk from a bash script
    and that's the reason I'm looking in /sys. The reason is that I'd like
    to figure out the size of a cylinder without doing a
    ioctl(bdev, HDIO_GETGEO, &geo)

    Unfortunately I can't find anything useful and this is certainly a sign
    that I'm doing something wrong.

    Or maybe can I simply assume from my script that the geometry
    is always heads=255 and the number of sectors per track is 63 for all
    disks.

    Looking at parted(8) source code, I can find this:

    /* The GETGEO ioctl is no longer useful (as of linux 2.6.x). We could
    * still use it in 2.4.x, but this is contentious. Perhaps we should
    * move to EDD. */

    Could anybody give me some advices ?
    --
    Francis


    \
     
     \ /
      Last update: 2008-04-09 22:57    [W:2.211 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site