bug in reading from disk partitions

Dave Olson olson at anchor.esd.sgi.com
Fri Nov 30 04:52:20 AEST 1990


In <76400 at sgi.sgi.com> jeremy at perf2.asd.sgi.com (Jeremy Higdon) writes:

| In article <1990Nov27.031543.16150 at alias.uucp>, chk%alias at csri.toronto.edu (C. Harald Koch) writes:
| > 
| > If it were important, I would like to write a program to figure out the size
| > of the partition and copy exactly the right amount of data, but I don't know
| > how to figure out the raw size of a partition. Can anyone at SGI tell me how
| > to do this?
| >
| 
| The partition information is in the disk label (the first 512 bytes of
| the volume header (??????vh) partition).  See /usr/include/sys/dvh.h and
| vh(7m) for more info.
| 

Also see the ioctls in sys/dkio.h.  In particular, look at DIOCGETVH, which
will return the volume header info for you.  It is recommended that you
use the ioctl rather than reading the volume header info directly, because
some of the drivers will patch up the volume header info when first opened,
if it appears unreasonable (e.g., with SCSI, if the partition size plus
its offset is greater than the drive capacity as returned by the SCSI
readcapacity operation.

The DIOCGETVH ioctl takes as the 3rd argument a pointer to a
struct volume_header.  You must be using the character device
for the ioctl to work.
--

	Dave Olson

Life would be so much easier if we could just look at the source code.



More information about the Comp.sys.sgi mailing list