Document revision date: 15 July 2002
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS User's Manual

Previous Contents Index

Chapter 6
Using Disk and Tape Drives

This chapter describes general concepts about working with disk and tape drives on an OpenVMS system. Any peripheral connected to an OpenVMS system, including disk and tape drives, is referred to as a device. When you log in you are automatically granted access to your default device and directory. You can also access public devices and directories. In most cases, the system manager sets up and maintains devices that are shared by a group of users.

If there is a drive available for your personal use, you need to know how to allocate, initialize, and mount it. This chapter discusses the following concepts for those who will be implementing their own disk and tape drive access:

For additional information, refer to:

6.1 Physical Device Names

Each physical device known to the system is uniquely identified by a physical device name. The physical device name identifies the type of device; for example, a disk drive or a terminal.

Most physical device names consist of:

VTA12, FX09, and DAD44 are examples of device names.

For information on specific device-naming formats, refer to the OpenVMS System Manager's Manual.

6.2 Displaying Device Information

To display information about devices that are on the 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 information about DAD40:

Device         Device           Error    Volume         Free  Trans Mnt 
 Name          Status           Count     Label        Blocks Count Cnt 
DAD40:         Mounted wrtlck       0     CHICAGO      540088     1   1

6.3 Logical Device Names

Your system manager can set up logical device names to represent the devices on the 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.

Chapter 11 describes in detail how to use logical names.

6.4 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 a MOUNT or ALLOCATE command, 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:

6.5 OpenVMS Cluster Device Names

An OpenVMS Cluster device name includes the name of the node to which the device is attached and the physical device name, separated by a dollar sign ($). For example, ROXXY$DUA1 refers to disk DUA1 on node ROXXY.

As a general rule, always use a node allocation class device name to identify dual-pathed OpenVMS Cluster disks. It is the only name that all OpenVMS Cluster nodes recognize at all times.

For more information about using the device name format in OpenVMS Cluster environments, refer to OpenVMS Cluster Systems.

If a device is dual pathed (connected to two nodes), specify the OpenVMS Cluster device name in the following format:


The elements are:
node-allocation-class A value assigned to the nodes connecting a dual-pathed device. For example, $1$DJA16 identifies a disk that is dual pathed between two nodes that both have a node allocation class value of 1.
dd Represents device code of the hardware device type (for example, the device code DK represents an RZ23 disk).
c Identifies the hardware controller to which the device is attached. The controller designation, along with the unit number, identifies the location of the device within the hardware configuration of the system. Controllers are designated with alphabetic letters A to Z.
u Uniquely identifies the unit number of a device on a particular controller. Unit numbers are decimal numbers from 0 to 65535.

6.6 Volumes and Volume Sets

The OpenVMS operating system recognizes disks and tapes, separate from the actual hardware drives they occupy, as volumes. A volume is an organized collection of data. The system also recognizes volume sets. A volume set consists of two or more related volumes. 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 volume sets (as opposed to single volumes) are described in the OpenVMS System Manager's Manual.

6.7 Device Management

If you have a disk drive available for your private use, you should be familiar with the steps for setting it up, as follows:
Step Task
1 Use the DCL command ALLOCATE to assign the disk drive to your process.
2 Use the DCL command INITIALIZE to format the disk volume and write an identifying label on the volume, if needed.
3 Use the DCL command MOUNT to make a volume and the files or data it contains accessible to your process.

6.7.1 Allocating Devices

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.

To allocate (locally assign) a disk or tape drive to your process, use 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.

6.7.2 Initializing Volumes

Initializing a disk or magnetic tape volume formats it. You do not need to do this prior to every use of a volume. Initialize a volume before its first use and anytime you want to erase it entirely. 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 do it yourself), 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.

Initializing Disk Volumes

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 DKA300 and labels the volume ACCOUNTS:


6.7.3 Mounting Volumes

After allocating a disk volume, you need to mount it in order to use its files. The DCL command MOUNT makes a volume and the files 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. 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.

6.7.4 Requesting Operator Assistance

Operators can perform the physical mounting (and dismounting) of both system and private volumes. If a volume is already placed in the drive you are going to use, you do not need operator assistance.

MOUNT messages are sent to all operators enabled to receive TAPE and DISK messages. For example, if operator assistance is needed for mounting a disk device, a message is sent to disk operators. 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. You can also specify the /NOASSIST qualifier to avoid operator assistance.

The MOUNT command shown here notifies the operator of your mount request and displays a message at your terminal:


After the device has been successfully mounted, you are notified with the following message:

%MOUNT-I-MOUNTED, DISK mounted on _DKA300:

The following example shows how to allocate, initialize, and mount a disk volume:

%DCL-I-ALLOC, _MARS$DKA300: allocated

Before you can place any files on the volume, you must create a directory, as shown by the CREATE/DIRECTORY command.

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:


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.

6.8 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 and the directory name.

You can use physical, logical, or generic names 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. To access a file on a tape volume set, specify any device that has been allocated to it.

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.

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:


The COPY command sends the file DFILE.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 (:).

6.8.1 Dismounting Volumes

When you are done with the files on a disk or tape volume, you can use the DISMOUNT command to dismount the volume. Before a volume is dismounted, the DISMOUNT command checks for conditions that could prevent the dismount from completing. For example, if the volume contains installed swap and page files, installed images, or open user files, DISMOUNT displays an error message indicating that the volume cannot be dismounted.

By default, the DISMOUNT command automatically unloads the volume from the drive. If you plan to mount or initialize a volume again after you dismount it, you can save time and eliminate unnecessary handling of that volume by using the /NOUNLOAD qualifier. For example:


In this example, the magnetic tape volume is logically dismounted and the tape is rewound but the tape remains physically loaded on drive MTA1.

You should always explicitly dismount a volume with the DISMOUNT command before physically unloading the volume. Wait for the drive to unload before you remove the volume. (You can verify that the dismount is complete by entering the DCL command SHOW DEVICES.)

A volume is dismounted and unloaded automatically if you log out of the job from which you had mounted the volume. If the system fails, however, the volume is not automatically dismounted. If the device you are dismounting was allocated with an ALLOCATE command, it remains allocated after it is dismounted with the DISMOUNT command. If the device was implicitly allocated by the MOUNT command, the DISMOUNT command deallocates it.

Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement