| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Due to historical reasons, there are several formats of tar archives. All of them are based on the same principles, but have some subtle differences that often make them incompatible with each other.
GNU tar is able to create and handle archives in a variety of formats. The most frequently used formats are (in alphabetical order):
Format used by GNU tar versions up to 1.13.25. This format derived from an early POSIX standard, adding some improvements such as sparse file handling and incremental archives. Unfortunately these features were implemented in a way incompatible with other archive formats.
Archives in ‘gnu’ format are able to hold file names of unlimited length.
Format used by GNU tar of versions prior to 1.12.
Archive format, compatible with the V7 implementation of tar. This format imposes a number of limitations. The most important of them are:
This format has traditionally been used by Automake when producing Makefiles. This practice will change in the future, in the meantime, however this means that projects containing file names more than 100 bytes long will not be able to use GNU tar 1.35 and Automake prior to 1.9.
Archive format defined by POSIX.1-1988 and later. It stores symbolic ownership information. It is also able to store special files. However, it imposes several restrictions as well:
The format used by the late Jörg Schilling’s star implementation. GNU tar is able to read ‘star’ archives but currently does not produce them.
The format defined by POSIX.1-2001 and later. This is the most flexible and feature-rich format. It does not impose arbitrary restrictions on file sizes or file name lengths. This format is more recent, so some tar implementations cannot handle it properly. However, any tar implementation able to read ‘ustar’ archives should be able to read most ‘posix’ archives as well, except that it will extract any additional information (such as long file names) as extra plain text files.
This archive format will be the default format for future versions of GNU tar.
The following table summarizes the limitations of each of these formats:
| Format | UID | File Size | File Name | Devn |
|---|---|---|---|---|
| gnu | 1.8e19 | Unlimited | Unlimited | 63 |
| oldgnu | 1.8e19 | Unlimited | Unlimited | 63 |
| v7 | 2097151 | 8 GiB - 1 | 99 | n/a |
| ustar | 2097151 | 8 GiB - 1 | 255 | 21 |
| posix | Unlimited | Unlimited | Unlimited | Unlimited |
The default format for GNU tar is defined at compilation time. You may check it by running tar --help, and examining the last lines of its output. Usually, GNU tar is configured to create archives in ‘gnu’ format, however, a future version will switch to ‘posix’.
| 8.1 Using Less Space through Compression | ||
| 8.2 Handling File Attributes | ||
8.3 Making tar Archives More Portable | ||
8.4 Making tar Archives More Reproducible | ||
8.5 Comparison of tar and cpio |
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on August 23, 2023 using texi2html 5.0.