Linux use Tape There are other ways, mainly by Amanda, Tar, etc. Software Operate.

Amanda is to provide a remote centralized backup feature, set by each client, Server End of the remote centralized storage backup. The Tar mainly used for stand-alone environment, the data is written directly to tape backup. Backup for a single node, as long as the use of simple commands Tar backup, recovery can be.


The current manufacturers HP DAT24/40 Series External SCSI tape drive, both with automatic rewind function. Be connected to the external SCSI bus on, and restart Server . After reboot, dmesg will see the implementation of the new tape drive device name / dev/st0.

Blk: queue ef0d7a14, I / O limit 4095Mb (mask 0xffffffff)

Audit subsystem ver 0.1 initialized

(Scsi0: A: 3): 10.000MB / s transfers (10.000MHz, offset 15)

Vendor: HP Model: C1537A Rev: L805

Type: Sequential-Access ANSI SCSI revision: 02

Blk: queue ef0e4614, I / O limit 4095Mb (mask 0xffffffff)

Attached scsi tape st0 at scsi0, channel 0, id 3, lun 0

Tape operation

Load the tape, the enforceability of the following:

Rewind, volume to the starting position of the tape

Mt-f / dev/st0 rewind

Erase, erase the contents of the tape

Mt-f / dev/st0 erase

Note: Erase work is very slow, and there is damage to the tape, it is best not to carry out, when data fills, it can continue to write data and cover the original data, not the implementation of erase action. Open the package immediately after a new tape can be used, do not need to erase.

The belt, the tape volume to the initial position and then pop up from the tape machine

Mt? F / dev/st0 offline

Data manipulation

Basic operation is as follows:

1. Out catalog operation tar tvf / dev/st0

If the tape does not have any files, are shown directory error, this error does not matter, does not affect the use of tape.

[Root @ dev131 / root] # tar tvf / dev/st0

Tar: / dev/st0: Cannot read: Input / output error

Tar: At beginning of tape, quitting now

Tar: Error is not recoverable: exiting now

[Root @ dev131 / root] #

2. Write data operation tar cvf / dev/st0

Write data in two ways: not packaged directly written to the file and write the compressed package files. Both have advantages and disadvantages. Do not write files directly to the methods package, it seems inefficient, complicated operation, but can improve the survival rate of the data. Tape is a linear storage devices, all data is written next to the order. When the tape when a point of damage to the other location can continue to read the tape, which also can read the paper. If using packaged compressed way to write, then the tape is only one file is stored. When the tape there is a failure of any one place can not be read, then the compressed file will be missing some of the details, even a bit of error, the report will lead to compressed file CRC error can not be extracted. Therefore, if a large amount of data stored, it is recommended to write directly. If you are accessing small files, then the best packaged and labeled to the file name plus the time to write.

Such as to / root/test1.tar.gz written to the tape and cover the contents of the tape:

Tar cvf / dev/st0 test1.tar.gz

Tape drive speed slow, not great for file backup, wait a few seconds, write to complete. Using the parameters cvf will cover this belt existing file.

Then lists the files on tape:

[Root @ dev131 / root] # tar tvf / dev/st0
-Rw-r – r – root / root 320 2006-12-01 09:29:02


[Root @ dev131 / root] #

Can see that data is written successfully.

Note: This command can only be written when the tape is new, the second executed, it will overwrite the original data tapes. In addition, use tar command to back up, required a single backup file size must be less than the capacity of tape, that is, a file can not span two tapes. If this happens, you can not use the tar command to back up, back up procedures required for other operations.

3. Continue to write data to tar rvf / dev/st0

Tape storage is linear storage, all data is written in turn. Front in order not to overwrite the contents of the write time to write the content to use the rvf parameters.

Tar rvf / dev/st0 test2.tar.gz

Then perform a rvf continue to write other documents:

Tar rvf / dev/st0 test3.tar.gz

Write is complete, view the tape, which documents:

[Root @ dev131 / root] # tar tvf / dev/st0
-Rw-r – r – root / root 320 2006-12-01 09:29:02

-Rw-r – r – root / root 320 2006-12-01 09:44:19

-Rw-r – r – root / root 320 2006-12-01 09:30:14


[Root @ dev131 / root] #

Can see the new file and write the original files are stored on the tape.

Linear tape storage, which makes the tape can write the same file twice. For example, the file is now happened test3 file size changes, once again written to the tape:

Tar rvf / dev/st0 test3.tar.gz

View the file list, you can see the tape, the following documents:

[Root @ dev131 / root] # tar tvf / dev/st0
-Rw-r – r – root / root 320 2006-12-01 09:29:02


We are high quality suppliers, our products such as China Mud Clarifier , China Multifunctional Drilling Rig for oversee buyer. To know more, please visits

More What Is Turnkey Operation Articles