Operating System - OpenVMS
1828279 Members
3633 Online
109975 Solutions
New Discussion

Re: Retrieve Shadow Set Information using c++

 
Malav
Occasional Contributor

Retrieve Shadow Set Information using c++

Hi All,

I need to get the information of whether a disk device is a member of a shadowset or not. I see some sys$getdvi item codes (DVI$_SHDW_MASTER, DVI$_SHDW_MASTER_NAME, DVI$_SHDW_MEMBER, DVI$_SHDW_NEXT_MBR_NAME) which can help me but sys$getdvi returns this values only when the disk is mounted as a shadow set. I need to get this information without mounting the disk or atleast without mounting it as a shadow set.

After going thru some docs, i was able to figure out that the SCB on the disk might have some of the information i m looking for.

Can anyone guide me of how to read the SCB or let me know if there is any other way of getting the above mentioned values?

-Malav
5 REPLIES 5
John Gillings
Honored Contributor

Re: Retrieve Shadow Set Information using c++

Malav,

In theory you could read logical or even physical blocks off the disk and determine whatever you want, BUT there's no documented interface for doing so, and, if you manage to reverse engineer the bits & bytes, there's no guarantee that they will remain that way into the future.

The only supported means for determining this information is by MOUNTing the disk and using the $GETDVI items to interrogate the shadow set.

On the other hand, if all you want to know if IF the disk is a shadow set member, you can MOUNT/OVER=ID and check its status. If the volume was a shadowset member it will be write locked. Since this won't affect the contents of the drive, won't that be sufficient?
A crucible of informative mistakes
Robert Brooks_1
Honored Contributor

Re: Retrieve Shadow Set Information using c++

Can anyone guide me of how to read the SCB or let me know if there is any other way of getting the above mentioned values?


-----

Reading the SCB is the only fool-proof way to determine the state of the disk; the shadowing driver does this to figure out the state of the world with respect to copies, merges, etc . . .

Having said that, I second John's statement that the most reasonable way to figure this stuff out is to mount the volume /OVER = ID and to try to make sense of the result.

There is no other supported way to do this.

If you pursue the "read the SCB" method, bear in mind that the format of the SCB is liable to change without notice (although the astute reader will figure out that this would cause a lot of compatibility issues, which we try to avoid at all costs). In any event, you will need to become familiar with the Files-11 format.

Good luck.

-- Rob (VMS Engineering)
Malav
Occasional Contributor

Re: Retrieve Shadow Set Information using c++

John,

Yes doing a Mount/over=Id and checking for the wrtlck status helps in determining whether it is a shadow set member or not.
But I miss out on other values like DVI$_SHDW_MASTER, DVI$_SHDW_MASTER_NAME and DVI$_SHDW_NEXT_MBR_NAME, which sys$getdvi returns ONLY when the disk is mounted as a shadowset.
Though I can do away with those values for time being, but I would like to know why getdvi() is not able to retrive those values when the disk is mounted using Mount/over=id (not as a shadowset).


Rob,

I agree with ur suggestion that Mount/over=id is the reasonable way of finding out the information.

Thanks for your responses


-Malav

Volker Halle
Honored Contributor

Re: Retrieve Shadow Set Information using c++

Malav,

SYS$GETDVI obtains the shadowset configuration information from the data structures in memory, not from the SCB on disk. Those datastructures only exist, IF the disk is mounted as a member of the shadowset.

Volker.
Robert Brooks_1
Honored Contributor

Re: Retrieve Shadow Set Information using c++

SYS$GETDVI obtains the shadowset configuration information from the data structures in memory, not from the SCB on disk. Those datastructures only exist, IF the disk is mounted as a member of the shadowset.

----

As always, Volker is correct.

$GETDVI does not do any I/O to gather information for any item code; it either directly accesses data structures in memory, or uses $GETLKI for assistance.

-- Rob