tar: Split Recovery
1
1 8.3.10.1 Extracting Members Split Between Volumes
1 .................................................
1
1 If a member is split between several volumes of an old GNU format
1 archive most third party 'tar' implementation will fail to extract it.
1 To extract it, use 'tarcat' program (⇒Tarcat). This program is
1 available from GNU 'tar' home page
1 (http://www.gnu.org/software/tar/utils/tarcat.html). It concatenates
1 several archive volumes into a single valid archive. For example, if
1 you have three volumes named from 'vol-1.tar' to 'vol-3.tar', you can do
1 the following to extract them using a third-party 'tar':
1
1 $ tarcat vol-1.tar vol-2.tar vol-3.tar | tar xf -
1
1 You could use this approach for most (although not all) PAX format
1 archives as well. However, extracting split members from a PAX archive
1 is a much easier task, because PAX volumes are constructed in such a way
1 that each part of a split member is extracted to a different file by
1 'tar' implementations that are not aware of GNU extensions. More
1 specifically, the very first part retains its original name, and all
1 subsequent parts are named using the pattern:
1
1 %d/GNUFileParts.%p/%f.%n
1
1 where symbols preceded by '%' are "macro characters" that have the
1 following meaning:
1
1 Meta-character Replaced By
1 ------------------------------------------------------------
1 %d The directory name of the file,
1 equivalent to the result of the
1 'dirname' utility on its full name.
1 %f The file name of the file, equivalent
1 to the result of the 'basename'
1 utility on its full name.
1 %p The process ID of the 'tar' process
1 that created the archive.
1 %n Ordinal number of this particular
1 part.
1
1 For example, if the file 'var/longfile' was split during archive
1 creation between three volumes, and the creator 'tar' process had
1 process ID '27962', then the member names will be:
1
1 var/longfile
1 var/GNUFileParts.27962/longfile.1
1 var/GNUFileParts.27962/longfile.2
1
1 When you extract your archive using a third-party 'tar', these files
1 will be created on your disk, and the only thing you will need to do to
1 restore your file in its original form is concatenate them in the proper
1 order, for example:
1
1 $ cd var
1 $ cat GNUFileParts.27962/longfile.1 \
1 GNUFileParts.27962/longfile.2 >> longfile
1 $ rm -f GNUFileParts.27962
1
1 Notice, that if the 'tar' implementation you use supports PAX format
1 archives, it will probably emit warnings about unknown keywords during
1 extraction. They will look like this:
1
1 Tar file too small
1 Unknown extended header keyword 'GNU.volume.filename' ignored.
1 Unknown extended header keyword 'GNU.volume.size' ignored.
1 Unknown extended header keyword 'GNU.volume.offset' ignored.
1
1 You can safely ignore these warnings.
1
1 If your 'tar' implementation is not PAX-aware, you will get more
1 warnings and more files generated on your disk, e.g.:
1
1 $ tar xf vol-1.tar
1 var/PaxHeaders.27962/longfile: Unknown file type 'x', extracted as
1 normal file
1 Unexpected EOF in archive
1 $ tar xf vol-2.tar
1 tmp/GlobalHead.27962.1: Unknown file type 'g', extracted as normal file
1 GNUFileParts.27962/PaxHeaders.27962/sparsefile.1: Unknown file type
1 'x', extracted as normal file
1
1 Ignore these warnings. The 'PaxHeaders.*' directories created will
1 contain files with "extended header keywords" describing the extracted
1 files. You can delete them, unless they describe sparse members. Read
1 further to learn more about them.
1