From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 11-JUN-1992 12:31:52.41
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: re:$device_scan,mount unknown cdrom (was unknown subj.)


In article <920609090849.23e03060@Csa3.LBL.Gov>, system%niu.hepnet@CSA3.LBL.GOV writes:

>I response to my question about $devices_scan and mounting an unknown cdrom
>clusterwide Carl J Lydick, <carl@SOL1.GPS.CALTECH.EDU> writes
>
>>In that case, I don't see why you need SYS$DEVICE_SCAN.  It has nothing to do
>>with that problem.  To do the clusterwide mount, what you need to do is:
>>    1)  Mount the CDROM privately and foreign (you could mount it as a
>
>and gives a method for mounting the cdrom however as I replied to him...
>
>>>Carl,
>>>    The problem with that approach is what to do about the second and third
>>> and    ... node to come up
>>>during a boot.  The answer is to write a file with the
>>>label name in it (and a date to make sure one isn't out of date)  
>>>    Not knowin exactly what $devices_scan was I was hoping that it would allow
>>>me to find the label.  I was embarrassed to be told
>>>that there is online help for system_services $devices_scan, however it doesn't
>>>give a item list.
>>>    I guess I will have to write to a file.  Thanks
>>>for your time and suggestion.
>

Here's a procedure I wrote back in the days when I had a 20-odd node cluster
to manage and a bunch of CD drives attached to various workstations in the
cluster.

							--Doug

$	Verif = 'F$Verify(0)
$!***************************************************************************
$!  CD_MOUNT.COM				Douglas A. Gordon
$!						Digital Equipment Corporation
$!						22-Feb-1990
$!
$!	Mount the RRD40/50 drives cluster wide when the system boots,
$!	or, if the drive is already mounted on the source node, try
$!	to get it mounted on this node.
$!
$!	Parameters:
$!
$!	P1 (req) -	Function.  Either MOUNT or VOLUME_LABEL
$!	P2 (req) -	Device name
$!	P3 (opt) -	Function parameter. For MOUNT it's the optional
$!			  logical name for the drive, for VOLUME_LABEL
$!			  it's the name of the file to write the information.
$!
$!***************************************************************************
$!	'F$Verify(F$Integer(F$Trnlnm("Meis$$Com_Verify")))
$!
$	Set Noon
$	Say := Write Sys$Output
$	Node = F$Edit(F$Getsyi("Nodename"),"Trim")
$	Clean_Dev = P2 - ":"
$	If P1 .Nes. "" Then Goto 'P1
$  Bad_P1:
$	Say "%CD_MOUNT-F-BADP1, P1 must be one of MOUNT, VOLUME_LABEL"
$	Goto Bail_Out
$  Mount:
$	Volname = ""
$	Visibility = "/Cluster"
$	If F$Getdvi(P2,"Exists")
$	Then
$	  If F$Getdvi(P2,"Mnt")
$	  Then
$	    Volname = F$Getdvi(P2,"Volnam")
$	  Else					! If F$Getdvi(P2,"Mnt")
$	    Server_Node = F$Getdvi(P2,"Host_Name")
$	    If Server_Node .Eqs. Node
$	    Then
$	      Volname = ""
$	      Mount/Foreign/NoAssist 'P2
$	      If $Status Then Volname = F$Getdvi(P2,"Volnam")
$	      Dismount/NoUnload 'P2
$	    Else				! mounted on remote node
$	      Fn = "Sys$Common:[Sysmgr]Cd_Mount_" + Node + "_" + Clean_Dev
$	      Copy/NoLog Nl: 'Fn'.Tmp
$	      Open/Append Sysman_File 'Fn'.Tmp
$	      Write Sysman_File "Mcr Sysman"
$	      Write Sysman_File "Set Environment/NoDe=",Server_Node
$	      Write Sysman_File "Do @Sys$Common:[Sysmgr]Cd_Mount ", -
		"VOLUME_LABEL ", -
		P2, " ", Fn, ".Dev"
$	      Write Sysman_File "Exit"
$	      Close Sysman_File
$	      @'Fn'.Tmp
$	      Delete/NoLog/NoConfirm 'Fn'.Tmp;*
$	      If F$Search("''Fn'.Dev") .Nes. ""
$	      Then
$		@'Fn'.Dev
$		Volname = Cd_Mount$Volnam
$	        Visibility = "/System"
$		Delete/NoLog/NoConfirm 'Fn'.Dev;*
$	      Else
$		Say "%CD_MOUNT-W-NOCANDO, Can't obtain label info for ''P2'"
$	      Endif
$	    Endif
$	  Endif
$!
$	  If Volname .Nes. ""
$	  Then
$	    Say "Mount",Visibility," ",P2," ",Volname," ",P3
$	    Mount 'Visibility' 'P2 'Volname 'P3
$	  Else
$	    Say "%CD_MOUNT-W-NOCD, ''P2' does not appear to contain a CD"
$	  Endif
$	Else
$	  Say "%CD_MOUNT-W-NOREADER, ''P2' is not available,  Node probably not up"
$	Endif
$	Goto Bail_Out
$!
$  Volume_Label:
$!
$!	If we get here, it's expected that the device is mounted on the
$!	node we're running on.  If not, we're SOL and might as well go
$!	home...
$!
$	Set Noon
$	Show Device 'P2
$	If .Not. F$Getdvi(P2,"Exists") Then Goto Bail_Out
$	If .Not. F$Getdvi(P2,"Mnt") Then Goto Bail_Out
$	Volname = F$Getdvi(P2,"Volnam")
$	Copy/NoLog Nl: 'P3
$	Open/Append Tf 'P3
$	Write Tf "$ Cd_Mount$Volnam :== ",Volname
$	Close Tf
$!
$  Bail_Out:
$	Exit $Status + 0 * (F$Verify(Verif))


--
Doug Gordon                             gordon@edwin.enet.dec.com
InfoServer Software Engineering         Anything resembling an opinion
Digital Equipment Corporation              is mine and not DECs.

