Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!sgi!daveh@xtenk.asd.sgi.com From: daveh@xtenk.asd.sgi.com Newsgroups: comp.sys.sgi Subject: Re: About the Volume Header Message-ID: <86407@sgi.sgi.com> Date: 20 Feb 91 22:13:02 GMT References: <9102192244.AA12336@koko.pdi.com> Sender: guest@sgi.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 34 In article <9102192244.AA12336@koko.pdi.com>, shoshana@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 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@xtenk.asd.sgi.com) Brought to you by Super Global Mega Corp .com