From: brydon@asl.slb.com (Harvey Brydon (918)250-4312)
Newsgroups: comp.os.vms
Subject: Re: Checking for MOUNT/VERIFY status
Date: 16 Oct 92 12:20:31 GMT
Reply-To: brydon@dsn.SINet.slb.com
Organization: Schlumberger/Anadrill Sugar Land, TX

In article <1992Oct9.084005.408@hhcs.gov.au>, kratom@hhcs.gov.au writes:
>Is there anyone who knows how to test to see if a disk device is in a
>MOUNT/VERIFY status ? (Especially across a cluster)
>
>A "SHOW DEVICE D" will display the device like :
>
>Device                  Device           Error    Volume         Free  Trans
> Name                   Status           Count     Label        Blocks Count
>CNB07V$DUA4:            Mounted/Verify     0      PRODUCTS1    1803084     1
>
>When the disk device is in this state, and a command like F$SEARCH is entered,
>then it will hang (the process has to be stopped to get out of this state).
>
>It would be great if there was an F$GETDVI item which returned this status. Is
>there a way of determining this ?

It is in fact F$GETDVI you want.  Here is a piece of code I have in my backup
routines for figuring out this exact problem.  I'll let you change it into
what you want, and you may note that you can just look at the 2 VALID and
MNTVERIP bits if you want.  I looked at the whole longword...  Every system on
the cluster will have its own opinion on the state of the disk.  If you
execute this code on one member of a cluster, there is no guarantee that the
other systems see the disk in the same way.

HTH
_______________________________________________________________
Harvey Brydon         | Internet:   brydon@dsn.SINet.slb.com
Dowell Schlumberger   | P.O.T.S.:   (918)250-4312
Conspiracy?  Bush, Clinton and Perot are all southpaws...

$CHECK_DISK_MOUNTED:
$ exists = f$getdvi("disk:","exists")
$ if .not. exists then goto no_exists
$ dev = f$getdvi("disk:","fulldevnam")
$ sts = f$getdvi(dev,"sts")
$
$ if sts .eq. %x00021810 then goto mounted_okay
$ if sts .eq. %x00021913 then goto mounted_okay	      ! Applicon disks
$ if sts .eq. %x00025810 then goto mounted_dismounted ! host unavailable/mounted
$ if sts .eq. %x00061810 then goto mounted_dismounted ! mount verification (?)
$ if sts .eq. %x00065010 then goto mounted_dismounted ! Applicon disk not avail
$ if sts .eq. %x00065810 then goto mounted_dismounted ! Host died ungracefully
$ if sts .eq. %x00021010 then goto mounted_dismounted
$ if sts .eq. %x0002D810 then goto mounted_dismounted ! 'wrong volume mounted' bug
$ if sts .eq. %x0000A268 then goto mounted_dismounted ! Host gone bye-bye
$ if sts .eq. %x00000010 then goto not_mounted
$ show sym sts
$ show dev /mounted
$ show dev /ful 'dev'
$!
$! STS Bit %X00000800 is VALID bit - check if disk not valid
$! STS Bit %X00004000 is MNTVERIP bit - check if disk not in mount verification
$! Not Valid implies that mount verification has timed out
$!
$ if (( sts .and. %x4800 ) .eq. 0 ) then goto mounted_dismounted
$ status = %x1072090C	! (No such device available)

(status processing code here)

$mounted_dismounted:

(mount/dismount processing here)

$not_mounted:

(not mounted processing here)

$no_exists:

(non-existent device processing here)

$mounted_okay:

(normal processing here)