tar: PAX 0
1
1 PAX Format, Versions 0.0 and 0.1
1 --------------------------------
1
1 There are two formats available in this branch. The version '0.0' is
1 the initial version of sparse format used by 'tar' versions 1.14-1.15.1.
1 The sparse file map is kept in extended ('x') PAX header variables:
1
1 'GNU.sparse.size'
1 Real size of the stored file;
1
1 'GNU.sparse.numblocks'
1 Number of blocks in the sparse map;
1
1 'GNU.sparse.offset'
1 Offset of the data block;
1
1 'GNU.sparse.numbytes'
1 Size of the data block.
1
1 The latter two variables repeat for each data block, so the overall
1 structure is like this:
1
1 GNU.sparse.size=SIZE
1 GNU.sparse.numblocks=NUMBLOCKS
1 repeat NUMBLOCKS times
1 GNU.sparse.offset=OFFSET
1 GNU.sparse.numbytes=NUMBYTES
1 end repeat
1
1 This format presented the following two problems:
1
1 1. Whereas the POSIX specification allows a variable to appear
1 multiple times in a header, it requires that only the last
1 occurrence be meaningful. Thus, multiple occurrences of
1 'GNU.sparse.offset' and 'GNU.sparse.numbytes' are conflicting with
1 the POSIX specs.
1
1 2. Attempting to extract such archives using a third-party's 'tar'
1 results in extraction of sparse files in _condensed form_. If the
1 'tar' implementation in question does not support POSIX format, it
1 will also extract a file containing extension header attributes.
1 This file can be used to expand the file to its original state.
1 However, posix-aware 'tar's will usually ignore the unknown
1
1 GNU 'tar' 1.15.2 introduced sparse format version '0.1', which
1 attempted to solve these problems. As its predecessor, this format
1 stores sparse map in the extended POSIX header. It retains
1 'GNU.sparse.size' and 'GNU.sparse.numblocks' variables, but instead of
1 'GNU.sparse.offset'/'GNU.sparse.numbytes' pairs it uses a single
1 variable:
1
1 'GNU.sparse.map'
1 Map of non-null data chunks. It is a string consisting of
1 comma-separated values "OFFSET,SIZE[,OFFSET-1,SIZE-1...]"
1
1 To address the 2nd problem, the 'name' field in 'ustar' is replaced
1 with a special name, constructed using the following pattern:
1
1 %d/GNUSparseFile.%p/%f
1
1 The real name of the sparse file is stored in the variable
1 'GNU.sparse.name'. Thus, those 'tar' implementations that are not aware
1 of GNU extensions will at least extract the files into separate
1 directories, giving the user a possibility to expand it afterwards.
1
1 The resulting 'GNU.sparse.map' string can be _very_ long. Although
1 POSIX does not impose any limit on the length of a 'x' header variable,
1 this possibly can confuse some 'tar's.
1