Disk geometry from /sys
- From: "Francis Moreau" <francis.moro@xxxxxxxxx>
- Date: Wed, 9 Apr 2008 22:53:36 +0200
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
--
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/
- Follow-Ups:
- Re: Disk geometry from /sys
- From: Seewer Philippe
- Re: Disk geometry from /sys
- From: Bill Davidsen
- Re: Disk geometry from /sys
- From: linux-os (*** Johnson)
- Re: Disk geometry from /sys
- From: Mark Lord
- Re: Disk geometry from /sys
- From: Lennart Sorensen
- Re: Disk geometry from /sys
- Prev by Date: Re: [PATCH 0/3] x86: add cpus_scnprintf function v3
- Next by Date: Re: [patch] e1000=y && e1000e=m regression fix
- Previous by thread: libata errors with smartctl on 2.6.24, WD3200AAKS and nVidia AHCI
- Next by thread: Re: Disk geometry from /sys
- Index(es):