Use of tape drives

Source: Internet
Author: User
Tags rewind
The usage of the tape drive-Linux Enterprise Application-Linux server application information. The following is a detailed description. In Linux, the device name of the SCSI tape drive is/dev/nst0 or/dev/st0. n indicates that the tape is not rolled back after it is backed up, so that it can be backed up on one tape multiple times.

KDat and taper can be used in the image. The following describes how to use the command.

The commonly used commands for operating tapes are mt. Below are some commonly used tape operation commands. For details, refer to the manual page.

Mt-f/dev/nst0 status: view the tape status
Mt-f/dev/nst0 rewind: roll back the tape to the header
Mt-f/dev/nst0 offline: exit the tape
Mt-f/dev/nst0 retension: Re-tighten the tape. First roll back to the tape header, then to the end of the tape, and then back to the tape Header
Mt-f/dev/nst0 fsf n: Skip n files forward. If you want to locate the nth file, return to the tape header first.
Mt-f/dev/nst0 bsf: Skip n files backwards

Mt-f/dev/nst0 status is very useful. The displayed information contains block numbers, which shows the position of the current tape header, file number indicates the number of files (starting from 0 ). Example:
Mt-f/dev/nst0 rewind
Mt-f/dev/nst0 status --> file number: 0 block number: 0 here 0 represents the beginning of a file
Cpio-ivct </dev/nst0
Mt-f/dev/nst0 status --> file number: 0 block number: n here n is the number of files just read
Mt-f/dev/nst0 fsf
Mt-f/dev/nst0 status --> file number: 1 block number: 0
Mt-f/dev/nst0 bsf
Mt-f/dev/nst0 status --> file number: 0 block number:-1 here-1 indicates the end of a file
Mt-f/dev/nst0 fsf 2
Mt-f/dev/nst0 status --> file number: 2 block number: 0

Remember: fsf always looks for the beginning of the next file, and bsf always looks for the end of the next file

If the block number displayed in the mt-f/dev/nst0 status is not 0, when you use cpio to read the content of the tape, it will always read the end of the tape and then pop up the tape.

We recommend that you do not use the compression method to back up the tape. The reason is that if a part of the tape breaks down, the entire backup will fail! We recommend that you use cpio to back up tape. The disadvantage is that it is slower than tar backup.

Tar is commonly used for backup. There is a backup policy that needs to be considered. General backup methods include full backup, Incremental backup, and update backup, if the update mode is not frequent, you can use full backup and update backup. If the update mode is frequent, you can consider full backup and Incremental backup, or use multiple backup modes.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.