Operating System - OpenVMS
1760595 Members
3243 Online
108894 Solutions
New Discussion юеВ

Erase-on-delete -- how to determine via $getdvi

 
SOLVED
Go to solution
Jim Geier_1
Regular Advisor

Erase-on-delete -- how to determine via $getdvi

One of the side-effects of using the recommended /erase qualifier to prepare disks for a shadow set is that the volume characteristic erase_on_delete is set. This is easily turned off using SET VOLUME/NOERASE, but I was wondering how to determine whether the erase_on_delete characteristic is set for a volume. So I experimented using f$getdvi and found no change in the DEVCHAR, DEVCHAR2, DEVDEPEND, and DEVSTS bitmaps before and after setting /erase on the volume.

How does one determine whether erase_on_delete is set for a volume? Am I missing or overlooking something obvious?
8 REPLIES 8
Uwe Zessin
Honored Contributor

Re: Erase-on-delete -- how to determine via $getdvi

Stupid question, but why bother and not blindly do the:
$ SET VOLUME/NOERASE
.
Jim Geier_1
Regular Advisor

Re: Erase-on-delete -- how to determine via $getdvi

Not a stupid question, and one could certainly issue SET VOLUME/NOERASE for all disks on a system -- that would be very practical and perhaps even efficient.

It would be interesting to know how to determine the state of the erase_on_delete characteristic for a given volume. SHOW DEVICE certainly knows how, and DELETE knows how, and I'd like to know how.
Ian Miller.
Honored Contributor
Solution

Re: Erase-on-delete -- how to determine via $getdvi

Its in the volume control block
VCB$B_STATUS2
bit 3 set means erase on delete.

The VCB address is in the UCB at UCB$L_VCB

In SDA
sda> READ SYS$LOADABLE_IMAGES:SYSDEF
sda> SHOW DEV DKxxx
sda> EXAM VCB+VCB$B_STATUS2
____________________
Purely Personal Opinion
Volker Halle
Honored Contributor

Re: Erase-on-delete -- how to determine via $getdvi

Jim,

the ERASE-bit is not a DEVICE characteristics, but a VOLUME characteristic.

The VCB$V_ERASE bit is stored in the VCB (Volume Control Block). Visible with SDA>SHOW DEVIVE Dxxx
...
--- Volume Control Block (VCB) 82773B80 ---

Volume: TOOLS Lock name: TOOLS
Status: A0 extfid,system
Status2: 1C mountver,erase,nohighwater
...

There does not seem to exist a F$GETDVI lexical function argument to obtain this characteristic of a volume (even V7.3-2 VOLCHAR does not do it).

Volker.
Jan van den Ende
Honored Contributor

Re: Erase-on-delete -- how to determine via $getdvi

And. Jim,

if you really want it in DCL without running SDA, capturing the output, and parsing it, then there are some crazy tricks that can be done.

Look at

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=746158

and find the explanations by John Gillings.

If you understand enough of that to be able to use that as a blueprint, together with Ian's answer, then go ahead.

If it is not sufficiently clear what he is doing, and why, then you are probably wiser by not using it, but even then it is very instructive of some of the workings.

Have fun, and if you DO venture, please inform us of your results!

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Robert Brooks_1
Honored Contributor

Re: Erase-on-delete -- how to determine via $getdvi

Hi,

Over 20 new $GETDVI item codes have been added for V8.2 (both Alpha and I64). Please see the System Services reference manual for more details.

For your coding pleasure, among the new item codes added is dvi$_erase_on_delete.

--Rob

Jim Geier_1
Regular Advisor

Re: Erase-on-delete -- how to determine via $getdvi

Starting with V8.2, OpenVMS Engineering eliminated the ambiguity of the INITIALIZE command with the /ERASE qualifier both erasing the volume *and* setting the erase-on-delete volume characteristic by enhancing the /ERASE qualifier for the INITIALIZE command to take a value, one of either /ERASE=INIT or /ERASE=DELETE. Omitting the value replicates the pre-V8.2 behaviour, causing the erasure of the volume and the setting of the erase-on-delete characteristic.

Additionally, the lexical function F$GETDVI has a new argument, ERASE_ON_DELETE, returning True or False to indicate whether the eraee-on-delete volume characteristic hsa been set.

Good things come to those who wait...thanks!
Jim Geier_1
Regular Advisor

Re: Erase-on-delete -- how to determine via $getdvi

Requested f$getdvi code included in OpenVMS Alpha V8.2.