18 Tape drives

Contents of this section

The main thing to note about tbackup and tape drives is that tbackup is not a tape device driver. Tbackup assumes you have a device driver that can reliably access your tape drive under Linux. If you can't use your tape drive with normal tools like tar and cpio, you won't be able to do so with tbackup either.

As I don't have a tape drive myself, I can't answer many questions about tape drives or tape drivers. Only ask me if your tape drive works with tools like tar and cpio, but fails to work with tbackup.

Tbackup isn't better at low level tape handling than plain tar, cpio and afio are. It provides no sophisticated recovery procedures for tape errors. It does however add high level directory set and incremental backup facilities. This makes tbackup very convenient to use in a hybrid situation where you do full backups to tapes and incremental backups to floppies. If you never plan to use floppies, but only tapes, you may want to look at other backup packages which offer more tape-specific functionality.

18.1 Configuration

Before you can use your tape drive, the tape device name and optionally some other parameters need to be configured by editing the file /etc/tbackup/Config. The comments in /etc/tbackup/Config explain the configuration.

18.2 Error correcting codes for tapes.

An archive on tape can have error correcting codes added. If a tape has read errors, error correcting codes will often allow reconstruction of the damaged data.

Tbackup has a built-in error correcting code generator for floppies, but no built-in correcting code generator for tapes. However,

  1. your tape drive may add error correcting codes automatically
  2. your tape drive or tape device driver may have an option that can be switched on to add error correcting codes
  3. tbackup can run a GNU program called ecc to add error correcting codes

If you want error correcting codes, first search your documentation to find out if 1) or 2) above apply to your machine. Many modern tape drives that do automatic compression also add error correcting codes.

If case 2) applies, you must switch on the error correcting codes option before starting tbackup. You will probably also need to switch them on before running trestore or another program that reads the tape, though in some cases this may happen automatically.

In case 3), if your tape drive does not support error correcting codes directly, you may want to use the ecc program to add them. However, this has a few disadvantages:

You can find GNU ecc on most FTP sites that have the GNU stuff. If you install it, make sure it is in your PATH so that tbackup can find it.

If you add error correcting codes to a tape backup using 2) or 3), make a note of it somewhere, because you will need to know the archive has them when restoring the backup.

Adding tape error correcting codes can never do any harm, though it will make the archive a bit larger. Error correcting codes can never fix all possible tape errors; adding them does not mean it is save to omit a tape verify.

18.3 Using the tape method

Tbackup provides the tape method for reading and writing to the tape drive. Note that this method does not write any information about the backup (contents, pack method used, creation date, ...) on the tape, you will have to record this information yourself.

Here is a sample transcript:

Available write methods:
  1 floppy  -- write to msdos floppy disks with mtools
  2 filedev -- write archive to file or device
  3 tape    -- write to tape
  4 null    -- copy archive to the bit bucket
Enter method name or number ---> [floppy] tape
                                          ^^^^ 
Use tape error correcting codes made by GNU ecc?---> (y/n) [n] y
                                                               ^
[....]
 
Tape size is 250m.
 
Is the tape /dev/tape1 ready for writing?  Press enter to begin.
Tbackup knows nothing about rewinding or positioning of tapes. You will have to prepare the tape drive for writing yourself (e.g. be using a program like mt) before running tbackup (or at least before pressing enter).

If the archive length exceeds the tape size you will be prompted for a second tape:

afio: "/dev/tape1" [offset 0]: Output limit reached
afio: Ready for disk 2 on /dev/tape1
afio: quit to abort, anything else to proceed.

(Please ignore the part about being ready for disk 2.) You will see afio: in this prompt even if you use the tar pack method.

Tbackup will report tape write errors to you if the tape driver reports them to tbackup. With some tape drivers a tape write error may only produce a kernel message, not a message to tbackup. It may be necessary to watch the kernel messages for errors when writing to tape. (Consult your tape driver documentation, if it exists.)

18.4 Tape verify

Once you have written a tape, you may want to verify it for write errors. Tbackup supports two ways of doing this:

  1. Verifying a tape against the file system contents with tverify.
  2. Reading the tape and making an index with tlist.

The first way is safest, it will check the integrity of all data on the tape. However, this tverify supposes that the file system contents did not change during or between the backup and the verify pass. If a files in the filesystem and on tape are not identical, tverify supposes that the copy on tape was written incorrectly. This may lead to incorrect error reports when verifying against a live filesystem.

Running tlist on the tape will verify that the tape data is readable, and will detect some kinds of archive damage. You may want to look at the kernel error messages from the tape driver while running tlist, these may indicate damage. After running tlist, you can check the index file produced for error messages from the archiver, or compare it against the backup index file.

See the section tverify (Running tverify) on tverify and section tlist (Running tlist) on tlist for more information on using these commands.

18.5 Noninteractive use.

If you have a tape drive, you may want to do backups noninteractively, e.g. at night. Tbackup has an experimental `batch mode' feature for scheduling backups as at or crontab jobs. See the documentation file /usr/lib/tbackup/README.batchmode.txt for more information.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter