To create an archive that is larger than will fit on a single unit of the media, use the --multi-volume (-M) option in conjunction with the --create (-c) option (see section How to Create Archives). A multi-volume archive can be manipulated like any other archive (provided the --multi-volume (-M) option is specified), but is stored on more than one tape or disk.
When you specify --multi-volume (-M), tar
does not report an
error when it comes to the end of an archive volume (when reading), or
the end of the media (when writing). Instead, it prompts you to load
a new storage volume. If the archive is on a magnetic tape, you
should change tapes when you see the prompt; if the archive is on a
floppy disk, you should change disks; etc.
You can read each individual volume of a multi-volume archive as if it were an archive by itself. For example, to list the contents of one volume, use --list (-t), without --multi-volume (-M) specified. To extract an archive member from one volume (assuming it is described that volume), use --extract (--get, -x), again without --multi-volume (-M).
If an archive member is split across volumes (ie. its entry begins on
one volume of the media and ends on another), you need to specify
--multi-volume (-M) to extract it successfully. In this case, you
should load the volume where the archive member starts, and use
`tar --extract --multi-volume'---tar
will prompt for later
volumes as it needs them. See section Extracting an Entire Archive, for more
information about extracting archives.
--info-script=script-name (--new-volume-script=script-name, -F script-name) is like --multi-volume (-M), except that
tar
does not prompt you directly to change media volumes when
a volume is full--instead, tar
runs commands you have stored
in script-name. For example, this option can be used to eject
cassettes, or to broadcast messages such as `Someone please come
change my tape' when performing unattended backups. When script-name
is done, tar
will assume that the media has been changed.
Multi-volume archives can be modified like any other archive. To add files to a multi-volume archive, you need to only mount the last volume of the archive media (and new volumes, if needed). For all other operations, you need to use the entire archive.
If a multi-volume archive was labeled using --label=archive-label (-V archive-label)
(see section Including a Label in the Archive) when it was created, tar
will not
automatically label volumes which are added later. To label subsequent
volumes, specify --label=archive-label (-V archive-label) again in conjunction with the
--append (-r), --update (-u) or --concatenate (--catenate, -A) operation.
@FIXME{There should be a sample program here, including an exit before end. Is the exit status even checked in tar? :-(}
Beware that there is no real standard about the proper way, for a
tar
archive, to span volume boundaries. If you have a multi-volume
created by some vendor's tar
, there is almost no chance you could
read all the volumes with GNU tar
. The converse is also true:
you may not expect multi-volume archives created by GNU tar
to
be fully recovered by vendor's tar
. Since there is little chance
that, in mixed system configurations, some vendor's tar
will work on
another vendor's machine, and there is a great chance that GNU tar
will work on most of them, your best bet is to install GNU tar
on all machines between which you know exchange of files is possible.
Go to the first, previous, next, last section, table of contents.