Re: *Help!* Where is device partition info stored by the kernel?

mlord (mlord@pobox.com)
Wed, 11 Jun 1997 18:45:36 -0400


Dave Cinege wrote:
>
> On Wed, 11 Jun 1997 15:20:41 -0400 (EDT), Grant R. Guenther wrote:
>
> >> Where does the kernel keep the partition info? I looked all in /proc and
> >> couldn't find it.
> >
> >There's an array indexed by the minor number inside each block device
> >driver. Look for the fields "start_sect" and "nr_sects" in the source of
> >the driver in question.
...
>
> That info really should be available somehow at the user level.....

There are ioctl's from the driver level that make some partition info
available to user level. See "hdparm -g" for an existing user-level
command that can be used from scripts (should work for IDE, SCSI, ...).

eg. > hdparm -g /dev/hda2
/dev/hda2:
geometry = 622/255/63, sectors = 160650, start = 4915890

-- 
mlord@pobox.com
The Linux IDE guy