From:	SMTP%"everhart@mail09.mitre.org" 15-AUG-1997 19:14:19.57
To:	everhart@gce.com (everhart@gce.com)
CC:	
Subj:	mount any disk without knowing label (src)

Return-Path: everhart@mail09.mitre.org
Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX);
	Fri, 15 Aug 1997 19:13:38 -0400
Received: from mbunix.mitre.org (mbunix.mitre.org [129.83.20.100]) by bort.mv.net (8.8.5/mem-951016) with ESMTP id PAA09469 for <everhart@gce.com>; Fri, 15 Aug 1997 15:37:19 -0400 (EDT)
Received: from TGATE3 (tgate3.mitre.org [129.83.20.27])
	by mbunix.mitre.org (8.8.6/8.8.6/mitre.0) with SMTP id PAA19640
	for <everhart@gce.com>; Fri, 15 Aug 1997 15:36:02 -0400 (EDT)
Received: from mail09.mitre.org (unverified [129.83.20.43]) by tgate3.mitre.org (EMWAC SMTPRS 0.83) with SMTP id <B0004301318@tgate3.mitre.org>; Fri, 15 Aug 1997 15:35:46 -0400
Received: by mail09.mitre.org; (5.65v3.2/1.1.8.2/22Jun94-0628PM) id AA20595; Fri, 15 Aug 1997 15:36:14 -0400
Subject: mount any disk without knowing label (src)
From: everhart@mail09.mitre.org (Glenn C. Everhart)
To: everhart@gce.com (everhart@gce.com)
Message-Id: <970815153612.6264@mail09.mitre.org.0>
Date: Fri, 15 Aug 97 15:36:13 -0400
X-Mailer: MailWorks 2.0-4

From - Fri Aug 15 15:25:26 1997
Path:
news.mitre.org!blanket.mitre.org!nntprelay.mathworks.com!howland.erols.net!iagn
et.net!192.160.127.82!ddsw1!news.mcs.net!ddsw1!not-for-mail
From: ddellutr@MCS.COM (Dale Dellutri)
Newsgroups: comp.os.vms
Subject: Re: ISO 9660/High Sierra Volume labels...
Date: 15 Aug 1997 11:00:47 -0500
Organization: Dale at MCSNet
Lines: 82
Message-ID: <5t1uff$r85$1@Mercury.mcs.net>
References: <v03007801b01916ccbc4e@[199.232.78.21]>
<01bca972$19d38630$54e562c7@dunham>
NNTP-Posting-Host: mercury.mcs.net
X-Newsreader: TIN [UNIX 1.3 unoff BETA release 961022]

In comp.os.vms Jim Dunham <dunham@omtool.com> wrote:
> >>> Re: ISO 9660/High Sierra Volume labels...
> >>> Can they be gotten from OpenVMS via standard DCL lexicals and/or system

Here is a com file that I wrote to mount any device /SYSTEM without
knowing the volume label.  It's self-explanatory.

$ on error then continue
$ say = "WRITE SYS$OUTPUT"
$ if p1 .eqs. "" .or. p1 .eqs. "?"
$ then
$  say "MOUNT_ANY.COM - Mount whatever disk is in a device."
$  say "(Dale Dellutri 1997-05-29)"
$  say " P1 = device"
$  exit
$ endif
$ say " "
$ say "MOUNT /SYSTEM ",p1," <whatever>"
$ say " "
$ if .not. f$getdvi(p1,"EXISTS")
$ then
$  say "*** Error: No such device: ",p1
$  exit %X10000002
$ endif
$ if f$getdvi(p1,"DEVCLASS") .ne. 1
$ then
$  say "*** Error: Device not a disk: ",p1
$  exit %X10000002
$ endif
$ assign mount_any.tmp sys$output
$ mount /noassist /system 'p1' ""
$ code = $status
$ deassign sys$output
$ show symbol code
$! %X107201A4 MEDOFL, medium is offline
$!   No disk in device.
$! %X1072006C DEVMOUNT, device is already mounted
$! %X1072010C INCVOLLABEL, incorrect volume label
$!   Files-11 volume, get correct label and re-try mount.
$! %X107208E4 NOHOMEBLK, Files-11 home block not found on volume
$!   ISO CDROM volume?  Get correct label and re-try with /MEDIA=CDROM.
$ if code .ne. %X1072010C .and. code .ne. %X107208E4
$ then
$  delete mount_any.tmp.0
$  exit code
$ endif
$ open /read lu_in mount_any.tmp
$ read lu_in a
$ read lu_in a
$ close lu_in
$ delete mount_any.tmp.0
$ if code .eq. %X1072010C  ! Files-11 format
$ then
$  i = f$locate("label = '",a)
$  if i .eq. f$length(a) then goto bad_mount_response
$  b = f$extract(i+9,f$length(a)-i-9,a)
$  j = f$locate("'",b)
$  if j .eq. f$length(b) then goto bad_mount_response
$  lbl = f$extract(0,j,b)
$  on error then exit
$  mount /noassist /system 'p1' 'lbl'
$  exit
$ endif
$ if code .eq. %X107208E4  ! ISO 9660 format, hopefully
$ then
$  i = f$locate("CDROM_ISO",a)
$  if i .eq. f$length(a) then goto bad_mount_response
$  b = f$extract(i+11,f$length(a)-i-11,a)
$  j = f$locate(":",b)
$  if j .eq. f$length(b) then goto bad_mount_response
$  lbl = f$extract(0,j,b)
$  on error then exit
$  mount /noassist /system /media_format=cdrom 'p1' 'lbl'
$  exit
$ endif
$bad_mount_response:
$ say "*** Error: Unknown response from MOUNT for device: ",p1
$ exit 0

This will give you any idea of how it can be done.
- -- 
Dale Dellutri <ddellutr@mcs.net>

