Previous | Table of Contents | Next |
If errors occur when reading a tape, retension the tape, clean the tape drive, and then try again. Type mt -f /dev/rmt/n retension and press Return. The tape in the tape drive you specify is retensioned.
In this example, the tape in drive /dev/rmt/1 is retensioned:
oak% mt -f /dev/rmt/1 retension oak%
To rewind a magnetic tape, type mt -f /dev/rmt/n rewind and press Return. The tape in the tape drive you specify by the device number n is rewound.
In this example, the tape in drive /dev/rmt/1 is rewound:
oak% mt -f /dev/rmt/1 rewind oak%
To show the status of a magnetic tape drive, type mt -f /dev/rmt/n status and press Return. Status for the tape drive you specify is displayed.
In this example, there is no tape in drive /dev/rmt /1:
oak% mt -f /dev/rmt/1 status /dev/rmt/1: no tape loaded or drive offline oak%
In this example, status is shown for the tape in drive /dev/rmt/1:
oak% mt -f /dev/rmt/1 status Archive QIC-15Ø tape drive: sense key(Øx6)= unit attention residual= Ø retries= Ø file no= Ø block no= Ø oak%
Use the tar command to copy files and directory subtrees to a single tape. The advantages of the tar command are that it is available on most UNIX operating systems and public domain versions are readily available. The disadvantages of the tar command are that tar is not aware of file system boundaries, full path name length cannot exceed 255 characters, it does not copy empty directories or special files such as device files, and it cannot be used to create multiple tape volumes.
The following sections describe how to use the tar command to copy files to a tape, list the files, append the files, and retrieve the files.
Follow these steps to copy files to a tape:
CAUTION! Copying files to a tape using the c option to tar destroys any files already on the tape. If you want to preserve the files already on the tape, use the r option described in "Appending Files to a Tape (tar)" later.
NOTE: You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file name argument. If you specify a directory name as the file name, the directory and all its subdirectories are recursively copied to the tape.
In this example, two files are copied to a tape in tape drive 0:
oak% cd /home/winsor oak% ls evaluation* evaluation.doc evaluation.doc.backup oak% tar cvf /dev/rmt/Ø evaluation* a evaluation.doc 86 blocks a evaluation.doc.backup 84 blocks oak%
Follow these steps to list the files on a tape:
In this example, the table of contents for the tape in drive 0 contains two files:
oak% tar tvf /dev/rmt/Ø rw-rw-rw-6693/1Ø 44032 Apr 23 14:54 1991 evaluation.doc rw-rw-rw-6693/1Ø 43008 Apr 23 14:47 1991 evaluation.doc.backup oak%
Reading from left to right, the first column shows the permissions for the file; the second column shows the UID and GID file ownership; the third column shows the number of characters (bytes) in the file; the fourth, fifth, sixth, and seventh columns contain the month, day, date, and year the file was last modified, and the final column contains the name of the file.
Follow these steps to append files without overwriting files already on the tape:
NOTE: You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file name argument.
In this example, one file is appended to the files already on the tape in drive 0:
oak% cd /home/winsor oak% tar cvf /dev/rmt/Ø junk a junk 1 blocks oak% tar rvf /dev/rmt/Ø rw-rw-rw-6693/1Ø 44032 Apr 23 14:54 1991 evaluation.doc rw-rw-rw-6693/1Ø 43008 Apr 23 14:47 1991 evaluation.doc.backup rw-rw-rw-6693/1Ø 18 Dec 1Ø 11:36 1991 junk oak%
You can put more than one set of tar files on a tape if you use the n (no-rewind) option as part of the tape device name. For example, type tar cvf /dev/rmt/nn filename. The tape is not rewound after the files are copied, and the next time you use the tape, the files are written at the end of the previous set of files.
Previous | Table of Contents | Next |