$ on control_y then goto ctrl_y $ def_qual = "system,noassist,norebuild" $ wso := write sys$output $ wso "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ wso "" $ wso "This procedure is associated with the prototype DISKMOUNT utility" $ wso "" $ wso "It will build a data file for the currently mounted disks on this node." $ wso "" $ wso "The only MOUNT qualifiers supported at present are:" $ wso " system, noassist, [no]rebuild, [no]write $ wso "The speed of disk mounting will be affected by whether rebuild is" $ wso "selected when mounting the disks." $ wso "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ wso "" $ read/prompt="Do you prefer that disks be rebuilt when mounted? " - sys$command rbld $ if rbld then def_qual = "system,noassist,rebuild" $ $ wso "" $ wso "Please wait - creating temporary listing file of mounted disks" $ show devi/mount/outp=diskmount_show_disk.tmp d $ show logical/system/outp=diskmount_show_logical.tmp $ wso "Please wait - creating temporary listing file of disk-related logicals" $ search/match=and/outp=diskmount_show_disk_log.tmp - diskmount_show_logical.tmp """_", ":""" $ delete/nolog diskmount_show_logical.tmp;* $ $ open/write data diskmount_new.dat $ wd := write data $ wd "! " $ wd "! Prototype Diskmount utility data file" $ wd "! -------------------------------------" $ wd "! Data file will contain:" $ wd "! - (anywhere in file) comment lines indicated by ""!""" $ wd "! - (starting with the first ""*"" delimiter), multi-line entries" $ wd "! for each disk containing one item per line in order" $ wd "! (missing optional items still need a line containing ""-"")" $ wd "! [It is intended that each multi-line entry for mounting a disk may" $ wd "! contain additional lines of data (delimited in some way, such as ""\"")" $ wd "! that would be ignored by the diskmount program, but could be used by" $ wd "! another program (such as one to schedule backups) that reads the" $ wd "! same data file.]" $ wd "!" $ wd "! The actions of this program for any disk will be controlled by several" $ wd "! items on the first line of data for the disk, as follows:" $ wd "! &Disk_name:[M,D,R][.Class][.Condition]" $ wd "! - Disk_name is a unique ""name"" for the disk entry." $ wd "! - M-mount, D-dismount, R-reserve {M is currently the only valid choice}" $ wd "! - Class is a user-defined ""category"" of disks (such as system, work-disks," $ wd "! pagedisk, critical, phase-I, etc, etc), which can be used by telling" $ wd "! the program to mount all disks with a specific class. This could be" $ wd "! used, for example, to mount different groups of disks at different" $ wd "! stages of system startup." $ wd "! - Condition is an optional test (such as whether this node is a CI node" $ wd "! or a workstation) used to determine whether or not to mount this" $ wd "! particular disk on this system." $ wd "!" $ wd "! The format of each entry is as follows:" $ wd "! (items in [] are optional)" $ wd "! &Disk_name:[M,D,R][.class][.condition] !comments allowed here" $ wd "! Disk-data !comments allowed here" $ wd "! Label !comments allowed here" $ wd "! [Logical ] !comments allowed here" $ wd "! [Additional-logicals] !comments allowed here" $ wd "! [Preferred-path ] !comments allowed here" $ wd "! [Qualifiers ] !comments allowed here" $ wd "! [DFS_access_point] !comments allowed here" $ wd "! \secondary data (such as backup schedule for this disk)" $ wd "! " $ wd "! Examples of disk entries in data file:" $ wd "! --------------------------------------" $ wd "! &NOTESD:M.Critical.CI_NODE: !Notes disk (mount on CI node only)" $ wd "! DSA2005($11$dua111,$11$dua112) !Shadow, and physical device names" $ wd "! notes_disk !Label" $ wd "! NOTESD$ !Logical" $ wd "! - !additional logicals" $ wd "! HSC08 !Preferred path" $ wd "! rebuild !other qualifiers" $ wd "! DEC:.XXX.YYY.ZZZ.STAR_NOTESD$ !DFS access point (served on net)" $ wd "! \SLS data (ignored by diskmount utility)" $ wd "! " $ wd "!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ wd "!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ $ open/read disk_list diskmount_show_disk.tmp $ wso "" $ thisnode = f$getsyi("nodename") $ if thisnode .nes. "" then thisnode = "|" + thisnode $next_disk: $ name = "" $ disk = "" $ label = "" $ host = "" $ qual = "" $ logical = "" $ alt_log = "" $ read/end=no_more_disks disk_list record $ if f$locate(":",record) .eq. f$length(record) then goto next_disk $ disk_name = f$extract(0,f$locate(":",record)+1,record) $! Ignore DFS and Infoserver disks for now $ if f$locate("DFS",disk_name) .ne. F$LENGTH(disk_name) then goto next_disk $ if f$locate("DAD",disk_name) .ne. F$LENGTH(disk_name) then goto next_disk $ if f$getdvi(disk_name,"volnumber") .ne. 1 then goto next_disk $ $ $ qual = def_qual $ if f$getdvi(disk_name,"SWL") then qual = qual + ",nowrite" $ if f$locate("DAD",disk_name) .ne. F$LENGTH(disk_name) then - qual = qual + ",nomntverify" $ define/user sys$error NL: $ define/user sys$output NL: $ logical = f$getdvi(disk_name,"logvolnam") $ default_disk_logical = "DISK$" + f$getdvi(disk_name,"volnam") $ default_dad_logical = "DAD$" + f$getdvi(disk_name,"volnam") $ if logical .eqs. default_disk_logical then logical = "" $ if logical .eqs. default_dad_logical then logical = "" $ search/outp=diskmount_search_output.tmp - diskmount_show_disk_log.tmp 'disk_name' $ if $severity .eqs. "1" $ then $ open/read l_file diskmount_search_output.tmp $ read_logical: $ read/end=end_log l_file l_rec $ l_rec = f$element(0, "=", l_rec) $ l_rec = l_rec - """" - """" $ if logical .nes. "" then alt_log = alt_log + "," + l_rec $ if logical .eqs. "" then logical = l_rec $ goto read_logical $ end_log: $ close l_file $ alt_log = alt_log - "," $ endif $ delete/nolog diskmount_search_output.tmp;0 $ if logical .eqs. "" then logical = "-" $ if alt_log .eqs. "" then alt_log = "-" $ $ if f$getdvi(disk_name,"volsetmem") $ then ! volume set (may contain shadowsets) $! wso "Volume set" $ volset_loop: $ disk_name = f$getdvi(disk_name,"fulldevnam") - "_" $ if f$extract(0,3,disk_name) .eqs. "DAD" $ then $ disk = disk + ",DAD|" + (f$getdvi(disk_name,"logvolnam") - "DAD$") $ else $ disk = disk + "," + disk_name $ endif $ if f$getdvi(disk_name,"shdw_master") $ then ! Shadow disk IN volume set $ label = label + "," + f$getdvi(disk_name,"volnam") $ disk = disk + "(" $ next_disk = f$getdvi(disk_name,"shdw_next_mbr_name") - "_" $ if f$extract(0,2,f$getdvi(next_disk,"host_type")) .eqs. "HS" then - host = host + "," + f$getdvi(next_disk,"host_name") + thisnode $ disk = disk + next_disk $ next_disk = f$getdvi(next_disk,"shdw_next_mbr_name") $ if next_disk .nes. "" then disk = disk + "," + next_disk - "_" $ if next_disk .nes. "" then - if f$extract(0,2,f$getdvi(next_disk,"host_type")) .eqs. "HS" then - host = host + "," + f$getdvi(next_disk,"host_name") + thisnode $ disk = disk + ")" $ else $ label = label + "," + f$getdvi(disk_name,"volnam") $ if f$extract(0,2,f$getdvi(disk_name,"host_type")) .eqs. "HS" then - host = host + "," + f$getdvi(disk_name,"host_name") + thisnode $ endif $ disk_name = f$getdvi(disk_name,"nextdevnam") $ if disk_name .nes. "" then goto volset_loop $ disk = disk - "," $ label = label - "," $ host = host - "," $ $ else ! NOT volume set $ if f$getdvi(disk_name,"shdw_master") $ then ! Shadow disk (NOT volume set) $ label = f$getdvi(disk_name,"volnam") $ disk = disk_name + "(" $ next_disk = f$getdvi(disk_name,"shdw_next_mbr_name") - "_" $ if f$extract(0,2,f$getdvi(next_disk,"host_type")) .eqs. "HS" then - host = "," + f$getdvi(next_disk,"host_name") + thisnode $ disk = disk + next_disk $ next_disk = f$getdvi(next_disk,"shdw_next_mbr_name") $ if next_disk .nes. "" then disk = disk + "," + next_disk - "_" $ if next_disk .nes. "" then - if f$extract(0,2,f$getdvi(next_disk,"host_type")) .eqs. "HS" then - host = host + "," + f$getdvi(next_disk,"host_name") + thisnode $ disk = disk + ")" $ host = host - "," $ $ else ! Not shadow, NOT volume set $ if f$extract(0,3,disk_name) .eqs. "DAD" $ then $ disk = "DAD|" + (f$getdvi(disk_name,"logvolnam") - "DAD$") $ else $ disk = disk_name $ endif $ tmp_label = f$getdvi(disk_name,"volnam") $! if f$extract(0,5,tmp_label) .eqs. "CDBIN" .or. - $! f$extract(0,5,tmp_label) .eqs. "CDDOC" $! then $! label = f$extract(0,5,tmp_label) + "*" + f$extract(11,1,tmp_label) $! else $ label = tmp_label $! endif $ if f$extract(0,2,f$getdvi(disk_name,"host_type")) .eqs. "HS" then - $ host = f$getdvi(disk_name,"host_name") + thisnode $ endif $ endif $ $ if host .eqs. "" then host = "-" $ logical = f$edit(logical,"COLLAPSE") $ alt_log = f$edit(alt_log,"COLLAPSE") $ if logical .nes. "-" $ then $ name = logical $ else $ name = f$element(0,",",label) $ endif $ $ if f$length(disk) .gt. 55 $then $ wso_disk = f$extract(0,50,disk) + "....." $else $ wso_disk = disk $endif $ wso "Creating record: ''name' Device: ''wso_disk'" $! wso " ''label' ''logical' ''alt_log' ''host' ''qual'" $ if f$extract(0,3,wso_disk) .eqs. "DAD" $ then $ wd "&''name':M.DAD_CLASS.Condition_field ! Start of entry" $ else $ wd "&''name':M.Class_field.Condition_field ! Start of entry" $ endif $ if f$length(disk) .lt. 60 $then $ wd " ''disk' ! Disk device(s)" $else $ wd " ''f$extract(0,60,disk)' + ! Disk device(s)" $ if f$length(disk) .lt. 130 $ then $ wd " ''f$extract(60,70,disk)'" $ else $ wd " ''f$extract(60,70,disk)' +" $ if f$length(disk) .lt. 200 $ then $ wd " ''f$extract(130,70,disk)'" $ else $ wd " ''f$extract(130,70,disk)' +" $ if f$length(disk) .lt. 270 $ then $ wd " ''f$extract(200,70,disk)'" $ else $ wd " ''f$extract(200,70,disk)' +" $ if f$length(disk) .lt. 340 $ then $ wd " ''f$extract(270,70,disk)'" $ else $ wd " ''f$extract(270,70,disk)' +" $ wd " ''f$extract(340,254,disk)'" $ endif $ endif $ endif $ endif $endif $ $ wd " ''label' ! Label(s)" $ wd " ''logical' ! Primary logical" $ wd " ''alt_log' ! Additional logical (NOT yet implemented)" $ wd " ''host' ! Preferred Path" $ wd " ''qual' ! Qualifiers" $ wd "!Entered: ''f$extract(0,17,f$time())' by: ''f$getjpi("","username")' " $ wd "\ Additional data for other utilities (ignored by diskmount)" $ wd "\" $ wd "!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ goto next_disk $ctrl_y: $ wso "Terminated by CTRL/Y" $ goto close_files $no_more_disks: $ wso "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ wso "" $ wso "" $ wso "This procedure has created a data file DISKMOUNT_NEW.DAT" $ wso "" $ wso "Please review this file, make any necessary or desired changes" $ wso "and rename it DISKMOUNT.DAT when complete." $ wso "" $close_files: $ wso "Closing files, and deleting temporary files..." $ wso "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" $ close disk_list $ close data $ delete/nolog diskmount_show_disk_log.tmp;* $ delete/nolog diskmount_show_disk.tmp;* $ $EXIT