|
 |
栏目导栏 |
|
| |
|
|
|
|
 |
资料搜索 |
|
| |
|
|
|
|
 |
热门文章 |
|
| |
|
|
|
|
 |
最新文章 |
|
| |
|
|
|
| |
| |
|
|
|
[ 作者: Linux联盟收集 加入时间:2006-07-18 12:37:18 来自:Linux联盟收集
] | |
|
Retensioning a Magnetic Tape FLGLinux联盟 FLGLinux联盟 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. FLGLinux联盟 FLGLinux联盟 In this example, the tape in drive /dev/rmt/1 is retensioned: FLGLinux联盟 FLGLinux联盟 [color=red]oak% mt -f /dev/rmt/1 retension FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 Rewinding a Magnetic Tape FLGLinux联盟 FLGLinux联盟 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. FLGLinux联盟 FLGLinux联盟 In this example, the tape in drive /dev/rmt/1 is rewound: FLGLinux联盟 FLGLinux联盟 [color=red]oak% mt -f /dev/rmt/1 rewind FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 Showing the Status of a Magnetic Tape Drive FLGLinux联盟 FLGLinux联盟 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. FLGLinux联盟 FLGLinux联盟 In this example, there is no tape in drive /dev/rmt /1: FLGLinux联盟 FLGLinux联盟 [color=red]oak% mt -f /dev/rmt/1 status FLGLinux联盟 /dev/rmt/1: no tape loaded or drive offline FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 In this example, status is shown for the tape in drive /dev/rmt/1: FLGLinux联盟 FLGLinux联盟 [color=red]oak% mt -f /dev/rmt/1 status FLGLinux联盟 Archive QIC-15Ø tape drive: FLGLinux联盟 sense key(Øx6)= unit attention residual= Ø retries= Ø FLGLinux联盟 file no= Ø block no= Ø FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 The tar Command FLGLinux联盟 FLGLinux联盟 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. FLGLinux联盟 FLGLinux联盟 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. FLGLinux联盟 FLGLinux联盟 Copying Files to a Tape (tar) FLGLinux联盟 FLGLinux联盟 Follow these steps to copy files to a tape: FLGLinux联盟 FLGLinux联盟 1. Change to the directory that contains the file you want to copy. FLGLinux联盟 2 Insert a write-enabled tape into the tape drive. FLGLinux联盟 FLGLinux联盟 FLGLinux联盟 -------------------------------------------------------------------------------- FLGLinux联盟 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. FLGLinux联盟 -------------------------------------------------------------------------------- FLGLinux联盟 FLGLinux联盟 Type tar cvf /dev/rmt/n filename filename filename ... and press Return. FLGLinux联盟 FLGLinux联盟 The c (copy) option copies the files you specify, the v (verbose) option displays information about the files as they are copied, and the f (files) option followed by the tape device name specifies where the tar files are to be written. The file names you specify are copied to the tape, overwriting any existing files on the tape. FLGLinux联盟 FLGLinux联盟 FLGLinux联盟 -------------------------------------------------------------------------------- FLGLinux联盟 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. FLGLinux联盟 -------------------------------------------------------------------------------- FLGLinux联盟 FLGLinux联盟 4. Remove the tape from the drive and write the names of the files on the tape label. FLGLinux联盟 In this example, two files are copied to a tape in tape drive 0: FLGLinux联盟 FLGLinux联盟 [color=red]oak% cd /home/winsor FLGLinux联盟 oak% ls evaluation* FLGLinux联盟 evaluation.doc evaluation.doc.backup FLGLinux联盟 oak% tar cvf /dev/rmt/Ø evaluation* FLGLinux联盟 a evaluation.doc 86 blocks FLGLinux联盟 a evaluation.doc.backup 84 blocks FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 Listing the Files on a Tape (tar) FLGLinux联盟 FLGLinux联盟 Follow these steps to list the files on a tape: FLGLinux联盟 FLGLinux联盟 1. Insert a tape into the tape drive. FLGLinux联盟 2. Type tar tvf /dev/rmt/n and press Return. The t (table) option lists the files you specify, the v (verbose) option displays complete information about the files as they are listed in a form similar to the ls -l command, and the f (files) option followed by the tape device name specifies the device where the tar files are located. FLGLinux联盟 In this example, the table of contents for the tape in drive 0 contains two files: FLGLinux联盟 FLGLinux联盟 [color=red]oak% tar tvf /dev/rmt/Ø FLGLinux联盟 rw-rw-rw-6693/1Ø 44032 Apr 23 14:54 1991 evaluation.doc FLGLinux联盟 rw-rw-rw-6693/1Ø 43008 Apr 23 14:47 1991 evaluation.doc.backup FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 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. FLGLinux联盟 FLGLinux联盟 Appending Files to a Tape (tar) FLGLinux联盟 FLGLinux联盟 Follow these steps to append files without overwriting files already on the tape: FLGLinux联盟 FLGLinux联盟 1. Change to the directory that contains the file you want to copy. FLGLinux联盟 2. Insert a tape that is not write-protected into the tape drive. FLGLinux联盟 3. Type tar rvf /dev/rmt/n filename filename filename ... and press Return. The file names you specify are appended to the files already on the tape in the drive you specify. FLGLinux联盟 FLGLinux联盟 FLGLinux联盟 -------------------------------------------------------------------------------- FLGLinux联盟 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. FLGLinux联盟 -------------------------------------------------------------------------------- FLGLinux联盟 FLGLinux联盟 4. Remove the tape from the drive and write the names of the files on the tape label. FLGLinux联盟 In this example, one file is appended to the files already on the tape in drive 0: FLGLinux联盟 FLGLinux联盟 [color=red]oak% cd /home/winsor FLGLinux联盟 oak% tar cvf /dev/rmt/Ø junk FLGLinux联盟 a junk 1 blocks FLGLinux联盟 oak% tar rvf /dev/rmt/Ø FLGLinux联盟 rw-rw-rw-6693/1Ø 44032 Apr 23 14:54 1991 evaluation.doc FLGLinux联盟 rw-rw-rw-6693/1Ø 43008 Apr 23 14:47 1991 evaluation.doc.backup FLGLinux联盟 rw-rw-rw-6693/1Ø 18 Dec 1Ø 11:36 1991 junk FLGLinux联盟 oak%[/color] FLGLinux联盟 FLGLinux联盟 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.FLGLinux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论 |
|
|
|
|
|