HP磁带机
There are several ways to use a tape machine on Linux, mainlythrough software such as Amanda and Tar.
Amanda provides the ability to provide remote centralizedbackup by setting the client side and the server side forremotecentralized storage. Tar is mostly used in a single machineenvironment to write data directly to a tape backup. For asingle node backup, simply use the Tar command for backup andrecovery.
The installation
For the current HP dat24/40 series of external SCSI tapemachines, all have automatic rollback functions. Take itoutside the SCSI bus and restart the server. After reboot, theexecution of the dmesgwill allowyou to see the new tapemachinedevice called /dev/st0.
Series: queue ef0d7a14, I/O limit of 4095 MB (mask 0 XFFFFFFFF)audit subsystem ver 0. 1 the initialized (scsi0: A: 3) : 10.000MB/s transfers (10.000 MHz, offset 15) Vendor: HP Model: C1537ARev: L805 Type: Sequential - Access ANSI SCSI revision: 02series: queue ef0e4614, I/O limit of 4095 MB (mask 0 XFFFFFFFF)Attached SCSI tape st0 at scsi0, channel 0, 3, id lun 0The tape operation
After loading the tape, you can do the following:
Rewind the tape to the starting position
Mt - f/dev/st0 rewind
Erase, erase the contents of the tape
Mt - f/dev/st0 erase
Note: erase work very slowly, and has damage to the tape, itis best not to perform, whenwriting data, can continue to writedata and cover the original data, and do not need to erase theaction. The new tape can be used immediately after it has beenopened, and it does not need to be erased.
Take the tape, roll the tape to the original position and thenpop up from the tape machine
Mt - f/dev/st0 offline
Data manipulation
The basic operations are as follows:
Column directory operations tar TVF/dev/st0
If there is no file on the tape, then the directorywill reportthe error, which has no relation and does not affect the useof the tape.
Root @ dev131 / root # tar TVF/dev/st0tar: / dev/st0: alwaysread: Input/output errortar:At the beginning of tape, quittingnowtar: the Error is not recoverable, exiting now root@dev131
/ root #
Write the data action tar CVF/dev/st0< to write the file name >There are two ways to write data: don't package it directly intothe file and package it to write the file. Each has itsadvantages and disadvantages. The method of not packagingdirectly into the file looks inefficient and complex, but canimprove the survival rate of the data. The tape is a linearstorage device, and all data is written next to the order. Whena point of tape is damaged, the rest of the tape can still beread, and the files can be read. If the method is packaged andcompressed, only one file is stored on the tape. Anywhere whenthe tape has malfunctioned can' t read, then the compressed filewill be lack of some details, even if it is a bit error, willalso result in CRC error can't extract the compressed filereport. So, if you're storing a lot of data, write it directly.If it is access to a small file, it is best to package it andadd a time tag to the file name.
For example, to write/root/test1.tar.gz to the tape andoverwrite the tape:
Tar CVF/dev/st0 test1. tar.gz
The speed of the tape is slower, for not a large file backup,wait a few seconds, and the write can be done. Using theparameter CVF will overwrite the existing files on this.Then list the files on the tape:
[root @dev131 / root] # tar TVF/dev/st0-rw-rw- r - root/root320 2006-1201. Tar.gz [root @dev131 / root] #
You can see the data written successfully.
Note: this command will only be written when the tape isentirely new, and the original data will be overridden on thesecond execution. In addition, using the tar command backup,the required backup file volume must be less than the capacityof a single disk of tape, which means a file cannot span twosets of tape. If this is the case, you can' t use the tar commandbackup, and you need to change the other backup programs to doso.
Continue to write the data tar RVF/dev/st0 < to write the filen ame >
Tape storage is a linear storage, and all data is written inturn. To not overwrite the contents of the front, use the RVFparameter to write the content when writing.
Tar RVF/dev/st0 test2. tar.gz
Once again, the RVF continues to write to other files:Tar RVF/dev/st0 test3. tar.gz
When the write is complete, check what files are on the tape:Root@dev131 /root#tar TVF/dev/st0-rw-r-r-320 root/root2006-12-01 09:29:02 test1. Tar. Gz -rw-r- r- 320 root/root
2006-12-01 09:44:19 test2. Tar. Gz -rw-r- r- 320 root/root2006-12-01 09:30:14 test3. Tar. Gz root @ dev131 / root #As you can see, the newly written files and the original filesare stored on the tape.
The linear storage feature of the tape makes it possible towrite the same file twice. For example, now the test3 file hasa file size change that is written to the tape again:Tar RVF/dev/st0 test3. tar.gz
Looking at the list of files, you can see the following fileson the tape:
Root@dev131 /root#tar TVF/dev/st0-rw-r-r-320 root/root2006-12-01 09:29:02 test1. Tar. Gz -rw-r- r- 320 root/root2006-12-01 09:30:14 test2. Tar. Gz -rw-r- r- 320 root/root2006-12-01 09:44:19 test3. Tar. Gz-rw-r-r-67085 root/root2006-12-01 09:44:19 test3. Tar. Gz root @ dev131 / root #Here you can see that there are two file names of the same nameon the tape. The two backup sizes of this file can be the sameor not the same.
Note: on tape if the file is written to the same times, therecovery time will be more troublesome, need to tape to documentstorage place, and then read the tape files stored in thecurrent position, more complicated to operate, speed is alsoslow. So it is not recommended to write the same file name ona tape. Before backing up, it is best to add a time tag to the
file name of the backup file so that you can find the backup.For example, the file name to be backed up istest-20061201-0930. tar.gz and test-20061201-0945.tar.gz,which is written to a tape. This makes it easier and faster toaccess and access operations when performing backup and restoreoperations.
Read the data tar XVF/dev/st0 < to read the file name >Before reading the data, check the content on the tape to getthe file name to be restored. For example, see the followingresults:
Root@dev131 /root#tar TVF/dev/st0-rw-r-r-320 root/root2006-12-01 09:29:02 test1. Tar. Gz -rw-r- r- 320 root/root2006-12-01 09:30:14 test2. Tar. Gz -rw-r- r- 320 root/root2006-12-01 09:44:19 test3. Tar. Gz root @ dev131 / root #Now restore the test3.tar.gz file, and execute the followingcommand:
Tar XVF/dev/st0 test3. tar.gz
After reading the data.
[root @dev131] # tar XVF/dev/st0 test3. tar.gz
You can then find the files that are read from the tape in thecurrent path:
[root @dev131 ~] # ls-l test3.tar.gz-rw-r -- r -- 1 root root
320 Dec 1 11: 12 test3. tar.gz
This completes the restore operation.
Using the tar command described above, you can use theTVF/CVF/RVF/XVF parameter to implement the read and writeoperation of the tape. The automatic backup can be implementedusing pre-written copy data scripts, combined with the tapemachine operation command, and placed in /etc/crontab.
华纳云怎么样?华纳云是香港老牌的IDC服务商,成立于2015年,主要提供中国香港/美国节点的服务器及网络安全产品、比如,香港服务器、香港云服务器、香港高防服务器、香港高防IP、美国云服务器、机柜出租以及云虚拟主机等。以极速 BGP 冗余网络、CN2 GIA 回国专线以及多年技能经验,帮助全球数十万家企业实现业务转型攀升。华纳云针对618返场活动,华纳云推出一系列热销产品活动,香港云服务器低至3折,...
CloudCone商家在前面的文章中也有多次介绍,他们家的VPS主机还是蛮有特点的,和我们熟悉的DO、Linode、VuLTR商家很相似可以采用小时时间计费,如果我们不满意且不需要可以删除机器,这样就不扣费,如果希望用的时候再开通。唯独比较吐槽的就是他们家的产品太过于单一,一来是只有云服务器,而且是机房就唯一的MC机房。CloudCone 这次四周年促销活动期间,商家有新增独立服务器业务。同样的C...
BuyVM在昨天宣布上线了第四个数据中心产品:迈阿密,基于KVM架构的VPS主机,采用AMD Ryzen 3900X CPU,DDR4内存,NVMe硬盘,1Gbps带宽,不限制流量方式,最低$2/月起,支持Linux或者Windows操作系统。这是一家成立于2010年的国外主机商,提供基于KVM架构的VPS产品,数据中心除了新上的迈阿密外还包括美国拉斯维加斯、新泽西和卢森堡等,主机均为1Gbps带...