$! MOUNT_DISKS_ROUTINES.COM $! ======================== $! This procedure contains a set of subroutines used to mount a disk. $! P1 : SINGLE_DISK if not the page and swapfile disk $! PAGSWP_DISK if the pagefile disk (will search for node_page|swap) $! P2 : disk name (eg dsa1) $! P3 : disk label (eg dsk1) $! P4 : comma separated list of devices $! P5 : optional : logical name to be created for the device $! P6 : optional : comma separated list of sites where P4 devices are found $! $! Under normal circumstances, all disks of a shadow set must be present or $! the boot will be aborted. If after the mount, the disk is not mounted, the $! boot will be aborted too. For each condition, 60 seconds time is given to $! VMS to correct itself (slow configure process, other node not yet rebooted). $! $! When setting USERD2 to 1, the requirement that all disks of a shadow set $! must be present is replaced by at least 1 member must be present. $! $! When setting USERD2 to 2, the boot will continue even if the mount fails. $! $! Starting from vms7.3, the mount itself will also check if both members are $! present (/pol=req). But only if not a forced boot. $! $! NOTE FOR SATELITES : if both members specified are invalid but the disk is $! already mounted by a cluster member, the mount will succeed with success. $! $! When using FDDI interbuilding clusters, it is important that the read IO is $! done in the local building. This is done by specifying the current site in $! the mount command and to do a set device /site for every disk based upon P6. $! (only to be used in 7.2+, sites are MX and CSM) $! $! THIS FILE MAY NOT BE MODIFIED OUTSIDE THE SYSMGT MAINTENANCE SYSTEM $!============================================================================== $ nodename = f$getsyi ( "nodename" ) $ sysgen := $sys$system:sysgen $! $ if f$tr("IGNORE_BOOT_BECAUSE_OF_ERROR") then exit $ if p1 .eqs. "SINGLE_DISK" $ then $ call single_disk "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" $ else $ if p1 .eqs. "PAGSWP_DISK" $ then $ call pagswp_disk "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" $ else $ call say "ATTENTION : unsupported disk mount option ''P1'" $ wait 00:01 $ endif $ endif $ exit $! $single_disk: subroutine $ name = P1 $ label = P2 $ devices = "''P3'" $ logical = "''P4'" $ sites = "''P5'" $ if f$extract ( 0 , 3 , name ) .eqs. "DSA" $ then $ shadow = 1 $ if devices .eqs. "" $ then $ call say "ATTENTION : Device spec missing for mount of ''name'. STOPPING BOOT" $ define/sys IGNORE_BOOT_BECAUSE_OF_ERROR "True" $ exit $ endif $ else $ shadow = 0 $ devices = name $ endif $! $ trycnt=-1 $redo_checks: $! $! In some cases, the disk that must be mounted is not visible yet, because the $! configure process hasn't got enough time to finish its job. We will wait $! some time for it to becoma available. $! $ trycnt=trycnt + 1 $ i = -1 $ disks="" $next_single_disk: $ i = i + 1 $ disk = f$el ( i , "," , devices ) $ site = f$el ( i , "," , sites ) $ if disk .eqs. "," then goto end_checks $ set noon ! getdvi sometimes gives Fatal error doesn't exists $ $ mnt="t" $ if .not. f$getdvi ( disk , "exists" ) then mnt="f" $ if .not. f$getdvi ( disk , "avl" ) then mnt="f" $ if .not. mnt then goto next_single_disk $ set on $ if disks .eqs. "" $ then $ disks=disk $ else $ disks=disks+","+disk $ endif $ goto next_single_disk $ $end_checks: $ if disks .eqs. "" .and. devices .nes. "" $ then $ if trycnt .lt. 6 $ then $ call say "ATTENTION : no disks available of ''devices'. WAITING !!!" $ wait 00:00:10 $ goto redo_checks $ endif $ endif $ if disks .nes. devices .and. devices .nes. "" $ then $ call say "ATTENTION : not all disks available of ''devices' (only ''disks')." $ if f$ed(f$getsyi ("userd2"),"UPCASE") .ge. 1 $ then $ call say "---> FORCED to do the mount!!!" $ else $ if trycnt .lt. 6 $ then $ call say "---> WAITING (use userd2=1 to force the mount ?) !!!" $ wait 00:00:10 $ goto redo_checks $ endif $ call say "---> STOPPING BOOT !" $ define/sys IGNORE_BOOT_BECAUSE_OF_ERROR "True" $ exit $ endif $ endif $ set noon $ if shadow $ then $ mypol="" $ vmsvers=f$extr(1,3,f$ed(f$getsy("version"),"trim")) $ if vmsvers .ges. "7.3" .and. f$ed(f$getsyi ("userd2"),"UPCASE") .eq. 0 then mypol="/policy=require_members" $ mount /system /norebuild /noassist 'mypol' 'name' /shadow = ('devices') 'label' 'logical' $ if sites .nes. "" $ then $ local_site=f$tr("bbl_site") $ set device /site='local_site' 'name' $ i = -1 $ disks="" $next_site: $ i = i + 1 $ disk = f$el ( i , "," , devices ) $ if disk .eqs. "," then goto end_site $ site = f$el ( i , "," , sites ) $ set device 'disk' /site='site' $ goto next_site $ endif $end_site: $ else $ mount /system /norebuild /noassist 'name' 'label' 'logical' $ endif $ mnt="t" $ if .not. f$getdvi (name , "exists" ) then mnt="f" $ if .not. f$getdvi (name, "mnt" ) then mnt="f" $ if .not. f$getdvi (name, "avl" ) then mnt="f" $ if .not. mnt $ then $ if f$ed(f$getsyi ("userd2"),"UPCASE") .ge. 2 $ then $ call say "ATTENTION : MOUNT FAILED. CONTINUING. !" $ else $ call say "ATTENTION : MOUNT FAILED. STOPPING BOOT !" $ define/sys IGNORE_BOOT_BECAUSE_OF_ERROR "True" $ exit $ endif $ endif $ set volume /retention=(3-,7-)/nohighwater_marking /noerase_on_delete 'name' $ set on $ call say "Processed mount for device ''name'" $ goto end_single_disk $end_single_disk: $ endsubroutine $! $! Subroutine to mount a single disk with a page and/or swap file on it $! $pagswp_disk: subroutine $ name = p1 $ label = p2 $ devices = "''p3'" $ logical = "''p4'" $ sites = "''p5'" $ cur_retries = 0 $ max_retries = 2 $! $! Mount like a normal disk $! $ mnt="t" $ if .not. f$getdvi (name , "exists" ) then mnt="f" $ if .not. f$getdvi (name, "mnt" ) then mnt="f" $ if .not. f$getdvi (name, "avl" ) then mnt="f" $ if .not. mnt $ then $ call single_disk "''name'" "''label'" "''devices'" "''logical'" "''sites'" $ endif $! $ if f$search ( "''name'[sysexe]''nodename'_page.sys" ) .nes. "" $ then $ set file /nobackup 'name'[sysexe]'nodename'_page.sys $ sysgen install 'name'[sysexe]'nodename'_page.sys /pagefile $ endif $! $ if f$search ( "''name'[sysexe]''nodename'_swap.sys" ) .nes. "" $ then $ set file /nobackup 'name'[sysexe]'nodename'_swap.sys $ sysgen install 'name'[sysexe]'nodename'_swap.sys /swapfile $ endif $ goto end_pagswp_disk $! $end_pagswp_disk: $ endsubroutine $ $say: subroutine $ write sys$output "''p1'" $ reply/all/node "''p1'" $ goto end_say $end_say: $ endsubroutine