Updated: 11 December 1998 |
OpenVMS User's Manual
Previous | Contents | Index |
This chapter describes how to allocate, initialize, and mount a device for private use. It includes information about:
For additional information, refer to:
If all the files you create and use are located on devices managed by a system manager, you might not need to learn how to access a tape or disk drive. The system manager can set up logical names to refer to the devices you need to use. You can then read, write, and copy files to and from the device by using the logical name. In most cases, the system manager sets up and maintains devices that are shared by a group of users.
If you have a tape or disk drive available for your private use (for example, if your workstation includes an integral tape or diskette drive), you should be familiar with a few commands for accessing those devices. Diskettes and diskette drives are one type of disk device. For simplicity, this chapter uses the generic term disks to refer to all types of disks.
Although a disk or tape is for your exclusive use, anyone with physical access to it can read its contents on some system. It is good practice to keep disks and tapes in a safe place and to erase sensitive data before recycling them so the next user cannot read their contents. |
In this chapter, storage media are sometimes referred to as volumes. While the storage media itself is a piece of hardware, you can think of it in terms of its stored data; a volume is a disk or tape that has an organized collection of data.
To perform your work on a device that cannot be accessed by other users, you can create a private volume and mount it on a device allocated exclusively for you. The steps for setting up a private volume are as follows:
Step | Task |
---|---|
1 | Use the DCL command ALLOCATE to assign the device (disk or tape) drive to your process. |
2 | Use the DCL command INITIALIZE to format the disk or tape volume and write an identifying label on the volume. |
3 | Use the DCL command MOUNT to make a volume and the files or data it contains accessible to your process. |
Although you can print a file from a privately owned volume, the volume containing the file to be printed must remain mounted until after the file has completed printing. If you want to dismount the volume before the file is done printing, copy the file directly to the printer. For example:
$ COPY MYPHILE.DAT LPA0: |
To display information about volumes that are on your system, enter the SHOW DEVICES command. To obtain additional information or information about a specific device, enter the SHOW DEVICES command in one of the following ways:
In the following example, the SHOW DEVICES command displays the available devices DMA1: and MTA1:
$ SHOW DEVICES Device Device Error Volume Free Trans Mnt Name Status Count Label Blocks Count Cnt DMA2: Mounted 0 BACKUP_FILE 4442 7 1 MTA1: Online 0 . . . |
When you allocate a device, you reserve the device for exclusive use by your process. The device remains allocated to your process until you explicitly deallocate it (with the DCL command DEALLOCATE) or until you log out.
Before you can use files or data on a private volume, you must allocate (locally assign) a disk or tape drive to your process with the DCL command ALLOCATE. The format for the ALLOCATE command is as follows:
ALLOCATE device-name[:] [logical-name] |
The elements are as follows:
device-name | Specifies the drive on which the volume is loaded. The name can be a physical name, a generic name, or a logical name. |
logical-name | Specifies an optional logical name to be associated with the device. |
Table 12-1 summarizes the ways in which you can allocate a device.
Example | Explanation |
---|---|
To allocate a specific physical device:
$ ALLOCATE DMB2: |
Uses a physical device name (DMB2) to request the allocation of a specific RK06 or RK07 disk drive (unit 2 on controller B). |
To allocate the first available device:
$ ALLOCATE DM: DISK |
Uses the generic device code DM to allocate the first available RK06 or RK07 disk device. In addition, creates the logical name DISK in the process logical name table and assigns it to the name of the allocated device. |
To allocate a device by logical name:
$ ALLOCATE DRIVE1: D1 |
Allocates DRIVE1 (a logical name that translates to the physical device DBA3) and assigns a new logical name D1 to the allocated device. |
To select a particular device type:
$ ALLOCATE/GENERIC RK07 MYDISK |
Uses the /GENERIC qualifier to allocate a particular type of device (an RK07 disk). |
To specify a list of generic devices:
$ ALLOCATE MF,MT,MS DRIVE |
Specifies a list of generic device names; the first available device
(MTA0) is the only one to be allocated. In addition, assigns the
logical name DRIVE to MTA0.
The ALLOCATE command allocates only one device to a process. Therefore, although each element in the list represents a unique, generic device type, only one of the specified generic devices is allocated. |
Initializing a disk or tape volume allows you to write files to that disk or tape. To initialize a volume, use the DCL command INITIALIZE, which does the following:
The INITIALIZE command does not prevent you from initializing another user's volume; to be sure the volume you initialize is your own, allocate the device before you initialize the volume. |
If you give a volume to another user for initialization (for example, if you lack sufficient privileges to initialize a particular volume), you should provide the volume label, the owner UIC, and the protection code for the volume.
The format for the INITIALIZE command is as follows:
INITIALIZE device-name[:] volume-label |
The fields are as follows:
device-name | Specifies the name of the device on which the volume is physically mounted. |
volume-label | Identifies the volume. You can specify up to 12 alphanumeric characters for a disk volume or up to 6 alphanumeric characters for a magnetic tape volume. |
By default, the INITIALIZE command builds a Files--11 structure on your new volume. The default format for disk volumes initialized for or by the OpenVMS operating system is called the Files--11 On-Disk Structure Level 2. The INITIALIZE command can also initialize disk volumes in Files--11 On-Disk Structure Level 1.
You do not need special privileges to override logical protection on a blank disk volume (that is, a volume that has never been written to) or on a disk volume that is owned by your current UIC or by UIC [0,0]. In all other cases, you must have user privilege VOLPRO to initialize a disk volume.
The following example initializes the volume on DMA1 and labels the volume ACCOUNTS:
$ INITIALIZE DMA1: ACCOUNTS |
The default format for magnetic tape volumes produced by the INITIALIZE command is based on Level 3 of the American National Standards Institute (ANSI) X3.27-87 and International Standards Organization (ISO) standards for magnetic tape labels and file structure for informational interchange.
If you use ANSI "a" characters (which are not alphanumeric) on the volume label on magnetic tape, you must enclose the volume name in quotation marks.
The following example initializes the volume on MTB1 and labels the volume SOURCE:
$ INITIALIZE MTB1: SOURCE |
Before you attempt to use files or data on an allocated disk or tape volume, make sure the volume is mounted. The DCL command MOUNT makes a volume and the files or data it contains accessible to your process.
When you enter the MOUNT command, the system verifies that the following conditions have been met:
You can mount a single volume or a volume set. Binding volumes into a volume set allows you to extend the space available for your files by adding volumes to the same set, rather than by defining multiple, new volumes. The procedures for creating and mounting volume sets (as opposed to single volumes) are described in the OpenVMS System Manager's Manual.
The MOUNT command format is as follows:
MOUNT device-name[:][,...] [volume-label[,...]] [logical-name[:]] |
The elements are as follows:
device-name | Specifies the physical device name or logical name of the device on which the volume is to be mounted. |
volume-label | Specifies the label with which the volume was initialized. You do not need to specify the volume label if you use one of the following MOUNT qualifiers: /FOREIGN, /NOLABEL, or /OVERRIDE=IDENTIFICATION. |
logical-name | Defines a name to be associated with the device. If you omit the logical name, the MOUNT command assigns the default logical names DISK$volume-label and TAPE$volume-label to disk and tape drives, respectively. |
Operators can perform the physical mounting (and dismounting) of both system and private volumes. If no operator is available (operator is not enabled) to receive and respond to a MOUNT request, a message is displayed to inform you of the situation. A volume placed in the requested drive needs no additional operator assistance. Note that you can specify the /NOASSIST qualifier to avoid operator assistance.
MOUNT messages are sent to all operators enabled to receive TAPE and DISK messages. Thus, if operator assistance is needed for mounting a disk device, a message is sent to disk operators.
The MOUNT command shown here notifies the operator of your mount request and displays a message at your terminal:
$ MOUNT DMA1: DISK VOL1 %MOUNT-I-OPRQST, PLEASE MOUNT DEVICE _MARS$DMA1: |
After the device has been successfully mounted, you are notified with the following message:
%MOUNT-I-MOUNTED, DISK mounted on _DMA1: |
The following example shows how to allocate, initialize, and mount a disk volume:
$ ALLOCATE DMA2: TEMP %DCL-I-ALLOC, _MARS$DMA2: allocated $ INITIALIZE TEMP: BACKUP_FILE $ MOUNT TEMP: BACKUP_FILE %MOUNT-I-MOUNTED, BACKUP_FILE mounted on _DMA2: $ CREATE/DIRECTORY TEMP:[ARCHIE] |
Before you can place any files on the volume, you must create a
directory, as shown by the CREATE/DIRECTORY command.
12.5.2 Mounting a Foreign Disk Volume
To mount a foreign disk volume (that is, one having a file structure other than Files--11), use the /FOREIGN qualifier. For example:
$ MOUNT/FOREIGN DISK %MOUNT-I-MOUNTED, BACKUP_FILE mounted on DISK$DMA2: |
The MOUNT/FOREIGN command makes the contents of your volume available to the system but makes no assumptions concerning its file structure. In the preceding example, MOUNT reports a volume label, indicating that the disk has a Files--11 structure, even though it was mounted as a foreign device. If a disk does not have a recognized file structure, MOUNT does not display a label.
Note that you need the user privilege VOLPRO to mount a Files--11
structured disk with the /FOREIGN qualifier, unless its owner UIC
matches your own.
12.5.3 Mounting Magnetic Tape Volumes
When you use the MOUNT command to mount a magnetic tape volume, the system checks to see whether the volume has an ANSI-labeled format. If the format is ANSI-labeled, MOUNT checks the following:
The command shown in the following example mounts an ANSI-labeled volume and assigns a logical name to it:
$ MOUNT MT: SYSTPV ET %MOUNT-I-OPRQST, please mount volume SYSTPV in device $MTA1: %MOUNT-I-MOUNTED, SYSTPV mounted on MTA1: %MOUNT-I-RQSTDON, operator request canceled -- mount completed successfully |
MOUNT finds an available MT drive, MTA1, and requests operator
assistance. The message displayed indicates which drive has been
selected. At this point, you (or the operator) load the magnetic tape
on the drive and the mount operation completes. No operator response is
necessary. The display informs you that the volume named SYSTPV is
mounted on the drive MTA1. Although MOUNT does not require a logical
name, this example assigns the logical name ET to the volume SYSTPV.
12.6 Accessing Files on Private Devices
To access a file that is on a private device, you must either specify the device name or use the SET DEFAULT command to set default to the device. For files on disks, you must also specify the directory name.
You can use physical, logical, or generic names described in the
following sections to refer to devices. In addition, if your system is
part of an OpenVMS Cluster system, certain devices are accessible to
all members of an OpenVMS Cluster system. Section 12.6.4 describes the
syntax for OpenVMS Cluster device names.
12.6.1 Using Physical Device Names
Each physical device known to the system is uniquely identified by a physical device name. The physical device name identifies the kind of device; for example, a storage disk or a terminal.
Most physical device names consist of:
For information on specific device-naming formats, see the OpenVMS System Manager's Manual.
When a disk or tape is mounted on a device, the system recognizes it as a volume. The system also recognizes volume sets. A volume set consists of two or more related volumes. To access a file on a tape volume set, specify any device that has been allocated to it.
To access a file on a disk volume set, you have the following options:
If you do not specify a device name, the system supplies the current default device name. For more information on volumes and volume sets, see the OpenVMS System Manager's Manual.
Some commands accept output file specifications. You can replace an output file specification with the name of a record-oriented device such as a printer or a terminal. For example:
$ COPY DISFILE.DAT TTB4: |
The COPY command sends the file DISFILE.DAT to the terminal named TTB4.
The terminal accepts and displays the file one record at a time. When
you use a device name as a file specification, follow the device name
with a colon (:).
12.6.2 Using Logical Device Names
Your system manager can set up logical device names to represent the devices on your system. Logical device names equate a somewhat cryptic device name to a short, meaningful name. You can use these logical device names, rather than the physical device names, to refer to devices.
When you use a logical device name in a file specification, follow it with a colon.
Chapter 13 describes in more detail how to use logical names.
In the following example, COD1 is a logical device name for the device that contains the disk volume with the file [NOAH]ANIMALS.LIS:
$ TYPE COD1:[NOAH]ANIMALS.LIS |
As long as the system manager defines the logical name COD1 correctly,
the system can access the file, regardless of where the volume is
mounted.
12.6.3 Using Generic Device Names
A generic device name consists of the device code and omits the specific controller or unit number. When you use a generic device name with the MOUNT or ALLOCATE commands, the system locates the first available controller or device unit whose physical name satisfies the portions of the generic device name you specified.
If you specify a generic device name for any other command, the following defaults apply:
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
6489PRO_028.HTML
|