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

On Wed, Apr 9, 2008 at 11:57 PM, Mark Lord <lkml@rtr.ca> wrote:
> > 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
> 19457/255/63
> $
>

Sure and you could the same with fdisk, sfdisk, parted outputs...

But that wasn't my point, sorry if it wasn't clear.

I was actually wondering why /sys/block/sda exports a lot of disk
features but the disk geometry. I was wondering if somthing like

/sys/block/sda/geometry/heads

could be useful...

--
Francis


\
 
 \ /
  Last update: 2008-04-10 21:09    [W:0.111 / U:8.884 seconds]
©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site