Next: PAX 1, Previous: Old GNU Format, Up: Sparse Formats
There are two formats available in this branch. The version 0.0
is the initial version of sparse format used by tar
versions 1.14–1.15.1. The sparse file map is kept in extended
(x
) PAX header variables:
GNU.sparse.size
GNU.sparse.numblocks
GNU.sparse.offset
GNU.sparse.numbytes
The latter two variables repeat for each data block, so the overall structure is like this:
GNU.sparse.size=size GNU.sparse.numblocks=numblocks repeat numblocks times GNU.sparse.offset=offset GNU.sparse.numbytes=numbytes end repeat
This format presented the following two problems:
GNU.sparse.offset
and
GNU.sparse.numbytes
are conficting with the POSIX specs.
GNU tar 1.15.2 introduced sparse format version 0.1
, which
attempted to solve these problems. As its predecessor, this format
stores sparse map in the extended POSIX header. It retains
GNU.sparse.size
and GNU.sparse.numblocks
variables, but
instead of GNU.sparse.offset
/GNU.sparse.numbytes
pairs
it uses a single variable:
GNU.sparse.map
To address the 2nd problem, the name
field in ustar
is replaced with a special name, constructed using the following pattern:
%d/GNUSparseFile.%p/%f
The real name of the sparse file is stored in the variable
GNU.sparse.name
. Thus, those tar implementations
that are not aware of GNU extensions will at least extract the files
into separate directories, giving the user a possibility to expand it
afterwards. See Extraction of sparse members in v.0.1 format, for the detailed description of how to
restore such members using non-GNU tars.
The resulting GNU.sparse.map
string can be very long.
Although POSIX does not impose any limit on the length of a x
header variable, this possibly can confuse some tars.