Operating System - OpenVMS
1748041 Members
4842 Online
108757 Solutions
New Discussion юеВ

Re: What command to use for retrieving File System

 
Joseph Huber_1
Honored Contributor

Re: What command to use for retrieving File System


SHOW DEVICE D/MOUNTED/SERVED

seems to come near what You want.
But it probably will not list disks which are not served to the cluster.
http://www.mpp.mpg.de/~huber
Joseph Huber_1
Honored Contributor

Re: What command to use for retrieving File System

Sorry my error, the combination of parameters/qualifiers in my reply does not work, it must be

SHOW DEVICE /SERVED

If You want to see only locally mounted disks, then I think You have to write a command-file doing a device-scan into variable DISK, then looking for each device at
f$getdvi(DISK,"REMOTE_DEVICE") or
F$GETDVI(DISK,"DFS_ACCESS") or

to exclude them from the display.
http://www.mpp.mpg.de/~huber
Jan van den Ende
Honored Contributor

Re: What command to use for retrieving File System

Alok,

Let me begin with a

Warm welcome to the VMS forum!

Your specific question:

$ pipe show device d | search sys$input "AIN" /match=nor

will exclude any lines containing "AIN" from the output of SHOW DEVICE D

If I understood correctly, that was what you asked for.

But have a second look at the output: it has a column headed: "Mount count"

If that number is more than 1, tou are really looking at something that simply DOES NOT EXIST in any OS except VMS or Tru64: That drive is DIRECTLY adreesable from ALL nodes (physically not always entirely true, but logically it is LOCALLY mounted SIMULTANUOUS on ALL nodes.

hth.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Joseph Huber_1
Honored Contributor

Re: What command to use for retrieving File System

A procedure could be like this one:

$ ON WARNING THEN GOSUB ERROR_HANDLER
$ ON CONTROL_Y THEN GOTO EXIT_PROCEDURE
$ !
$ ! Loop through the disks
$ !
$ NEXT_DISK:
$ DISK = F$DEVICE("*","DISK")
$ IF DISK .EQS. "" THEN GOTO NO_MORE_DISKS
$ IF .NOT. F$GETDVI(DISK,"MNT") THEN GOTO NEXT_DISK ! Not mounted
$! check the disk is LOCAL/served by this node
$ IF f$getdvi(DISK,"REMOTE_DEVICE") THEN GOTO NEXT_DISK ! remote served
$ IF F$GETDVI(DISK,"DFS_ACCESS") THEN GOTO NEXT_DISK ! e.g. DNFS
$ IF F$GETDVI(DISK,"SHDW_MEMBER") THEN GOTO NEXT_DISK ! Shadow member
$ IF F$GETDVI(DISK,"VOLNUMBER") .GT. 1 THEN GOTO NEXT_DISK ! Vol. set
$ SHOW DEVICE 'DISK'
$ GOTO NEXT_DISK
$ !
$ EXIT_PROCEDURE:
$ WRITE SYS$OUTPUT "... Procedure cancelled "
$ !
$ NO_MORE_DISKS:
$ SET NOON
$ EXIT
$ !
$ ERROR_HANDLER:
$ SET NOON
$ write sys$output " error on disk ",DISK
$ RETURN
$! DCL procedure written by Joseph Huber

To have a more compact display, replace the simple "SHOW DEVICE 'disk'" command by a write statement extracted from each disk using f$getdvi(disk,...).

http://www.mpp.mpg.de/~huber
Alok_Kumar
Occasional Advisor

Re: What command to use for retrieving File System

Thanks all for such awesome inputs...

To again refrain..

I have to use DCL statemement to parse as XML statement to system and then retrieve output.

Now show device /served thus this but problem is it removes VOLUME LABEL!!!!!!! Phewwww
Joseph Huber_1
Honored Contributor

Re: What command to use for retrieving File System

If You are anyway inside a command-file, don't do a simple SHOW DEV, use
f$getdvi(disk,"VOLNAM") etc.
http://www.mpp.mpg.de/~huber
Robert Gezelter
Honored Contributor

Re: What command to use for retrieving File System

Kumar,

As Joseph has already noted, if you are in a command file already, then the F$GETDVI lexical function in DCL is the best vehicle for extracting information about a device and the volume on it.

IMHO, parsing the output of a SHOW command is a risky business. Most of the information available using SHOW DEVICE is available using the lexical function.

This is a somewhat different structure than is common in the *IX world, where using pipes is the standard solution.

- Bob Gezelter, http://www.rlgsc.com
Joseph Huber_1
Honored Contributor

Re: What command to use for retrieving File System


Maybe You are intersted in looking at my disk_space command-file
http://wwwvms.mppmu.mpg.de/disk$www/com/disk_space.com

( @disk_space "" LOCAL )

to see how to get all needed info using f$getdvi.
Then replace the screen output with formatting the XML output as needed.
http://www.mpp.mpg.de/~huber
Willem Grooters
Honored Contributor

Re: What command to use for retrieving File System

Given your output, this node has no alloclass set, or the disks are not served to the cluster. Just focussing on the attachement, and if CPQMEG is the system you're interested in:

PIPE SHO DEV D | sea sys$pipe "CPQMEG$D"

would give exactly what you expect.
Which may, or may not, be the exact representation of your environment. Further more, it will cause problems where alloclass set set, or disks are served to the cluster. The suggestion by Joseph and Rob to use F$GETDVI is far more reliable and portable over VMS systems.
Willem Grooters
OpenVMS Developer & System Manager
Hoff
Honored Contributor

Re: What command to use for retrieving File System

I'd go one further; this is almost certainly some sort of an agent given what sort of pieces your apparent employer typically provides, and I'd go to sys$getdvi[w] and sys$device_scan[w] and related system service calls for your processing.

And there are all manner of wrinkles here, as you can have any of various storage configurations; stuff that's not local, but often served from the local host. (DSSI, for instance.)

You're really headed into a murky area, and the shared-write nature of the file system and the storage-only and cluster communications interconnects can really make for a complex view of the storage environment. Yes, a DCL solution could almost certainly be implemented, but you'll be chasing corner cases if you're not very careful. I'd go with the system services here.

And for clarity: parsing DCL output is going to lead to support issues. Don't do that. It's common and often preferred on Unix, though it's not the best solution and most stable on OpenVMS.