public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Francis Moreau <francis.moro@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Disk geometry from /sys
Date: Thu, 10 Apr 2008 15:53:33 -0400	[thread overview]
Message-ID: <47FE703D.5030901@rtr.ca> (raw)
In-Reply-To: <38b2ab8a0804101205s1e0e4fa0l884286ec7ea9ccbd@mail.gmail.com>

Francis Moreau wrote:
> 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...
..

Probably not for going forward.  Except when partitioning,
the CHS info isn't really useful or needed for anything newer
than about 14 years old.

And there's already an ioctl for getting it.

So we could add more /sysfs bloat for it, I suppose, but..
 


  reply	other threads:[~2008-04-10 19:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09 20:53 Disk geometry from /sys Francis Moreau
2008-04-09 21:28 ` Lennart Sorensen
2008-04-09 21:52   ` Alan Cox
2008-04-09 22:16   ` Bernd Eckenfels
2008-04-10 14:52     ` Lennart Sorensen
2008-04-10 19:23   ` Francis Moreau
2008-04-09 21:57 ` Mark Lord
2008-04-10 19:05   ` Francis Moreau
2008-04-10 19:53     ` Mark Lord [this message]
2008-04-10 12:22 ` linux-os (Dick Johnson)
2008-04-10 19:15   ` Francis Moreau
2008-04-10 13:58 ` Bill Davidsen
2008-04-14 12:57 ` Seewer Philippe
2008-04-15  7:40   ` Francis Moreau
2008-04-16  7:49     ` Seewer Philippe
2008-04-17 14:09       ` Francis Moreau
2008-04-17 14:49         ` Seewer Philippe
2008-04-18 13:22           ` Mark Lord
2008-04-18 13:37             ` Seewer Philippe
2008-04-22 20:11               ` Francis Moreau
2008-04-23  6:44                 ` Seewer Philippe
2008-04-23  6:56                   ` Francis Moreau
2008-04-22 20:16             ` Francis Moreau
2008-04-22 22:44               ` Mark Lord
2008-04-23  6:53                 ` Seewer Philippe
2008-04-23  7:02                 ` Francis Moreau
2008-04-23  9:33                   ` Seewer Philippe
2008-04-23 13:47                   ` Mark Lord
2008-04-22 20:10           ` Francis Moreau
2008-04-23  6:48             ` Seewer Philippe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FE703D.5030901@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=francis.moro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox