GNU Info

Info Node: (tar.info)Using Multiple Tapes

(tar.info)Using Multiple Tapes


Next: label Prev: Many Up: Media
Enter node , (file) or (file)node

Using Multiple Tapes
====================

     _(This message will disappear, once this node revised.)_

   Often you might want to write a large archive, one larger than will
fit on the actual tape you are using.  In such a case, you can run
multiple `tar' commands, but this can be inconvenient, particularly if
you are using options like `--exclude=PATTERN' or dumping entire
filesystems.  Therefore, `tar' supports multiple tapes automatically.

   Use `--multi-volume' (`-M') on the command line, and then `tar' will,
when it reaches the end of the tape, prompt for another tape, and
continue the archive.  Each tape will have an independent archive, and
can be read without needing the other.  (As an exception to this, the
file that `tar' was archiving when it ran out of tape will usually be
split between the two archives; in this case you need to extract from
the first archive, using `--multi-volume' (`-M'), and then put in the
second tape when prompted, so `tar' can restore both halves of the
file.)

   GNU `tar' multi-volume archives do not use a truly portable format.
You need GNU `tar' at both end to process them properly.

   When prompting for a new tape, `tar' accepts any of the following
responses:

`?'
     Request `tar' to explain possible responses

`q'
     Request `tar' to exit immediately.

`n FILE NAME'
     Request `tar' to write the next volume on the file FILE NAME.

`!'
     Request `tar' to run a subshell.

`y'
     Request `tar' to begin writing the next volume.

   (You should only type `y' after you have changed the tape; otherwise
`tar' will write over the volume it just finished.)

   If you want more elaborate behavior than this, give `tar' the
`--info-script=SCRIPT-NAME' (`--new-volume-script=SCRIPT-NAME', `-F
SCRIPT-NAME') option.  The file SCRIPT-NAME is expected to be a program
(or shell script) to be run instead of the normal prompting procedure.
If the program fails, `tar' exits; otherwise, `tar' begins writing the
next volume.  The behavior of the `n' response to the normal
tape-change prompt is not available if you use
`--info-script=SCRIPT-NAME' (`--new-volume-script=SCRIPT-NAME', `-F
SCRIPT-NAME').

   The method `tar' uses to detect end of tape is not perfect, and
fails on some operating systems or on some devices.  You can use the
`--tape-length=1024-SIZE' (`-L 1024-SIZE') option if `tar' can't detect
the end of the tape itself.  This option selects `--multi-volume'
(`-M') automatically.  The SIZE argument should then be the usable size
of the tape.  But for many devices, and floppy disks in particular,
this option is never required for real, as far as we know.

   The volume number used by `tar' in its tape-change prompt can be
changed; if you give the `--volno-file=FILE-OF-NUMBER' option, then
FILE-OF-NUMBER should be an unexisting file to be created, or else, a
file already containing a decimal number.  That number will be used as
the volume number of the first volume written.  When `tar' is finished,
it will rewrite the file with the now-current volume number.  (This
does not change the volume number written on a tape label, as per
Note: label, it _only_ affects the number used in the prompt.)

   If you want `tar' to cycle through a series of tape drives, then you
can use the `n' response to the tape-change prompt.  This is error
prone, however, and doesn't work at all with
`--info-script=SCRIPT-NAME' (`--new-volume-script=SCRIPT-NAME', `-F
SCRIPT-NAME').  Therefore, if you give `tar' multiple
`--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME') options, then the specified
files will be used, in sequence, as the successive volumes of the
archive.  Only when the first one in the sequence needs to be used
again will `tar' prompt for a tape change (or run the info script).

   Multi-volume archives

   With `--multi-volume' (`-M'), `tar' will not abort when it cannot
read or write any more data.  Instead, it will ask you to prepare a new
volume.  If the archive is on a magnetic tape, you should change tapes
now; if the archive is on a floppy disk, you should change disks, etc.

   Each volume of a multi-volume archive is an independent `tar'
archive, complete in itself.  For example, you can list or extract any
volume alone; just don't specify `--multi-volume' (`-M').  However, if
one file in the archive is split across volumes, the only way to extract
it successfully is with a multi-volume extract command `--extract
--multi-volume' (`-xM') starting on or before the volume where the file
begins.

   For example, let's presume someone has two tape drives on a system
named `/dev/tape0' and `/dev/tape1'.  For having GNU `tar' to switch to
the second drive when it needs to write the second tape, and then back
to the first tape, etc., just do either of:

     $ tar --create --multi-volume --file=/dev/tape0 --file=/dev/tape1 FILES
     $ tar cMff /dev/tape0 /dev/tape1 FILES

Multi-Volume Archives
Archives Longer than One Tape or Disk
Tape Files
Tape Files

automatically generated by info2www version 1.2.2.9