

Once the label is in place, you must mount the tape with the
Once the tape is in position, you issue the
To use the BACKUP utility:
Generated with CERN WebMaker
Writing a Tape
To write a tape:
Before you create a tape, consider how the tape will be used. Some remote sites will not be able to read 4mm tapes created with the COMPACTION option because older drives did not have this capability; if you are mailing a tape off-site, ask the recipient what types of drives he or she has available. Similarly, you will most often want to use 9-track tapes at 6250 bpi, unless you know that an intended tape reader is incapable of handling that density.
Reading a Tape
To read files from a tape:
Write Protecting a Tape
Tapes can be physically set to either allow or prohibit writing of new files. When a tape prohibits writing, we say it is write-protected. When it allows files to be written, we say it is write-enabled. Different types of tapes are write-enabled or write-protected in different ways:

Figure 10.1: Write Protect Rings on 9-Track Tapes

Figure 10.2: Write Protect Holes in 8mm Tapes
Each tape drive is labeled with its device name. When you load the tape in the drive, note the device name to use in your commands.
Allocating a Drive
Only one user can use a tape drive at a time. Before you can use the drive, it must be reserved for your exclusive use. This is done with the ALLOCATE command. For example:
$ ALLOCATE $122$MKB500:
%DCL-I-ALLOC, _$122$MKB500: allocated
Once VMS allocates a tape drive to you, it must be initialized and mounted if you are using a new tape, or simply mounted if you have an existing tape. Initializing a New Tape
If you have a new tape, or if you want to completely erase an old tape, you will need to write a tape label on the tape. This is done with the INITIALIZE command. Before issuing the command, you should have allocated the drive, and placed the tape on the drive. Then you would type the INITIALIZE command, and respond to the prompts, for example:
$ INITIALIZE device_name
_Label: tape_label_name
The label may not be more than 6 characters long and is used to identify the tape to the system.MOUNT command. Mounting the Tape
Mounting a tape is a two-step process:
If you plan to use MOUNT command.BACKUP, turn to page 176 now. If you are not familiar with the tape drives, ask one of the operators for help in putting the tape on the drive.MOUNT command, which tells the system that the tape is ready to be used. Use the tape label that was assigned to the tape by the INITIALIZE step. The following listing shows how a mounting operation takes place (note that we are not using a logical name with this tape--just press
in response to the LOG NAME: prompt):
$ MOUNT $1212$MKB500:
-Label: tape_label_name
-Log name:
%MOUNT-I-MOUNTED tape_label_name mounted on _$122$MKB500:
If you are ready to mount a tape and do not know the label, you can find it as shown in Figure 10.3.

Figure 10.3: Finding Tape Label
Reading and Writing
Reading from and writing to a tape can be done with the COPY command, just like copying files anywhere else in the system. The difference is that the location of either the source or destination file will be identified as being a tape. Wildcards can be used to copy several files with a single command. Write Files from Disk to Tape
If you want to write files to a tape, be sure the tape is write enabled and then use the COPY command, for example:
$ COPY /LOG FILE_ONE.EXT $122$MKB500:FILE_TWO.EXT
List Files on Tape
You can see what files are on your tape using the DIRECTORY command, for example:
$ DIR $122$MKB500:
Read Files from Tape to Disk
The following command would be used to copy a file from the tape mounted on drive MTA1: to your current directory:
$ COPY $122$MKB500:FILE_TWO.EXT FILE_ONE.EXT
Cleanup: Dismounting and Deallocating
When you finish reading or writing your files on tape, be sure to dismount the tape and release the tape drive, otherwise other users cannot use the drive until you log off the system.
DISMOUNT command, for example:
$ DISMOUNT $122$MKB500:
DEALLOCATE command, for example:
$ DEALLOCATE $122$MKB500:
Using the BACKUP Utility
Writing to and reading from a tape can also be done with the BACKUP utility. Table 10.3 shows some of the more widely used BACKUP qualifiers. Type HELP BACKUP for more information. 
Table 10.3: BACKUP Qualifiers
ALLOCATE, as described on page 173) and initialize the tape if you are using a new tape or erasing an existing tape (see page 173). Then mount the tape using the MOUNT command with the /FOREIGN qualifier as in this example:
$ MOUNT/FOREIGN $122$MKB500:
% MOUNT-I-MOUNTED, 031595 mounted on _$122$MKB500: (PENN)
BACKUP command. The three examples on this page and the next show some ways that you might want to use this utility.
Use the /INTERCHANGE qualifier with the BACKUP command when the tape will be read by other users on other hosts. The /INTERCHANGE option prevents certain header information from being written that would prevent the file from being read.
Copying an Entire Directory Structure
To copy your entire directory tree structure and contents (i.e., all files in all directories under the current directory) to tape, use the syntax shown in Figure 10.4. Note that a file called a save set is stored on the tape; this contains the list of saved files and pointers used for later retrieval.

Figure 10.4: Backing Up a Directory Structure
It is a good idea to put a label on your tape with the save set name and the logical label name, if you used one.
Listing Contents of a Backup Tape
To list the names of files contained in the save set you have written to tape, use a command like the following:
$ BACKUP/REWIND/LIST $122$MKB500:031595.bck
Reading One File from Tape to Disk
To copy specific files from the backup tape to a disk on your system, use a command like the one shown in Figure 10.5.
Figure 10.5: Reading a File From a Backup Tape
Reading All Files From Tape to Disk
To copy the entire contents of a save set from tape to disk, set your default directory (SET DEF) to your top-level directory and then use a command like the one shown in Figure 10.6. Note the use of dots in directory specifications. 
Figure 10.6: Reading All Files From a Tape
No file on the disk will be superceded by a file on the tape unless a /NEW or /REPLACE qualifier is used. Directories are created on the disk by the BACKUP utility as needed.
Tape Processing Utility--TPU
TPU is a tape processing utility (available only on the Science Cluster) that can handle different format tapes without choking on errors. TPU is not a generic DEC program--it is site-specific. The following table describes some of the more commonly-used TPU functions. They are documented more fully in the following file:
SYS$LOCAL:[TPU]TPU.MEM

Table 10.4: TPU Functions
