How to use the tape drive under Linux

How to use the tape drive under Linux This link address: http://www.ttlsa.com/html/1081.html 1. Tape backup unit identification RedHat Linux supports many different types of tape devices. Typically, SCSI tape devices will be named / dev / st0, / dev / st1 or / dev / nst0, / dev / nst1 IDE tape device, etc. will be named / dev / ht0, / dev / ht1 / or dev / nht0, / dev / nht1 rewind, etc. If the device name has n before, represents a non-rewinding (No rewind), not automatically after the dump or tar. Check whether recognized TBU device: # cat proc / scsi / scsi lists the vendor, model, firmware version, access type and other information 2. Use tape mt mt control tools can be used to control the drive. # Yum install mt-st MT Usage: mt [-v] [-h] [-f device] command [count] such as: # mt -f / dev / st0 offline eject the tape # mt -f / dev / st0 status view the status of # mt -f / dev / st0 erase erase tape # mt -f / dev / st0 rewind rewind If you do not specify the -f parameter, mt default / dev / tape device. Create a soft link for easy maintenance # ln -s / dev / st0 / dev / tape so the above command can be abbreviated as # mt offline # mt status # mt erase # mt rewind 3. Backup with tar: # tar cvf / dev / st0 / home // backup / home directory # tar tvf / dev / st0 // check tape # tar xvf / dev / st0 // return to the current directory # tar zcf / dev / st0 / home // use gzip compression # tar zxf / dev / st0 // decompress 4. Backup with cpio cpio is another popular backup solutions, cpio may incremental backup or restore data, according to the file name, owner, timestamps, access to the archived data to be sorted. Cpio three modes of work: copy out mode, copy in mode, and copy pass mode. Use copy out mode to write files to the tape drive. copy out mode is often used in conjunction with the find command. # Find / home | cpio -ocv> / dev / st0 // the / home directory contents backed up to tape # cpio -tvF / dev / st0 // check the tape using the copy in archive mode to restore from the archive object file # cpio -icv </ dev / st0 // restore data to the current directory cpio can also be used to compress the tar archive # find / tmp | cpio -ovH tar> / dev / st0 # tar -tvf / dev / st0 // verification contents of the tape # cpio -ivH tar </ dev / st0 // perform recovery 5. use the dump / restore backup dump / restore tool specifically for the ext2 file system development. dump can be used to perform a full or incremental backup. dump usually full recovery, because its purpose is to back up the entire partition. # Dump -0u -f / dev / st0 / home // backup entire partitions because the dump is designed to incremental backups, you should always start from level 0 backup. Level obtained from the / etc / dumpdates file, showing the most recent backup. # Cat / etc / dumpdates # touch / home / ttlsa. com # dump -1u -f / dev / st0 / home restore tool to restore the failed partition. To perform a restore, the first is to create a new partition, mount, and formatted into ext2 file format. Next tape insertion level 0, the switching to the directory to be restored, the following: # restore -rf / dev / st0 perform level 0 After recovery, by subsequent incremental recovery / etc / dumpdates. This link address: How to use the tape drive under Linux

Reproduced in: https: //my.oschina.net/766/blog/211467

Guess you like

Origin blog.csdn.net/weixin_33922672/article/details/91546276