[lkml]   [2008]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Disk geometry from /sys
Francis Moreau wrote:
> 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)

$ DEV=/dev/sda
$ GEOM="`/sbin/hdparm -g $DEV | awk '{print $3}'`"
$ echo $GEOM

 \ /
  Last update: 2008-04-09 23:59    [W:0.271 / U:0.336 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site