About the Volume Header
daveh at xtenk.asd.sgi.com
daveh at xtenk.asd.sgi.com
Thu Feb 21 09:13:02 AEST 1991
In article <9102192244.AA12336 at koko.pdi.com>, shoshana at pdi.UUCP (Shoshana Abrass) writes:
>
> I'm writing my own version of 'hinv'. Having the disk serial #'s appear
> in the listing would be VERY useful.
>
> I've been thinking of adding a file to the volume directory in our
> disk's volume headers. It would be a plain ascii file, containing the
> serial number of the disk. I can add the file easily, using dvhtool.
>
> My questions are: Is it relatively straightforward to access/read the
> file via /dev/rdsk/dksxdxvh ? and is this something I should be doing?
> or is this yet another thing which will cause SGI to void my warranty ;).
Not difficult. The volume header contains a 15 entry directory with
entries of the following structure:
#define VDNAMESIZE 8
struct volume_directory {
char vd_name[VDNAMESIZE]; /* name */
int vd_lbn; /* logical block number */
int vd_nbytes; /* file length in bytes */
};
You just have to search this array for a matching name to find where
& how many blocks to read.
See the file <sys/dvh.h>
Just reading from the volume header partition won't void your warranty.
(But be careful not to alter any of it, eg the partition table, otherwise
your disk could become inaccessable)!
Dave Higgen (daveh at xtenk.asd.sgi.com)
More information about the Comp.sys.sgi
mailing list