1 This is tar.info, produced by makeinfo version 4.13 from tar.texi.
3 This manual is for GNU `tar' (version 1.28, 22 July 2014), which
4 creates and extracts files from archives.
6 Copyright (C) 1992, 1994-1997, 1999-2001, 2003-2013 Free Software
9 Permission is granted to copy, distribute and/or modify this
10 document under the terms of the GNU Free Documentation License,
11 Version 1.3 or any later version published by the Free Software
12 Foundation; with the Invariant Sections being "GNU General Public
13 License", with the Front-Cover Texts being "A GNU Manual", and
14 with the Back-Cover Texts as in (a) below. A copy of the license
15 is included in the section entitled "GNU Free Documentation
18 (a) The FSF's Back-Cover Text is: "You have the freedom to copy
19 and modify this GNU manual."
21 INFO-DIR-SECTION Archiving
23 * Tar: (tar). Making tape (or disk) archives.
26 INFO-DIR-SECTION Individual utilities
28 * tar: (tar)tar invocation. Invoking GNU `tar'.
32 File: tar.info, Node: Time of day items, Next: Time zone items, Prev: Calendar date items, Up: Date input formats
37 A "time of day item" in date strings specifies the time on a given day.
38 Here are some examples, all of which represent the same time:
43 20:02-0500 # In EST (U.S. Eastern Standard Time).
45 More generally, the time of day may be given as
46 `HOUR:MINUTE:SECOND', where HOUR is a number between 0 and 23, MINUTE
47 is a number between 0 and 59, and SECOND is a number between 0 and 59
48 possibly followed by `.' or `,' and a fraction containing one or more
49 digits. Alternatively, `:SECOND' can be omitted, in which case it is
50 taken to be zero. On the rare hosts that support leap seconds, SECOND
53 If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), HOUR
54 is restricted to run from 1 to 12, and `:MINUTE' may be omitted (taken
55 to be zero). `am' indicates the first half of the day, `pm' indicates
56 the second half of the day. In this notation, 12 is the predecessor of
57 1: midnight is `12am' while noon is `12pm'. (This is the zero-oriented
58 interpretation of `12am' and `12pm', as opposed to the old tradition
59 derived from Latin which uses `12m' for noon and `12pm' for midnight.)
61 The time may alternatively be followed by a time zone correction,
62 expressed as `SHHMM', where S is `+' or `-', HH is a number of zone
63 hours and MM is a number of zone minutes. The zone minutes term, MM,
64 may be omitted, in which case the one- or two-digit correction is
65 interpreted as a number of hours. You can also separate HH from MM
66 with a colon. When a time zone correction is given this way, it forces
67 interpretation of the time relative to Coordinated Universal Time
68 (UTC), overriding any previous specification for the time zone or the
69 local time zone. For example, `+0530' and `+05:30' both stand for the
70 time zone 5.5 hours ahead of UTC (e.g., India). This is the best way to
71 specify a time zone correction by fractional parts of an hour. The
72 maximum zone correction is 24 hours.
74 Either `am'/`pm' or a time zone correction may be specified, but not
78 File: tar.info, Node: Time zone items, Next: Combined date and time of day items, Prev: Time of day items, Up: Date input formats
83 A "time zone item" specifies an international time zone, indicated by a
84 small set of letters, e.g., `UTC' or `Z' for Coordinated Universal
85 Time. Any included periods are ignored. By following a
86 non-daylight-saving time zone by the string `DST' in a separate word
87 (that is, separated by some white space), the corresponding daylight
88 saving time zone may be specified. Alternatively, a
89 non-daylight-saving time zone can be followed by a time zone
90 correction, to add the two values. This is normally done only for
91 `UTC'; for example, `UTC+05:30' is equivalent to `+05:30'.
93 Time zone items other than `UTC' and `Z' are obsolescent and are not
94 recommended, because they are ambiguous; for example, `EST' has a
95 different meaning in Australia than in the United States. Instead,
96 it's better to use unambiguous numeric time zone corrections like
97 `-0500', as described in the previous section.
99 If neither a time zone item nor a time zone correction is supplied,
100 time stamps are interpreted using the rules of the default time zone
101 (*note Specifying time zone rules::).
104 File: tar.info, Node: Combined date and time of day items, Next: Day of week items, Prev: Time zone items, Up: Date input formats
106 7.5 Combined date and time of day items
107 =======================================
109 The ISO 8601 date and time of day extended format consists of an ISO
110 8601 date, a `T' character separator, and an ISO 8601 time of day.
111 This format is also recognized if the `T' is replaced by a space.
113 In this format, the time of day should use 24-hour notation.
114 Fractional seconds are allowed, with either comma or period preceding
115 the fraction. ISO 8601 fractional minutes and hours are not supported.
116 Typically, hosts support nanosecond timestamp resolution; excess
117 precision is silently discarded.
119 Here are some examples:
121 2012-09-24T20:02:00.052-0500
122 2012-12-31T23:59:59,999999999+1100
126 File: tar.info, Node: Day of week items, Next: Relative items in date strings, Prev: Combined date and time of day items, Up: Date input formats
128 7.6 Day of week items
129 =====================
131 The explicit mention of a day of the week will forward the date (only
132 if necessary) to reach that day of the week in the future.
134 Days of the week may be spelled out in full: `Sunday', `Monday',
135 `Tuesday', `Wednesday', `Thursday', `Friday' or `Saturday'. Days may
136 be abbreviated to their first three letters, optionally followed by a
137 period. The special abbreviations `Tues' for `Tuesday', `Wednes' for
138 `Wednesday' and `Thur' or `Thurs' for `Thursday' are also allowed.
140 A number may precede a day of the week item to move forward
141 supplementary weeks. It is best used in expression like `third
142 monday'. In this context, `last DAY' or `next DAY' is also acceptable;
143 they move one week before or after the day that DAY by itself would
146 A comma following a day of the week item is ignored.
149 File: tar.info, Node: Relative items in date strings, Next: Pure numbers in date strings, Prev: Day of week items, Up: Date input formats
151 7.7 Relative items in date strings
152 ==================================
154 "Relative items" adjust a date (or the current date if none) forward or
155 backward. The effects of relative items accumulate. Here are some
163 The unit of time displacement may be selected by the string `year'
164 or `month' for moving by whole years or months. These are fuzzy units,
165 as years and months are not all of equal duration. More precise units
166 are `fortnight' which is worth 14 days, `week' worth 7 days, `day'
167 worth 24 hours, `hour' worth 60 minutes, `minute' or `min' worth 60
168 seconds, and `second' or `sec' worth one second. An `s' suffix on
169 these units is accepted and ignored.
171 The unit of time may be preceded by a multiplier, given as an
172 optionally signed number. Unsigned numbers are taken as positively
173 signed. No number at all implies 1 for a multiplier. Following a
174 relative item by the string `ago' is equivalent to preceding the unit
175 by a multiplier with value -1.
177 The string `tomorrow' is worth one day in the future (equivalent to
178 `day'), the string `yesterday' is worth one day in the past (equivalent
181 The strings `now' or `today' are relative items corresponding to
182 zero-valued time displacement, these strings come from the fact a
183 zero-valued time displacement represents the current time when not
184 otherwise changed by previous items. They may be used to stress other
185 items, like in `12:00 today'. The string `this' also has the meaning
186 of a zero-valued time displacement, but is preferred in date strings
187 like `this thursday'.
189 When a relative item causes the resulting date to cross a boundary
190 where the clocks were adjusted, typically for daylight saving time, the
191 resulting date and time are adjusted accordingly.
193 The fuzz in units can cause problems with relative items. For
194 example, `2003-07-31 -1 month' might evaluate to 2003-07-01, because
195 2003-06-31 is an invalid date. To determine the previous month more
196 reliably, you can ask for the month before the 15th of the current
200 Thu, 31 Jul 2003 13:02:39 -0700
201 $ date --date='-1 month' +'Last month was %B?'
203 $ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B!'
206 Also, take care when manipulating dates around clock changes such as
207 daylight saving leaps. In a few cases these have added or subtracted
208 as much as 24 hours from the clock, so it is often wise to adopt
209 universal time by setting the `TZ' environment variable to `UTC0'
210 before embarking on calendrical calculations.
213 File: tar.info, Node: Pure numbers in date strings, Next: Seconds since the Epoch, Prev: Relative items in date strings, Up: Date input formats
215 7.8 Pure numbers in date strings
216 ================================
218 The precise interpretation of a pure decimal number depends on the
219 context in the date string.
221 If the decimal number is of the form YYYYMMDD and no other calendar
222 date item (*note Calendar date items::) appears before it in the date
223 string, then YYYY is read as the year, MM as the month number and DD as
224 the day of the month, for the specified calendar date.
226 If the decimal number is of the form HHMM and no other time of day
227 item appears before it in the date string, then HH is read as the hour
228 of the day and MM as the minute of the hour, for the specified time of
229 day. MM can also be omitted.
231 If both a calendar date and a time of day appear to the left of a
232 number in the date string, but no relative item, then the number
236 File: tar.info, Node: Seconds since the Epoch, Next: Specifying time zone rules, Prev: Pure numbers in date strings, Up: Date input formats
238 7.9 Seconds since the Epoch
239 ===========================
241 If you precede a number with `@', it represents an internal time stamp
242 as a count of seconds. The number can contain an internal decimal
243 point (either `.' or `,'); any excess precision not supported by the
244 internal representation is truncated toward minus infinity. Such a
245 number cannot be combined with any other date item, as it specifies a
248 Internally, computer times are represented as a count of seconds
249 since an epoch--a well-defined point of time. On GNU and POSIX
250 systems, the epoch is 1970-01-01 00:00:00 UTC, so `@0' represents this
251 time, `@1' represents 1970-01-01 00:00:01 UTC, and so forth. GNU and
252 most other POSIX-compliant systems support such times as an extension
253 to POSIX, using negative counts, so that `@-1' represents 1969-12-31
256 Traditional Unix systems count seconds with 32-bit two's-complement
257 integers and can represent times from 1901-12-13 20:45:52 through
258 2038-01-19 03:14:07 UTC. More modern systems use 64-bit counts of
259 seconds with nanosecond subcounts, and can represent all the times in
260 the known lifetime of the universe to a resolution of 1 nanosecond.
262 On most hosts, these counts ignore the presence of leap seconds.
263 For example, on most hosts `@915148799' represents 1998-12-31 23:59:59
264 UTC, `@915148800' represents 1999-01-01 00:00:00 UTC, and there is no
265 way to represent the intervening leap second 1998-12-31 23:59:60 UTC.
268 File: tar.info, Node: Specifying time zone rules, Next: Authors of parse_datetime, Prev: Seconds since the Epoch, Up: Date input formats
270 7.10 Specifying time zone rules
271 ===============================
273 Normally, dates are interpreted using the rules of the current time
274 zone, which in turn are specified by the `TZ' environment variable, or
275 by a system default if `TZ' is not set. To specify a different set of
276 default time zone rules that apply just to one date, start the date
277 with a string of the form `TZ="RULE"'. The two quote characters (`"')
278 must be present in the date, and any quotes or backslashes within RULE
279 must be escaped by a backslash.
281 For example, with the GNU `date' command you can answer the question
282 "What time is it in New York when a Paris clock shows 6:30am on October
283 31, 2004?" by using a date beginning with `TZ="Europe/Paris"' as shown
284 in the following shell transcript:
286 $ export TZ="America/New_York"
287 $ date --date='TZ="Europe/Paris" 2004-10-31 06:30'
288 Sun Oct 31 01:30:00 EDT 2004
290 In this example, the `--date' operand begins with its own `TZ'
291 setting, so the rest of that operand is processed according to
292 `Europe/Paris' rules, treating the string `2004-10-31 06:30' as if it
293 were in Paris. However, since the output of the `date' command is
294 processed according to the overall time zone rules, it uses New York
295 time. (Paris was normally six hours ahead of New York in 2004, but
296 this example refers to a brief Halloween period when the gap was five
299 A `TZ' value is a rule that typically names a location in the `tz'
300 database (http://www.twinsun.com/tz/tz-link.htm). A recent catalog of
301 location names appears in the TWiki Date and Time Gateway
302 (http://twiki.org/cgi-bin/xtra/tzdate). A few non-GNU hosts require a
303 colon before a location name in a `TZ' setting, e.g.,
304 `TZ=":America/New_York"'.
306 The `tz' database includes a wide variety of locations ranging from
307 `Arctic/Longyearbyen' to `Antarctica/South_Pole', but if you are at sea
308 and have your own private time zone, or if you are using a non-GNU host
309 that does not support the `tz' database, you may need to use a POSIX
310 rule instead. Simple POSIX rules like `UTC0' specify a time zone
311 without daylight saving time; other rules can specify simple daylight
312 saving regimes. *Note Specifying the Time Zone with `TZ': (libc)TZ
316 File: tar.info, Node: Authors of parse_datetime, Prev: Specifying time zone rules, Up: Date input formats
318 7.11 Authors of `parse_datetime'
319 ================================
321 `parse_datetime' started life as `getdate', as originally implemented
322 by Steven M. Bellovin (<smb@research.att.com>) while at the University
323 of North Carolina at Chapel Hill. The code was later tweaked by a
324 couple of people on Usenet, then completely overhauled by Rich $alz
325 (<rsalz@bbn.com>) and Jim Berets (<jberets@bbn.com>) in August, 1990.
326 Various revisions for the GNU system were made by David MacKenzie, Jim
327 Meyering, Paul Eggert and others, including renaming it to `get_date' to
328 avoid a conflict with the alternative Posix function `getdate', and a
329 later rename to `parse_datetime'. The Posix function `getdate' can
330 parse more locale-specific dates using `strptime', but relies on an
331 environment variable and external file, and lacks the thread-safety of
334 This chapter was originally produced by Franc,ois Pinard
335 (<pinard@iro.umontreal.ca>) from the `parse_datetime.y' source code,
336 and then edited by K. Berry (<kb@cs.umb.edu>).
339 File: tar.info, Node: Formats, Next: Media, Prev: Date input formats, Up: Top
341 8 Controlling the Archive Format
342 ********************************
344 Due to historical reasons, there are several formats of tar archives.
345 All of them are based on the same principles, but have some subtle
346 differences that often make them incompatible with each other.
348 GNU tar is able to create and handle archives in a variety of
349 formats. The most frequently used formats are (in alphabetical order):
352 Format used by GNU `tar' versions up to 1.13.25. This format
353 derived from an early POSIX standard, adding some improvements
354 such as sparse file handling and incremental archives.
355 Unfortunately these features were implemented in a way
356 incompatible with other archive formats.
358 Archives in `gnu' format are able to hold file names of unlimited
362 Format used by GNU `tar' of versions prior to 1.12.
365 Archive format, compatible with the V7 implementation of tar. This
366 format imposes a number of limitations. The most important of them
369 1. The maximum length of a file name is limited to 99 characters.
371 2. The maximum length of a symbolic link is limited to 99
374 3. It is impossible to store special files (block and character
377 4. Maximum value of user or group ID is limited to 2097151
380 5. V7 archives do not contain symbolic ownership information
381 (user and group name of the file owner).
383 This format has traditionally been used by Automake when producing
384 Makefiles. This practice will change in the future, in the
385 meantime, however this means that projects containing file names
386 more than 99 characters long will not be able to use GNU `tar'
387 1.28 and Automake prior to 1.9.
390 Archive format defined by POSIX.1-1988 specification. It stores
391 symbolic ownership information. It is also able to store special
392 files. However, it imposes several restrictions as well:
394 1. The maximum length of a file name is limited to 256
395 characters, provided that the file name can be split at a
396 directory separator in two parts, first of them being at most
397 155 bytes long. So, in most cases the maximum file name
398 length will be shorter than 256 characters.
400 2. The maximum length of a symbolic link name is limited to 100
403 3. Maximum size of a file the archive is able to accommodate is
406 4. Maximum value of UID/GID is 2097151.
408 5. Maximum number of bits in device major and minor numbers is
412 Format used by Jo"rg Schilling `star' implementation. GNU `tar'
413 is able to read `star' archives but currently does not produce
417 Archive format defined by POSIX.1-2001 specification. This is the
418 most flexible and feature-rich format. It does not impose any
419 restrictions on file sizes or file name lengths. This format is
420 quite recent, so not all tar implementations are able to handle it
421 properly. However, this format is designed in such a way that any
422 tar implementation able to read `ustar' archives will be able to
423 read most `posix' archives as well, with the only exception that
424 any additional information (such as long file names etc.) will in
425 such case be extracted as plain text files along with the files it
428 This archive format will be the default format for future versions
432 The following table summarizes the limitations of each of these
435 Format UID File Size File Name Devn
436 --------------------------------------------------------------------
437 gnu 1.8e19 Unlimited Unlimited 63
438 oldgnu 1.8e19 Unlimited Unlimited 63
439 v7 2097151 8GB 99 n/a
440 ustar 2097151 8GB 256 21
441 posix Unlimited Unlimited Unlimited Unlimited
443 The default format for GNU `tar' is defined at compilation time.
444 You may check it by running `tar --help', and examining the last lines
445 of its output. Usually, GNU `tar' is configured to create archives in
446 `gnu' format, however, future version will switch to `posix'.
450 * Compression:: Using Less Space through Compression
451 * Attributes:: Handling File Attributes
452 * Portability:: Making `tar' Archives More Portable
453 * cpio:: Comparison of `tar' and `cpio'
456 File: tar.info, Node: Compression, Next: Attributes, Up: Formats
458 8.1 Using Less Space through Compression
459 ========================================
463 * gzip:: Creating and Reading Compressed Archives
464 * sparse:: Archiving Sparse Files
467 File: tar.info, Node: gzip, Next: sparse, Up: Compression
469 8.1.1 Creating and Reading Compressed Archives
470 ----------------------------------------------
472 GNU `tar' is able to create and read compressed archives. It supports
473 a wide variety of compression programs, namely: `gzip', `bzip2',
474 `lzip', `lzma', `lzop', `xz' and traditional `compress'. The latter is
475 supported mostly for backward compatibility, and we recommend against
476 using it, because it is by far less effective than the other
477 compression programs(1).
479 Creating a compressed archive is simple: you just specify a
480 "compression option" along with the usual archive creation commands.
481 The compression option is `-z' (`--gzip') to create a `gzip' compressed
482 archive, `-j' (`--bzip2') to create a `bzip2' compressed archive,
483 `--lzip' to create an lzip compressed archive, `-J' (`--xz') to create
484 an XZ archive, `--lzma' to create an LZMA compressed archive, `--lzop'
485 to create an LSOP archive, and `-Z' (`--compress') to use `compress'
486 program. For example:
488 $ tar czf archive.tar.gz .
490 You can also let GNU `tar' select the compression program based on
491 the suffix of the archive file name. This is done using
492 `--auto-compress' (`-a') command line option. For example, the
493 following invocation will use `bzip2' for compression:
495 $ tar caf archive.tar.bz2 .
497 whereas the following one will use `lzma':
499 $ tar caf archive.tar.lzma .
501 For a complete list of file name suffixes recognized by GNU `tar',
502 see *note auto-compress::.
504 Reading compressed archive is even simpler: you don't need to specify
505 any additional options as GNU `tar' recognizes its format
506 automatically. Thus, the following commands will list and extract the
507 archive created in previous example:
509 # List the compressed archive
510 $ tar tf archive.tar.gz
511 # Extract the compressed archive
512 $ tar xf archive.tar.gz
514 The format recognition algorithm is based on "signatures", a special
515 byte sequences in the beginning of file, that are specific for certain
516 compression formats. If this approach fails, `tar' falls back to using
517 archive name suffix to determine its format (*note auto-compress::, for
518 a list of recognized suffixes).
520 Some compression programs are able to handle different compression
521 formats. GNU `tar' uses this, if the principal decompressor for the
522 given format is not available. For example, if `compress' is not
523 installed, `tar' will try to use `gzip'. As of version 1.28 the
524 following alternatives are tried(2):
526 Format Main decompressor Alternatives
527 ---------------------------------------------------------------------
528 compress compress gzip
532 The only case when you have to specify a decompression option while
533 reading the archive is when reading from a pipe or from a tape drive
534 that does not support random access. However, in this case GNU `tar'
535 will indicate which option you should use. For example:
537 $ cat archive.tar.gz | tar tf -
538 tar: Archive is compressed. Use -z option
539 tar: Error is not recoverable: exiting now
541 If you see such diagnostics, just add the suggested option to the
542 invocation of GNU `tar':
544 $ cat archive.tar.gz | tar tzf -
546 Notice also, that there are several restrictions on operations on
547 compressed archives. First of all, compressed archives cannot be
548 modified, i.e., you cannot update (`--update', alias `-u') them or
549 delete (`--delete') members from them or add (`--append', alias `-r')
550 members to them. Likewise, you cannot append another `tar' archive to
551 a compressed archive using `--concatenate' (`-A'). Secondly,
552 multi-volume archives cannot be compressed.
554 The following options allow to select a particular compressor
560 Filter the archive through `gzip'.
564 Filter the archive through `xz'.
568 Filter the archive through `bzip2'.
571 Filter the archive through `lzip'.
574 Filter the archive through `lzma'.
577 Filter the archive through `lzop'.
582 Filter the archive through `compress'.
584 When any of these options is given, GNU `tar' searches the compressor
585 binary in the current path and invokes it. The name of the compressor
586 program is specified at compilation time using a corresponding
587 `--with-COMPNAME' option to `configure', e.g. `--with-bzip2' to select
588 a specific `bzip2' binary. *Note lbzip2::, for a detailed discussion.
590 The output produced by `tar --help' shows the actual compressor
591 names along with each of these options.
593 You can use any of these options on physical devices (tape drives,
594 etc.) and remote files as well as on normal files; data to or from such
595 devices or remote files is reblocked by another copy of the `tar'
596 program to enforce the specified (or default) record size. The default
597 compression parameters are used. Most compression programs let you
598 override these by setting a program-specific environment variable. For
599 example, with `gzip' you can set `GZIP':
601 $ GZIP='-9 -n' tar czf archive.tar.gz subdir
602 Another way would be to use the `-I' option instead (see below),
605 $ tar -cf archive.tar.gz -I 'gzip -9 -n' subdir
607 Finally, the third, traditional, way to do this is to use a pipe:
609 $ tar cf - subdir | gzip -9 -n > archive.tar.gz
611 Compressed archives are easily corrupted, because compressed files
612 have little redundancy. The adaptive nature of the compression scheme
613 means that the compression tables are implicitly spread all over the
614 archive. If you lose a few blocks, the dynamic construction of the
615 compression tables becomes unsynchronized, and there is little chance
616 that you could recover later in the archive.
618 Other compression options provide better control over creating
619 compressed archives. These are:
623 Select a compression program to use by the archive file name
624 suffix. The following suffixes are recognized:
626 Suffix Compression program
627 --------------------------------------------------------------
643 `--use-compress-program=COMMAND'
645 Use external compression program COMMAND. Use this option if you
646 are not happy with the compression program associated with the
647 suffix at compile time or if you have a compression program that
648 GNU `tar' does not support. The COMMAND argument is a valid
649 command invocation, as you would type it at the command line
650 prompt, with any additional options as needed. Enclose it in
651 quotes if it contains white space (see *note Running External
652 Commands: external, for more detail).
654 The COMMAND should follow two conventions:
656 First, when invoked without additional options, it should read data
657 from standard input, compress it and output it on standard output.
659 Secondly, if invoked with the additional `-d' option, it should do
660 exactly the opposite, i.e., read the compressed data from the
661 standard input and produce uncompressed data on the standard
664 The latter requirement means that you must not use the `-d' option
665 as a part of the COMMAND itself.
667 The `--use-compress-program' option, in particular, lets you
668 implement your own filters, not necessarily dealing with
669 compression/decompression. For example, suppose you wish to implement
670 PGP encryption on top of compression, using `gpg' (*note gpg:
671 (gpg)Top.). The following script does that:
675 -d) gpg --decrypt - | gzip -d -c;;
676 '') gzip -c | gpg -s;;
677 *) echo "Unknown option $1">&2; exit 1;;
680 Suppose you name it `gpgz' and save it somewhere in your `PATH'.
681 Then the following command will create a compressed archive signed with
684 $ tar -cf foo.tar.gpgz -Igpgz .
686 Likewise, the command below will list its contents:
688 $ tar -tf foo.tar.gpgz -Igpgz .
692 * lbzip2:: Using lbzip2 with GNU `tar'.
694 ---------- Footnotes ----------
696 (1) It also had patent problems in the past.
698 (2) To verbosely trace the decompressor selection, use the
699 `--warning=decompress-program' option (*note decompress-program:
703 File: tar.info, Node: lbzip2, Up: gzip
705 8.1.1.1 Using lbzip2 with GNU `tar'.
706 ....................................
708 `Lbzip2' is a multithreaded utility for handling `bzip2' compression,
709 written by Laszlo Ersek. It makes use of multiple processors to speed
710 up its operation and in general works considerably faster than `bzip2'.
711 For a detailed description of `lbzip2' see
712 `http://freshmeat.net/projects/lbzip2' and lbzip2: parallel bzip2
714 (http://www.linuxinsight.com/lbzip2-parallel-bzip2-utility.html).
716 Recent versions of `lbzip2' are mostly command line compatible with
717 `bzip2', which makes it possible to automatically invoke it via the
718 `--bzip2' GNU `tar' command line option. To do so, GNU `tar' must be
719 configured with the `--with-bzip2' command line option, like this:
721 $ ./configure --with-bzip2=lbzip2 [OTHER-OPTIONS]
723 Once configured and compiled this way, `tar --help' will show the
726 $ tar --help | grep -- --bzip2
727 -j, --bzip2 filter the archive through lbzip2
729 which means that running `tar --bzip2' will invoke `lbzip2'.
732 File: tar.info, Node: sparse, Prev: gzip, Up: Compression
734 8.1.2 Archiving Sparse Files
735 ----------------------------
737 Files in the file system occasionally have "holes". A "hole" in a file
738 is a section of the file's contents which was never written. The
739 contents of a hole reads as all zeros. On many operating systems,
740 actual disk storage is not allocated for holes, but they are counted in
741 the length of the file. If you archive such a file, `tar' could create
742 an archive longer than the original. To have `tar' attempt to
743 recognize the holes in a file, use `--sparse' (`-S'). When you use
744 this option, then, for any file using less disk space than would be
745 expected from its length, `tar' searches the file for consecutive
746 stretches of zeros. It then records in the archive for the file where
747 the consecutive stretches of zeros are, and only archives the "real
748 contents" of the file. On extraction (using `--sparse' is not needed
749 on extraction) any such files have holes created wherever the
750 continuous stretches of zeros were found. Thus, if you use `--sparse',
751 `tar' archives won't take more space than the original.
755 This option instructs `tar' to test each file for sparseness
756 before attempting to archive it. If the file is found to be
757 sparse it is treated specially, thus allowing to decrease the
758 amount of space used by its image in the archive.
760 This option is meaningful only when creating or updating archives.
761 It has no effect on extraction.
763 Consider using `--sparse' when performing file system backups, to
764 avoid archiving the expanded forms of files stored sparsely in the
767 Even if your system has no sparse files currently, some may be
768 created in the future. If you use `--sparse' while making file system
769 backups as a matter of course, you can be assured the archive will
770 never take more space on the media than the files take on disk
771 (otherwise, archiving a disk filled with sparse files might take
772 hundreds of tapes). *Note Incremental Dumps::.
774 However, be aware that `--sparse' option presents a serious
775 drawback. Namely, in order to determine if the file is sparse `tar'
776 has to read it before trying to archive it, so in total the file is
777 read *twice*. So, always bear in mind that the time needed to process
778 all files with this option is roughly twice the time needed to archive
781 When using `POSIX' archive format, GNU `tar' is able to store sparse
782 files using in three distinct ways, called "sparse formats". A sparse
783 format is identified by its "number", consisting, as usual of two
784 decimal numbers, delimited by a dot. By default, format `1.0' is used.
785 If, for some reason, you wish to use an earlier format, you can select
786 it using `--sparse-version' option.
788 `--sparse-version=VERSION'
789 Select the format to store sparse files in. Valid VERSION values
790 are: `0.0', `0.1' and `1.0'. *Note Sparse Formats::, for a
791 detailed description of each format.
793 Using `--sparse-format' option implies `--sparse'.
796 File: tar.info, Node: Attributes, Next: Portability, Prev: Compression, Up: Formats
798 8.2 Handling File Attributes
799 ============================
801 When `tar' reads files, it updates their access times. To avoid this,
802 use the `--atime-preserve[=METHOD]' option, which can either reset the
803 access time retroactively or avoid changing it in the first place.
806 `--atime-preserve=replace'
807 `--atime-preserve=system'
808 Preserve the access times of files that are read. This works only
809 for files that you own, unless you have superuser privileges.
811 `--atime-preserve=replace' works on most systems, but it also
812 restores the data modification time and updates the status change
813 time. Hence it doesn't interact with incremental dumps nicely
814 (*note Incremental Dumps::), and it can set access or data
815 modification times incorrectly if other programs access the file
816 while `tar' is running.
818 `--atime-preserve=system' avoids changing the access time in the
819 first place, if the operating system supports this.
820 Unfortunately, this may or may not work on any given operating
821 system or file system. If `tar' knows for sure it won't work, it
822 complains right away.
824 Currently `--atime-preserve' with no operand defaults to
825 `--atime-preserve=replace', but this is intended to change to
826 `--atime-preserve=system' when the latter is better-supported.
830 Do not extract data modification time.
832 When this option is used, `tar' leaves the data modification times
833 of the files it extracts as the times when the files were
834 extracted, instead of setting it to the times recorded in the
837 This option is meaningless with `--list' (`-t').
840 Create extracted files with the same ownership they have in the
843 This is the default behavior for the superuser, so this option is
844 meaningful only for non-root users, when `tar' is executed on
845 those systems able to give files away. This is considered as a
846 security flaw by many people, at least because it makes quite
847 difficult to correctly account users for the disk space they
848 occupy. Also, the `suid' or `sgid' attributes of files are easily
849 and silently lost when files are given away.
851 When writing an archive, `tar' writes the user ID and user name
852 separately. If it can't find a user name (because the user ID is
853 not in `/etc/passwd'), then it does not write one. When restoring,
854 it tries to look the name (if one was written) up in
855 `/etc/passwd'. If it fails, then it uses the user ID stored in
860 Do not attempt to restore ownership when extracting. This is the
861 default behavior for ordinary users, so this option has an effect
862 only for the superuser.
865 The `--numeric-owner' option allows (ANSI) archives to be written
866 without user/group name information or such information to be
867 ignored when extracting. It effectively disables the generation
868 and/or use of user/group name information. This option forces
869 extraction using the numeric ids from the archive, ignoring the
872 This is useful in certain circumstances, when restoring a backup
873 from an emergency floppy with different passwd/group files for
874 example. It is otherwise impossible to extract files with the
875 right ownerships if the password file in use during the extraction
876 does not match the one belonging to the file system(s) being
877 extracted. This occurs, for example, if you are restoring your
878 files after a major crash and had booted from an emergency floppy
879 with no password file or put your disk into another machine to do
882 The numeric ids are _always_ saved into `tar' archives. The
883 identifying names are added at create time when provided by the
884 system, unless `--format=oldgnu' is used. Numeric ids could be
885 used when moving archives between a collection of machines using a
886 centralized management for attribution of numeric ids to users and
887 groups. This is often made through using the NIS capabilities.
889 When making a `tar' file for distribution to other sites, it is
890 sometimes cleaner to use a single owner for all files in the
891 distribution, and nicer to specify the write permission bits of the
892 files as stored in the archive independently of their actual value
893 on the file system. The way to prepare a clean distribution is
894 usually to have some Makefile rule creating a directory, copying
895 all needed files in that directory, then setting ownership and
896 permissions as wanted (there are a lot of possible schemes), and
897 only then making a `tar' archive out of this directory, before
898 cleaning everything out. Of course, we could add a lot of options
899 to GNU `tar' for fine tuning permissions and ownership. This is
900 not the good way, I think. GNU `tar' is already crowded with
901 options and moreover, the approach just explained gives you a
902 great deal of control already.
906 `--preserve-permissions'
907 Extract all protection information.
909 This option causes `tar' to set the modes (access permissions) of
910 extracted files exactly as recorded in the archive. If this option
911 is not used, the current `umask' setting limits the permissions on
912 extracted files. This option is by default enabled when `tar' is
913 executed by a superuser.
915 This option is meaningless with `--list' (`-t').
918 Same as both `--same-permissions' and `--same-order'.
920 This option is deprecated, and will be removed in GNU `tar'
925 File: tar.info, Node: Portability, Next: cpio, Prev: Attributes, Up: Formats
927 8.3 Making `tar' Archives More Portable
928 =======================================
930 Creating a `tar' archive on a particular system that is meant to be
931 useful later on many other machines and with other versions of `tar' is
932 more challenging than you might think. `tar' archive formats have been
933 evolving since the first versions of Unix. Many such formats are
934 around, and are not always compatible with each other. This section
935 discusses a few problems, and gives some advice about making `tar'
936 archives more portable.
938 One golden rule is simplicity. For example, limit your `tar'
939 archives to contain only regular files and directories, avoiding other
940 kind of special files. Do not attempt to save sparse files or
941 contiguous files as such. Let's discuss a few more problems, in turn.
945 * Portable Names:: Portable Names
946 * dereference:: Symbolic Links
947 * hard links:: Hard Links
948 * old:: Old V7 Archives
949 * ustar:: Ustar Archives
950 * gnu:: GNU and old GNU format archives.
951 * posix:: POSIX archives
952 * Checksumming:: Checksumming Problems
953 * Large or Negative Values:: Large files, negative time stamps, etc.
954 * Other Tars:: How to Extract GNU-Specific Data Using
955 Other `tar' Implementations
958 File: tar.info, Node: Portable Names, Next: dereference, Up: Portability
963 Use portable file and member names. A name is portable if it contains
964 only ASCII letters and digits, `/', `.', `_', and `-'; it cannot be
965 empty, start with `-' or `//', or contain `/-'. Avoid deep directory
966 nesting. For portability to old Unix hosts, limit your file name
967 components to 14 characters or less.
969 If you intend to have your `tar' archives to be read under MSDOS,
970 you should not rely on case distinction for file names, and you might
971 use the GNU `doschk' program for helping you further diagnosing illegal
972 MSDOS names, which are even more limited than System V's.
975 File: tar.info, Node: dereference, Next: hard links, Prev: Portable Names, Up: Portability
980 Normally, when `tar' archives a symbolic link, it writes a block to the
981 archive naming the target of the link. In that way, the `tar' archive
982 is a faithful record of the file system contents. When `--dereference'
983 (`-h') is used with `--create' (`-c'), `tar' archives the files
984 symbolic links point to, instead of the links themselves.
986 When creating portable archives, use `--dereference' (`-h'): some
987 systems do not support symbolic links, and moreover, your distribution
988 might be unusable if it contains unresolved symbolic links.
990 When reading from an archive, the `--dereference' (`-h') option
991 causes `tar' to follow an already-existing symbolic link when `tar'
992 writes or reads a file named in the archive. Ordinarily, `tar' does
993 not follow such a link, though it may remove the link before writing a
994 new file. *Note Dealing with Old Files::.
996 The `--dereference' option is unsafe if an untrusted user can modify
997 directories while `tar' is running. *Note Security::.
1000 File: tar.info, Node: hard links, Next: old, Prev: dereference, Up: Portability
1005 Normally, when `tar' archives a hard link, it writes a block to the
1006 archive naming the target of the link (a `1' type block). In that way,
1007 the actual file contents is stored in file only once. For example,
1008 consider the following two files:
1011 -rw-r--r-- 2 gray staff 4 2007-10-30 15:11 one
1012 -rw-r--r-- 2 gray staff 4 2007-10-30 15:11 jeden
1014 Here, `jeden' is a link to `one'. When archiving this directory
1015 with a verbose level 2, you will get an output similar to the following:
1017 $ tar cvvf ../archive.tar .
1018 drwxr-xr-x gray/staff 0 2007-10-30 15:13 ./
1019 -rw-r--r-- gray/staff 4 2007-10-30 15:11 ./jeden
1020 hrw-r--r-- gray/staff 0 2007-10-30 15:11 ./one link to ./jeden
1022 The last line shows that, instead of storing two copies of the file,
1023 `tar' stored it only once, under the name `jeden', and stored file
1024 `one' as a hard link to this file.
1026 It may be important to know that all hard links to the given file are
1027 stored in the archive. For example, this may be necessary for exact
1028 reproduction of the file system. The following option does that:
1032 Check the number of links dumped for each processed file. If this
1033 number does not match the total number of hard links for the file,
1034 print a warning message.
1036 For example, trying to archive only file `jeden' with this option
1037 produces the following diagnostics:
1039 $ tar -c -f ../archive.tar -l jeden
1040 tar: Missing links to 'jeden'.
1042 Although creating special records for hard links helps keep a
1043 faithful record of the file system contents and makes archives more
1044 compact, it may present some difficulties when extracting individual
1045 members from the archive. For example, trying to extract file `one'
1046 from the archive created in previous examples produces, in the absense
1049 $ tar xf archive.tar ./one
1050 tar: ./one: Cannot hard link to './jeden': No such file or directory
1051 tar: Error exit delayed from previous errors
1053 The reason for this behavior is that `tar' cannot seek back in the
1054 archive to the previous member (in this case, `one'), to extract it(1).
1055 If you wish to avoid such problems at the cost of a bigger archive, use
1056 the following option:
1058 `--hard-dereference'
1059 Dereference hard links and store the files they refer to.
1061 For example, trying this option on our two sample files, we get two
1062 copies in the archive, each of which can then be extracted
1063 independently of the other:
1065 $ tar -c -vv -f ../archive.tar --hard-dereference .
1066 drwxr-xr-x gray/staff 0 2007-10-30 15:13 ./
1067 -rw-r--r-- gray/staff 4 2007-10-30 15:11 ./jeden
1068 -rw-r--r-- gray/staff 4 2007-10-30 15:11 ./one
1070 ---------- Footnotes ----------
1072 (1) There are plans to fix this in future releases.
1075 File: tar.info, Node: old, Next: ustar, Prev: hard links, Up: Portability
1077 8.3.4 Old V7 Archives
1078 ---------------------
1080 Certain old versions of `tar' cannot handle additional information
1081 recorded by newer `tar' programs. To create an archive in V7 format
1082 (not ANSI), which can be read by these old versions, specify the
1083 `--format=v7' option in conjunction with the `--create' (`-c') (`tar'
1084 also accepts `--portability' or `--old-archive' for this option). When
1085 you specify it, `tar' leaves out information about directories, pipes,
1086 fifos, contiguous files, and device files, and specifies file ownership
1087 by group and user IDs instead of group and user names.
1089 When updating an archive, do not use `--format=v7' unless the
1090 archive was created using this option.
1092 In most cases, a _new_ format archive can be read by an _old_ `tar'
1093 program without serious trouble, so this option should seldom be
1094 needed. On the other hand, most modern `tar's are able to read old
1095 format archives, so it might be safer for you to always use
1096 `--format=v7' for your distributions. Notice, however, that `ustar'
1097 format is a better alternative, as it is free from many of `v7''s
1101 File: tar.info, Node: ustar, Next: gnu, Prev: old, Up: Portability
1103 8.3.5 Ustar Archive Format
1104 --------------------------
1106 The archive format defined by the POSIX.1-1988 specification is called
1107 `ustar'. Although it is more flexible than the V7 format, it still has
1108 many restrictions (*note ustar: Formats, for the detailed description
1109 of `ustar' format). Along with V7 format, `ustar' format is a good
1110 choice for archives intended to be read with other implementations of
1113 To create an archive in `ustar' format, use the `--format=ustar'
1114 option in conjunction with `--create' (`-c').
1117 File: tar.info, Node: gnu, Next: posix, Prev: ustar, Up: Portability
1119 8.3.6 GNU and old GNU `tar' format
1120 ----------------------------------
1122 GNU `tar' was based on an early draft of the POSIX 1003.1 `ustar'
1123 standard. GNU extensions to `tar', such as the support for file names
1124 longer than 100 characters, use portions of the `tar' header record
1125 which were specified in that POSIX draft as unused. Subsequent changes
1126 in POSIX have allocated the same parts of the header record for other
1127 purposes. As a result, GNU `tar' format is incompatible with the
1128 current POSIX specification, and with `tar' programs that follow it.
1130 In the majority of cases, `tar' will be configured to create this
1131 format by default. This will change in future releases, since we plan
1132 to make `POSIX' format the default.
1134 To force creation a GNU `tar' archive, use option `--format=gnu'.
1137 File: tar.info, Node: posix, Next: Checksumming, Prev: gnu, Up: Portability
1139 8.3.7 GNU `tar' and POSIX `tar'
1140 -------------------------------
1142 Starting from version 1.14 GNU `tar' features full support for
1143 POSIX.1-2001 archives.
1145 A POSIX conformant archive will be created if `tar' was given
1146 `--format=posix' (`--format=pax') option. No special option is
1147 required to read and extract from a POSIX archive.
1151 * PAX keywords:: Controlling Extended Header Keywords.
1154 File: tar.info, Node: PAX keywords, Up: posix
1156 8.3.7.1 Controlling Extended Header Keywords
1157 ............................................
1159 `--pax-option=KEYWORD-LIST'
1160 Handle keywords in PAX extended headers. This option is
1161 equivalent to `-o' option of the `pax' utility.
1163 KEYWORD-LIST is a comma-separated list of keyword options, each
1164 keyword option taking one of the following forms:
1167 When used with one of archive-creation commands, this option
1168 instructs `tar' to omit from extended header records that it
1169 produces any keywords matching the string PATTERN.
1171 When used in extract or list mode, this option instructs tar to
1172 ignore any keywords matching the given PATTERN in the extended
1173 header records. In both cases, matching is performed using the
1174 pattern matching notation described in POSIX 1003.2, 3.13 (*note
1175 wildcards::). For example:
1177 --pax-option delete=security.*
1179 would suppress security-related information.
1181 `exthdr.name=STRING'
1182 This keyword allows user control over the name that is written
1183 into the ustar header blocks for the extended headers. The name
1184 is obtained from STRING after making the following substitutions:
1186 Meta-character Replaced By
1187 --------------------------------------------------------
1188 %d The directory name of the file,
1189 equivalent to the result of the
1190 `dirname' utility on the translated
1192 %f The name of the file with the
1193 directory information stripped,
1194 equivalent to the result of the
1195 `basename' utility on the translated
1197 %p The process ID of the `tar' process.
1200 Any other `%' characters in STRING produce undefined results.
1202 If no option `exthdr.name=string' is specified, `tar' will use the
1203 following default value:
1207 `exthdr.mtime=VALUE'
1208 This keyword defines the value of the `mtime' field that is
1209 written into the ustar header blocks for the extended headers. By
1210 default, the `mtime' field is set to the modification time of the
1211 archive member described by that extended headers.
1213 `globexthdr.name=STRING'
1214 This keyword allows user control over the name that is written into
1215 the ustar header blocks for global extended header records. The
1216 name is obtained from the contents of STRING, after making the
1217 following substitutions:
1219 Meta-character Replaced By
1220 --------------------------------------------------------
1221 %n An integer that represents the
1222 sequence number of the global
1223 extended header record in the
1224 archive, starting at 1.
1225 %p The process ID of the `tar' process.
1228 Any other `%' characters in STRING produce undefined results.
1230 If no option `globexthdr.name=string' is specified, `tar' will use
1231 the following default value:
1233 $TMPDIR/GlobalHead.%p.%n
1235 where `$TMPDIR' represents the value of the TMPDIR environment
1236 variable. If TMPDIR is not set, `tar' uses `/tmp'.
1238 `globexthdr.mtime=VALUE'
1239 This keyword defines the value of the `mtime' field that is
1240 written into the ustar header blocks for the global extended
1241 headers. By default, the `mtime' field is set to the time when
1245 When used with one of archive-creation commands, these
1246 keyword/value pairs will be included at the beginning of the
1247 archive in a global extended header record. When used with one of
1248 archive-reading commands, `tar' will behave as if it has
1249 encountered these keyword/value pairs at the beginning of the
1250 archive in a global extended header record.
1253 When used with one of archive-creation commands, these
1254 keyword/value pairs will be included as records at the beginning
1255 of an extended header for each file. This is effectively
1256 equivalent to KEYWORD=VALUE form except that it creates no global
1257 extended header records.
1259 When used with one of archive-reading commands, `tar' will behave
1260 as if these keyword/value pairs were included as records at the
1261 end of each extended header; thus, they will override any global or
1262 file-specific extended header record keywords of the same names.
1263 For example, in the command:
1265 tar --format=posix --create \
1266 --file archive --pax-option gname:=user .
1268 the group name will be forced to a new value for all files stored
1271 In any of the forms described above, the VALUE may be a string
1272 enclosed in curly braces. In that case, the string between the braces
1273 is understood either as a textual time representation, as described in
1274 *note Date input formats::, or a name of the existing file, starting
1275 with `/' or `.'. In the latter case, the modification time of that
1278 For example, to set all modification times to the current date, you
1279 use the following option:
1281 --pax-option='mtime:={now}'
1283 Note quoting of the option's argument.
1285 As another example, here is the option that ensures that any two
1286 archives created using it, will be binary equivalent if they have the
1289 --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
1292 File: tar.info, Node: Checksumming, Next: Large or Negative Values, Prev: posix, Up: Portability
1294 8.3.8 Checksumming Problems
1295 ---------------------------
1297 SunOS and HP-UX `tar' fail to accept archives created using GNU `tar'
1298 and containing non-ASCII file names, that is, file names having
1299 characters with the eighth bit set, because they use signed checksums,
1300 while GNU `tar' uses unsigned checksums while creating archives, as per
1301 POSIX standards. On reading, GNU `tar' computes both checksums and
1302 accepts either of them. It is somewhat worrying that a lot of people
1303 may go around doing backup of their files using faulty (or at least
1304 non-standard) software, not learning about it until it's time to
1305 restore their missing files with an incompatible file extractor, or
1308 GNU `tar' computes checksums both ways, and accepts either of them
1309 on read, so GNU tar can read Sun tapes even with their wrong checksums.
1310 GNU `tar' produces the standard checksum, however, raising
1311 incompatibilities with Sun. That is to say, GNU `tar' has not been
1312 modified to _produce_ incorrect archives to be read by buggy `tar''s.
1313 I've been told that more recent Sun `tar' now read standard archives,
1314 so maybe Sun did a similar patch, after all?
1316 The story seems to be that when Sun first imported `tar' sources on
1317 their system, they recompiled it without realizing that the checksums
1318 were computed differently, because of a change in the default signing
1319 of `char''s in their compiler. So they started computing checksums
1320 wrongly. When they later realized their mistake, they merely decided
1321 to stay compatible with it, and with themselves afterwards.
1322 Presumably, but I do not really know, HP-UX has chosen their `tar'
1323 archives to be compatible with Sun's. The current standards do not
1324 favor Sun `tar' format. In any case, it now falls on the shoulders of
1325 SunOS and HP-UX users to get a `tar' able to read the good archives
1329 File: tar.info, Node: Large or Negative Values, Next: Other Tars, Prev: Checksumming, Up: Portability
1331 8.3.9 Large or Negative Values
1332 ------------------------------
1334 _(This message will disappear, once this node revised.)_
1336 The above sections suggest to use `oldest possible' archive format if
1337 in doubt. However, sometimes it is not possible. If you attempt to
1338 archive a file whose metadata cannot be represented using required
1339 format, GNU `tar' will print error message and ignore such a file. You
1340 will than have to switch to a format that is able to handle such
1341 values. The format summary table (*note Formats::) will help you to do
1344 In particular, when trying to archive files larger than 8GB or with
1345 timestamps not in the range 1970-01-01 00:00:00 through 2242-03-16
1346 12:56:31 UTC, you will have to chose between GNU and POSIX archive
1347 formats. When considering which format to choose, bear in mind that
1348 the GNU format uses two's-complement base-256 notation to store values
1349 that do not fit into standard ustar range. Such archives can generally
1350 be read only by a GNU `tar' implementation. Moreover, they sometimes
1351 cannot be correctly restored on another hosts even by GNU `tar'. For
1352 example, using two's complement representation for negative time stamps
1353 that assumes a signed 32-bit `time_t' generates archives that are not
1354 portable to hosts with differing `time_t' representations.
1356 On the other hand, POSIX archives, generally speaking, can be
1357 extracted by any tar implementation that understands older ustar
1358 format. The only exception are files larger than 8GB.
1361 File: tar.info, Node: Other Tars, Prev: Large or Negative Values, Up: Portability
1363 8.3.10 How to Extract GNU-Specific Data Using Other `tar' Implementations
1364 -------------------------------------------------------------------------
1366 In previous sections you became acquainted with various quirks
1367 necessary to make your archives portable. Sometimes you may need to
1368 extract archives containing GNU-specific members using some third-party
1369 `tar' implementation or an older version of GNU `tar'. Of course your
1370 best bet is to have GNU `tar' installed, but if it is for some reason
1371 impossible, this section will explain how to cope without it.
1373 When we speak about "GNU-specific" members we mean two classes of
1374 them: members split between the volumes of a multi-volume archive and
1375 sparse members. You will be able to always recover such members if the
1376 archive is in PAX format. In addition split members can be recovered
1377 from archives in old GNU format. The following subsections describe
1378 the required procedures in detail.
1382 * Split Recovery:: Members Split Between Volumes
1383 * Sparse Recovery:: Sparse Members
1386 File: tar.info, Node: Split Recovery, Next: Sparse Recovery, Up: Other Tars
1388 8.3.10.1 Extracting Members Split Between Volumes
1389 .................................................
1391 If a member is split between several volumes of an old GNU format
1392 archive most third party `tar' implementation will fail to extract it.
1393 To extract it, use `tarcat' program (*note Tarcat::). This program is
1394 available from GNU `tar' home page
1395 (http://www.gnu.org/software/tar/utils/tarcat.html). It concatenates
1396 several archive volumes into a single valid archive. For example, if
1397 you have three volumes named from `vol-1.tar' to `vol-3.tar', you can
1398 do the following to extract them using a third-party `tar':
1400 $ tarcat vol-1.tar vol-2.tar vol-3.tar | tar xf -
1402 You could use this approach for most (although not all) PAX format
1403 archives as well. However, extracting split members from a PAX archive
1404 is a much easier task, because PAX volumes are constructed in such a
1405 way that each part of a split member is extracted to a different file
1406 by `tar' implementations that are not aware of GNU extensions. More
1407 specifically, the very first part retains its original name, and all
1408 subsequent parts are named using the pattern:
1410 %d/GNUFileParts.%p/%f.%n
1412 where symbols preceeded by `%' are "macro characters" that have the
1415 Meta-character Replaced By
1416 ------------------------------------------------------------
1417 %d The directory name of the file,
1418 equivalent to the result of the
1419 `dirname' utility on its full name.
1420 %f The file name of the file, equivalent
1421 to the result of the `basename' utility
1423 %p The process ID of the `tar' process that
1424 created the archive.
1425 %n Ordinal number of this particular part.
1427 For example, if the file `var/longfile' was split during archive
1428 creation between three volumes, and the creator `tar' process had
1429 process ID `27962', then the member names will be:
1432 var/GNUFileParts.27962/longfile.1
1433 var/GNUFileParts.27962/longfile.2
1435 When you extract your archive using a third-party `tar', these files
1436 will be created on your disk, and the only thing you will need to do to
1437 restore your file in its original form is concatenate them in the
1438 proper order, for example:
1441 $ cat GNUFileParts.27962/longfile.1 \
1442 GNUFileParts.27962/longfile.2 >> longfile
1443 $ rm -f GNUFileParts.27962
1445 Notice, that if the `tar' implementation you use supports PAX format
1446 archives, it will probably emit warnings about unknown keywords during
1447 extraction. They will look like this:
1450 Unknown extended header keyword 'GNU.volume.filename' ignored.
1451 Unknown extended header keyword 'GNU.volume.size' ignored.
1452 Unknown extended header keyword 'GNU.volume.offset' ignored.
1454 You can safely ignore these warnings.
1456 If your `tar' implementation is not PAX-aware, you will get more
1457 warnings and more files generated on your disk, e.g.:
1460 var/PaxHeaders.27962/longfile: Unknown file type 'x', extracted as
1462 Unexpected EOF in archive
1464 tmp/GlobalHead.27962.1: Unknown file type 'g', extracted as normal file
1465 GNUFileParts.27962/PaxHeaders.27962/sparsefile.1: Unknown file type
1466 'x', extracted as normal file
1468 Ignore these warnings. The `PaxHeaders.*' directories created will
1469 contain files with "extended header keywords" describing the extracted
1470 files. You can delete them, unless they describe sparse members. Read
1471 further to learn more about them.
1474 File: tar.info, Node: Sparse Recovery, Prev: Split Recovery, Up: Other Tars
1476 8.3.10.2 Extracting Sparse Members
1477 ..................................
1479 Any `tar' implementation will be able to extract sparse members from a
1480 PAX archive. However, the extracted files will be "condensed", i.e.,
1481 any zero blocks will be removed from them. When we restore such a
1482 condensed file to its original form, by adding zero blocks (or "holes")
1483 back to their original locations, we call this process "expanding" a
1484 compressed sparse file.
1486 To expand a file, you will need a simple auxiliary program called
1487 `xsparse'. It is available in source form from GNU `tar' home page
1488 (http://www.gnu.org/software/tar/utils/xsparse.html).
1490 Let's begin with archive members in "sparse format version 1.0"(1),
1491 which are the easiest to expand. The condensed file will contain both
1492 file map and file data, so no additional data will be needed to restore
1493 it. If the original file name was `DIR/NAME', then the condensed file
1494 will be named `DIR/GNUSparseFile.N/NAME', where N is a decimal
1497 To expand a version 1.0 file, run `xsparse' as follows:
1499 $ xsparse `cond-file'
1501 where `cond-file' is the name of the condensed file. The utility will
1502 deduce the name for the resulting expanded file using the following
1505 1. If `cond-file' does not contain any directories, `../cond-file'
1508 2. If `cond-file' has the form `DIR/T/NAME', where both T and NAME
1509 are simple names, with no `/' characters in them, the output file
1510 name will be `DIR/NAME'.
1512 3. Otherwise, if `cond-file' has the form `DIR/NAME', the output file
1513 name will be `NAME'.
1515 In the unlikely case when this algorithm does not suit your needs,
1516 you can explicitly specify output file name as a second argument to the
1519 $ xsparse `cond-file' `out-file'
1521 It is often a good idea to run `xsparse' in "dry run" mode first.
1522 In this mode, the command does not actually expand the file, but
1523 verbosely lists all actions it would be taking to do so. The dry run
1524 mode is enabled by `-n' command line argument:
1526 $ xsparse -n /home/gray/GNUSparseFile.6058/sparsefile
1527 Reading v.1.0 sparse map
1528 Expanding file '/home/gray/GNUSparseFile.6058/sparsefile' to
1529 '/home/gray/sparsefile'
1532 To actually expand the file, you would run:
1534 $ xsparse /home/gray/GNUSparseFile.6058/sparsefile
1536 The program behaves the same way all UNIX utilities do: it will keep
1537 quiet unless it has simething important to tell you (e.g. an error
1538 condition or something). If you wish it to produce verbose output,
1539 similar to that from the dry run mode, use `-v' option:
1541 $ xsparse -v /home/gray/GNUSparseFile.6058/sparsefile
1542 Reading v.1.0 sparse map
1543 Expanding file '/home/gray/GNUSparseFile.6058/sparsefile' to
1544 '/home/gray/sparsefile'
1547 Additionally, if your `tar' implementation has extracted the
1548 "extended headers" for this file, you can instruct `xstar' to use them
1549 in order to verify the integrity of the expanded file. The option `-x'
1550 sets the name of the extended header file to use. Continuing our
1553 $ xsparse -v -x /home/gray/PaxHeaders.6058/sparsefile \
1554 /home/gray/GNUSparseFile.6058/sparsefile
1555 Reading extended header file
1556 Found variable GNU.sparse.major = 1
1557 Found variable GNU.sparse.minor = 0
1558 Found variable GNU.sparse.name = sparsefile
1559 Found variable GNU.sparse.realsize = 217481216
1560 Reading v.1.0 sparse map
1561 Expanding file '/home/gray/GNUSparseFile.6058/sparsefile' to
1562 '/home/gray/sparsefile'
1565 An "extended header" is a special `tar' archive header that precedes
1566 an archive member and contains a set of "variables", describing the
1567 member properties that cannot be stored in the standard `ustar' header.
1568 While optional for expanding sparse version 1.0 members, the use of
1569 extended headers is mandatory when expanding sparse members in older
1570 sparse formats: v.0.0 and v.0.1 (The sparse formats are described in
1571 detail in *note Sparse Formats::.) So, for these formats, the question
1572 is: how to obtain extended headers from the archive?
1574 If you use a `tar' implementation that does not support PAX format,
1575 extended headers for each member will be extracted as a separate file.
1576 If we represent the member name as `DIR/NAME', then the extended header
1577 file will be named `DIR/PaxHeaders.N/NAME', where N is an integer
1580 Things become more difficult if your `tar' implementation does
1581 support PAX headers, because in this case you will have to manually
1582 extract the headers. We recommend the following algorithm:
1584 1. Consult the documentation of your `tar' implementation for an
1585 option that prints "block numbers" along with the archive listing
1586 (analogous to GNU `tar''s `-R' option). For example, `star' has
1589 2. Obtain verbose listing using the `block number' option, and find
1590 block numbers of the sparse member in question and the member
1591 immediately following it. For example, running `star' on our
1594 $ star -t -v -block-number -f arc.tar
1596 star: Unknown extended header keyword 'GNU.sparse.size' ignored.
1597 star: Unknown extended header keyword 'GNU.sparse.numblocks' ignored.
1598 star: Unknown extended header keyword 'GNU.sparse.name' ignored.
1599 star: Unknown extended header keyword 'GNU.sparse.map' ignored.
1600 block 56: 425984 -rw-r--r-- gray/users Jun 25 14:46 2006 GNUSparseFile.28124/sparsefile
1601 block 897: 65391 -rw-r--r-- gray/users Jun 24 20:06 2006 README
1604 (as usual, ignore the warnings about unknown keywords.)
1606 3. Let SIZE be the size of the sparse member, BS be its block number
1607 and BN be the block number of the next member. Compute:
1609 N = BS - BN - SIZE/512 - 2
1611 This number gives the size of the extended header part in tar
1612 "blocks". In our example, this formula gives: `897 - 56 - 425984
1615 4. Use `dd' to extract the headers:
1617 dd if=ARCHIVE of=HNAME bs=512 skip=BS count=N
1619 where ARCHIVE is the archive name, HNAME is a name of the file to
1620 store the extended header in, BS and N are computed in previous
1623 In our example, this command will be
1625 $ dd if=arc.tar of=xhdr bs=512 skip=56 count=7
1627 Finally, you can expand the condensed file, using the obtained
1630 $ xsparse -v -x xhdr GNUSparseFile.6058/sparsefile
1631 Reading extended header file
1632 Found variable GNU.sparse.size = 217481216
1633 Found variable GNU.sparse.numblocks = 208
1634 Found variable GNU.sparse.name = sparsefile
1635 Found variable GNU.sparse.map = 0,2048,1050624,2048,...
1636 Expanding file 'GNUSparseFile.28124/sparsefile' to 'sparsefile'
1639 ---------- Footnotes ----------
1643 (2) Technically speaking, N is a "process ID" of the `tar' process
1644 which created the archive (*note PAX keywords::).
1647 File: tar.info, Node: cpio, Prev: Portability, Up: Formats
1649 8.4 Comparison of `tar' and `cpio'
1650 ==================================
1652 _(This message will disappear, once this node revised.)_
1654 The `cpio' archive formats, like `tar', do have maximum file name
1655 lengths. The binary and old ASCII formats have a maximum file length
1656 of 256, and the new ASCII and CRC ASCII formats have a max file length
1657 of 1024. GNU `cpio' can read and write archives with arbitrary file
1658 name lengths, but other `cpio' implementations may crash unexplainedly
1659 trying to read them.
1661 `tar' handles symbolic links in the form in which it comes in BSD;
1662 `cpio' doesn't handle symbolic links in the form in which it comes in
1663 System V prior to SVR4, and some vendors may have added symlinks to
1664 their system without enhancing `cpio' to know about them. Others may
1665 have enhanced it in a way other than the way I did it at Sun, and which
1666 was adopted by AT&T (and which is, I think, also present in the `cpio'
1667 that Berkeley picked up from AT&T and put into a later BSD release--I
1668 think I gave them my changes).
1670 (SVR4 does some funny stuff with `tar'; basically, its `cpio' can
1671 handle `tar' format input, and write it on output, and it probably
1672 handles symbolic links. They may not have bothered doing anything to
1673 enhance `tar' as a result.)
1675 `cpio' handles special files; traditional `tar' doesn't.
1677 `tar' comes with V7, System III, System V, and BSD source; `cpio'
1678 comes only with System III, System V, and later BSD (4.3-tahoe and
1681 `tar''s way of handling multiple hard links to a file can handle
1682 file systems that support 32-bit i-numbers (e.g., the BSD file system);
1683 `cpio's way requires you to play some games (in its "binary" format,
1684 i-numbers are only 16 bits, and in its "portable ASCII" format, they're
1685 18 bits--it would have to play games with the "file system ID" field of
1686 the header to make sure that the file system ID/i-number pairs of
1687 different files were always different), and I don't know which `cpio's,
1688 if any, play those games. Those that don't might get confused and
1689 think two files are the same file when they're not, and make hard links
1692 `tar's way of handling multiple hard links to a file places only one
1693 copy of the link on the tape, but the name attached to that copy is the
1694 _only_ one you can use to retrieve the file; `cpio's way puts one copy
1695 for every link, but you can retrieve it using any of the names.
1697 What type of check sum (if any) is used, and how is this
1700 See the attached manual pages for `tar' and `cpio' format. `tar'
1701 uses a checksum which is the sum of all the bytes in the `tar' header
1702 for a file; `cpio' uses no checksum.
1704 If anyone knows why `cpio' was made when `tar' was present at the
1707 It wasn't. `cpio' first showed up in PWB/UNIX 1.0; no
1708 generally-available version of UNIX had `tar' at the time. I don't
1709 know whether any version that was generally available _within AT&T_ had
1710 `tar', or, if so, whether the people within AT&T who did `cpio' knew
1713 On restore, if there is a corruption on a tape `tar' will stop at
1714 that point, while `cpio' will skip over it and try to restore the rest
1717 The main difference is just in the command syntax and header format.
1719 `tar' is a little more tape-oriented in that everything is blocked
1720 to start on a record boundary.
1722 Is there any differences between the ability to recover crashed
1723 archives between the two of them. (Is there any chance of
1724 recovering crashed archives at all.)
1726 Theoretically it should be easier under `tar' since the blocking
1727 lets you find a header with some variation of `dd skip=NN'. However,
1728 modern `cpio''s and variations have an option to just search for the
1729 next file header after an error with a reasonable chance of resyncing.
1730 However, lots of tape driver software won't allow you to continue past
1731 a media error which should be the only reason for getting out of sync
1732 unless a file changed sizes while you were writing the archive.
1734 If anyone knows why `cpio' was made when `tar' was present at the
1735 unix scene, please tell me about this too.
1737 Probably because it is more media efficient (by not blocking
1738 everything and using only the space needed for the headers where `tar'
1739 always uses 512 bytes per file header) and it knows how to archive
1742 You might want to look at the freely available alternatives. The
1743 major ones are `afio', GNU `tar', and `pax', each of which have their
1744 own extensions with some backwards compatibility.
1746 Sparse files were `tar'red as sparse files (which you can easily
1747 test, because the resulting archive gets smaller, and GNU `cpio' can no
1751 File: tar.info, Node: Media, Next: Reliability and security, Prev: Formats, Up: Top
1753 9 Tapes and Other Archive Media
1754 *******************************
1756 _(This message will disappear, once this node revised.)_
1758 A few special cases about tape handling warrant more detailed
1759 description. These special cases are discussed below.
1761 Many complexities surround the use of `tar' on tape drives. Since
1762 the creation and manipulation of archives located on magnetic tape was
1763 the original purpose of `tar', it contains many features making such
1764 manipulation easier.
1766 Archives are usually written on dismountable media--tape cartridges,
1767 mag tapes, or floppy disks.
1769 The amount of data a tape or disk holds depends not only on its size,
1770 but also on how it is formatted. A 2400 foot long reel of mag tape
1771 holds 40 megabytes of data when formatted at 1600 bits per inch. The
1772 physically smaller EXABYTE tape cartridge holds 2.3 gigabytes.
1774 Magnetic media are re-usable--once the archive on a tape is no longer
1775 needed, the archive can be erased and the tape or disk used over.
1776 Media quality does deteriorate with use, however. Most tapes or disks
1777 should be discarded when they begin to produce data errors. EXABYTE
1778 tape cartridges should be discarded when they generate an "error count"
1779 (number of non-usable bits) of more than 10k.
1781 Magnetic media are written and erased using magnetic fields, and
1782 should be protected from such fields to avoid damage to stored data.
1783 Sticking a floppy disk to a filing cabinet using a magnet is probably
1788 * Device:: Device selection and switching
1789 * Remote Tape Server::
1790 * Common Problems and Solutions::
1791 * Blocking:: Blocking
1792 * Many:: Many archives on one tape
1793 * Using Multiple Tapes:: Using Multiple Tapes
1794 * label:: Including a Label in the Archive
1796 * Write Protection::
1799 File: tar.info, Node: Device, Next: Remote Tape Server, Up: Media
1801 9.1 Device Selection and Switching
1802 ==================================
1804 _(This message will disappear, once this node revised.)_
1806 `-f [HOSTNAME:]FILE'
1807 `--file=[HOSTNAME:]FILE'
1808 Use archive file or device FILE on HOSTNAME.
1810 This option is used to specify the file name of the archive `tar'
1813 If the file name is `-', `tar' reads the archive from standard input
1814 (when listing or extracting), or writes it to standard output (when
1815 creating). If the `-' file name is given when updating an archive,
1816 `tar' will read the original archive from its standard input, and will
1817 write the entire new archive to its standard output.
1819 If the file name contains a `:', it is interpreted as `hostname:file
1820 name'. If the HOSTNAME contains an "at" sign (`@'), it is treated as
1821 `user@hostname:file name'. In either case, `tar' will invoke the
1822 command `rsh' (or `remsh') to start up an `/usr/libexec/rmt' on the
1823 remote machine. If you give an alternate login name, it will be given
1824 to the `rsh'. Naturally, the remote machine must have an executable
1825 `/usr/libexec/rmt'. This program is free software from the University
1826 of California, and a copy of the source code can be found with the
1827 sources for `tar'; it's compiled and installed by default. The exact
1828 path to this utility is determined when configuring the package. It is
1829 `PREFIX/libexec/rmt', where PREFIX stands for your installation prefix.
1830 This location may also be overridden at runtime by using the
1831 `--rmt-command=COMMAND' option (*Note --rmt-command: Option Summary,
1832 for detailed description of this option. *Note Remote Tape Server::,
1833 for the description of `rmt' command).
1835 If this option is not given, but the environment variable `TAPE' is
1836 set, its value is used; otherwise, old versions of `tar' used a default
1837 archive name (which was picked when `tar' was compiled). The default
1838 is normally set up to be the "first" tape drive or other transportable
1839 I/O medium on the system.
1841 Starting with version 1.11.5, GNU `tar' uses standard input and
1842 standard output as the default device, and I will not try anymore
1843 supporting automatic device detection at installation time. This was
1844 failing really in too many cases, it was hopeless. This is now
1845 completely left to the installer to override standard input and
1846 standard output for default device, if this seems preferable. Further,
1847 I think _most_ actual usages of `tar' are done with pipes or disks, not
1848 really tapes, cartridges or diskettes.
1850 Some users think that using standard input and output is running
1851 after trouble. This could lead to a nasty surprise on your screen if
1852 you forget to specify an output file name--especially if you are going
1853 through a network or terminal server capable of buffering large amounts
1854 of output. We had so many bug reports in that area of configuring
1855 default tapes automatically, and so many contradicting requests, that
1856 we finally consider the problem to be portably intractable. We could
1857 of course use something like `/dev/tape' as a default, but this is
1858 _also_ running after various kind of trouble, going from hung processes
1859 to accidental destruction of real tapes. After having seen all this
1860 mess, using standard input and output as a default really sounds like
1861 the only clean choice left, and a very useful one too.
1863 GNU `tar' reads and writes archive in records, I suspect this is the
1864 main reason why block devices are preferred over character devices.
1865 Most probably, block devices are more efficient too. The installer
1866 could also check for `DEFTAPE' in `<sys/mtio.h>'.
1869 Archive file is local even if it contains a colon.
1871 `--rsh-command=COMMAND'
1872 Use remote COMMAND instead of `rsh'. This option exists so that
1873 people who use something other than the standard `rsh' (e.g., a
1874 Kerberized `rsh') can access a remote device.
1876 When this command is not used, the shell command found when the
1877 `tar' program was installed is used instead. This is the first
1878 found of `/usr/ucb/rsh', `/usr/bin/remsh', `/usr/bin/rsh',
1879 `/usr/bsd/rsh' or `/usr/bin/nsh'. The installer may have
1880 overridden this by defining the environment variable `RSH' _at
1884 Specify drive and density.
1888 Create/list/extract multi-volume archive.
1890 This option causes `tar' to write a "multi-volume" archive--one
1891 that may be larger than will fit on the medium used to hold it.
1892 *Note Multi-Volume Archives::.
1895 `--tape-length=SIZE[SUF]'
1896 Change tape after writing SIZE units of data. Unless SUF is
1897 given, SIZE is treated as kilobytes, i.e. `SIZE x 1024' bytes.
1898 The following suffixes alter this behavior:
1900 Suffix Units Byte Equivalent
1901 --------------------------------------------------------
1903 B Kilobytes SIZE x 1024
1905 G Gigabytes SIZE x 1024^3
1906 K Kilobytes SIZE x 1024
1907 k Kilobytes SIZE x 1024
1908 M Megabytes SIZE x 1024^2
1909 P Petabytes SIZE x 1024^5
1910 T Terabytes SIZE x 1024^4
1913 Table 9.1: Size Suffixes
1915 This option might be useful when your tape drivers do not
1916 properly detect end of physical tapes. By being slightly
1917 conservative on the maximum tape length, you might avoid the
1921 `--info-script=COMMAND'
1922 `--new-volume-script=COMMAND'
1923 Execute COMMAND at end of each tape. This implies
1924 `--multi-volume' (`-M'). *Note info-script::, for a detailed
1925 description of this option.
1928 File: tar.info, Node: Remote Tape Server, Next: Common Problems and Solutions, Prev: Device, Up: Media
1930 9.2 Remote Tape Server
1931 ======================
1933 In order to access the tape drive on a remote machine, `tar' uses the
1934 remote tape server written at the University of California at Berkeley.
1935 The remote tape server must be installed as `PREFIX/libexec/rmt' on any
1936 machine whose tape drive you want to use. `tar' calls `rmt' by running
1937 an `rsh' or `remsh' to the remote machine, optionally using a different
1938 login name if one is supplied.
1940 A copy of the source for the remote tape server is provided. Its
1941 source code can be freely distributed. It is compiled and installed by
1944 Unless you use the `--absolute-names' (`-P') option, GNU `tar' will
1945 not allow you to create an archive that contains absolute file names (a
1946 file name beginning with `/'.) If you try, `tar' will automatically
1947 remove the leading `/' from the file names it stores in the archive.
1948 It will also type a warning message telling you what it is doing.
1950 When reading an archive that was created with a different `tar'
1951 program, GNU `tar' automatically extracts entries in the archive which
1952 have absolute file names as if the file names were not absolute. This
1953 is an important feature. A visitor here once gave a `tar' tape to an
1954 operator to restore; the operator used Sun `tar' instead of GNU `tar',
1955 and the result was that it replaced large portions of our `/bin' and
1956 friends with versions from the tape; needless to say, we were unhappy
1957 about having to recover the file system from backup tapes.
1959 For example, if the archive contained a file `/usr/bin/computoy',
1960 GNU `tar' would extract the file to `usr/bin/computoy', relative to the
1961 current directory. If you want to extract the files in an archive to
1962 the same absolute names that they had when the archive was created, you
1963 should do a `cd /' before extracting the files from the archive, or you
1964 should either use the `--absolute-names' option, or use the command
1967 Some versions of Unix (Ultrix 3.1 is known to have this problem),
1968 can claim that a short write near the end of a tape succeeded, when it
1969 actually failed. This will result in the -M option not working
1970 correctly. The best workaround at the moment is to use a significantly
1971 larger blocking factor than the default 20.
1973 In order to update an archive, `tar' must be able to backspace the
1974 archive in order to reread or rewrite a record that was just read (or
1975 written). This is currently possible only on two kinds of files: normal
1976 disk files (or any other file that can be backspaced with `lseek'), and
1977 industry-standard 9-track magnetic tape (or any other kind of tape that
1978 can be backspaced with the `MTIOCTOP' `ioctl').
1980 This means that the `--append', `--concatenate', and `--delete'
1981 commands will not work on any other kind of file. Some media simply
1982 cannot be backspaced, which means these commands and options will never
1983 be able to work on them. These non-backspacing media include pipes and
1984 cartridge tape drives.
1986 Some other media can be backspaced, and `tar' will work on them once
1987 `tar' is modified to do so.
1989 Archives created with the `--multi-volume', `--label', and
1990 `--incremental' (`-G') options may not be readable by other version of
1991 `tar'. In particular, restoring a file that was split over a volume
1992 boundary will require some careful work with `dd', if it can be done at
1993 all. Other versions of `tar' may also create an empty file whose name
1994 is that of the volume header. Some versions of `tar' may create normal
1995 files instead of directories archived with the `--incremental' (`-G')
1999 File: tar.info, Node: Common Problems and Solutions, Next: Blocking, Prev: Remote Tape Server, Up: Media
2001 9.3 Some Common Problems and their Solutions
2002 ============================================
2006 no such file or directory
2010 directory checksum error
2013 errors from media/system:
2018 File: tar.info, Node: Blocking, Next: Many, Prev: Common Problems and Solutions, Up: Media
2023 "Block" and "record" terminology is rather confused, and it is also
2024 confusing to the expert reader. On the other hand, readers who are new
2025 to the field have a fresh mind, and they may safely skip the next two
2026 paragraphs, as the remainder of this manual uses those two terms in a
2027 quite consistent way.
2029 John Gilmore, the writer of the public domain `tar' from which GNU
2030 `tar' was originally derived, wrote (June 1995):
2032 The nomenclature of tape drives comes from IBM, where I believe
2033 they were invented for the IBM 650 or so. On IBM mainframes, what
2034 is recorded on tape are tape blocks. The logical organization of
2035 data is into records. There are various ways of putting records
2036 into blocks, including `F' (fixed sized records), `V' (variable
2037 sized records), `FB' (fixed blocked: fixed size records, N to a
2038 block), `VB' (variable size records, N to a block), `VSB'
2039 (variable spanned blocked: variable sized records that can occupy
2040 more than one block), etc. The `JCL' `DD RECFORM=' parameter
2041 specified this to the operating system.
2043 The Unix man page on `tar' was totally confused about this. When
2044 I wrote `PD TAR', I used the historically correct terminology
2045 (`tar' writes data records, which are grouped into blocks). It
2046 appears that the bogus terminology made it into POSIX (no surprise
2047 here), and now Franc,ois has migrated that terminology back into
2048 the source code too.
2050 The term "physical block" means the basic transfer chunk from or to
2051 a device, after which reading or writing may stop without anything
2052 being lost. In this manual, the term "block" usually refers to a disk
2053 physical block, _assuming_ that each disk block is 512 bytes in length.
2054 It is true that some disk devices have different physical blocks, but
2055 `tar' ignore these differences in its own format, which is meant to be
2056 portable, so a `tar' block is always 512 bytes in length, and "block"
2057 always mean a `tar' block. The term "logical block" often represents
2058 the basic chunk of allocation of many disk blocks as a single entity,
2059 which the operating system treats somewhat atomically; this concept is
2060 only barely used in GNU `tar'.
2062 The term "physical record" is another way to speak of a physical
2063 block, those two terms are somewhat interchangeable. In this manual,
2064 the term "record" usually refers to a tape physical block, _assuming_
2065 that the `tar' archive is kept on magnetic tape. It is true that
2066 archives may be put on disk or used with pipes, but nevertheless, `tar'
2067 tries to read and write the archive one "record" at a time, whatever
2068 the medium in use. One record is made up of an integral number of
2069 blocks, and this operation of putting many disk blocks into a single
2070 tape block is called "reblocking", or more simply, "blocking". The
2071 term "logical record" refers to the logical organization of many
2072 characters into something meaningful to the application. The term
2073 "unit record" describes a small set of characters which are transmitted
2074 whole to or by the application, and often refers to a line of text.
2075 Those two last terms are unrelated to what we call a "record" in GNU
2078 When writing to tapes, `tar' writes the contents of the archive in
2079 chunks known as "records". To change the default blocking factor, use
2080 the `--blocking-factor=512-SIZE' (`-b 512-SIZE') option. Each record
2081 will then be composed of 512-SIZE blocks. (Each `tar' block is 512
2082 bytes. *Note Standard::.) Each file written to the archive uses at
2083 least one full record. As a result, using a larger record size can
2084 result in more wasted space for small files. On the other hand, a
2085 larger record size can often be read and written much more efficiently.
2087 Further complicating the problem is that some tape drives ignore the
2088 blocking entirely. For these, a larger record size can still improve
2089 performance (because the software layers above the tape drive still
2090 honor the blocking), but not as dramatically as on tape drives that
2093 When reading an archive, `tar' can usually figure out the record
2094 size on itself. When this is the case, and a non-standard record size
2095 was used when the archive was created, `tar' will print a message about
2096 a non-standard blocking factor, and then operate normally(1). On some
2097 tape devices, however, `tar' cannot figure out the record size itself.
2098 On most of those, you can specify a blocking factor (with
2099 `--blocking-factor') larger than the actual blocking factor, and then
2100 use the `--read-full-records' (`-B') option. (If you specify a
2101 blocking factor with `--blocking-factor' and don't use the
2102 `--read-full-records' option, then `tar' will not attempt to figure out
2103 the recording size itself.) On some devices, you must always specify
2104 the record size exactly with `--blocking-factor' when reading, because
2105 `tar' cannot figure it out. In any case, use `--list' (`-t') before
2106 doing any extractions to see whether `tar' is reading the archive
2109 `tar' blocks are all fixed size (512 bytes), and its scheme for
2110 putting them into records is to put a whole number of them (one or
2111 more) into each record. `tar' records are all the same size; at the
2112 end of the file there's a block containing all zeros, which is how you
2113 tell that the remainder of the last record(s) are garbage.
2115 In a standard `tar' file (no options), the block size is 512 and the
2116 record size is 10240, for a blocking factor of 20. What the
2117 `--blocking-factor' option does is sets the blocking factor, changing
2118 the record size while leaving the block size at 512 bytes. 20 was fine
2119 for ancient 800 or 1600 bpi reel-to-reel tape drives; most tape drives
2120 these days prefer much bigger records in order to stream and not waste
2121 tape. When writing tapes for myself, some tend to use a factor of the
2122 order of 2048, say, giving a record size of around one megabyte.
2124 If you use a blocking factor larger than 20, older `tar' programs
2125 might not be able to read the archive, so we recommend this as a limit
2126 to use in practice. GNU `tar', however, will support arbitrarily large
2127 record sizes, limited only by the amount of virtual memory or the
2128 physical characteristics of the tape device.
2132 * Format Variations:: Format Variations
2133 * Blocking Factor:: The Blocking Factor of an Archive
2135 ---------- Footnotes ----------
2137 (1) If this message is not needed, you can turn it off using the
2138 `--warning=no-record-size' option.
2141 File: tar.info, Node: Format Variations, Next: Blocking Factor, Up: Blocking
2143 9.4.1 Format Variations
2144 -----------------------
2146 _(This message will disappear, once this node revised.)_
2148 Format parameters specify how an archive is written on the archive
2149 media. The best choice of format parameters will vary depending on the
2150 type and number of files being archived, and on the media used to store
2153 To specify format parameters when accessing or creating an archive,
2154 you can use the options described in the following sections. If you do
2155 not specify any format parameters, `tar' uses default parameters. You
2156 cannot modify a compressed archive. If you create an archive with the
2157 `--blocking-factor' option specified (*note Blocking Factor::), you
2158 must specify that blocking-factor when operating on the archive. *Note
2159 Formats::, for other examples of format parameter considerations.
2162 File: tar.info, Node: Blocking Factor, Prev: Format Variations, Up: Blocking
2164 9.4.2 The Blocking Factor of an Archive
2165 ---------------------------------------
2167 _(This message will disappear, once this node revised.)_
2169 The data in an archive is grouped into blocks, which are 512 bytes.
2170 Blocks are read and written in whole number multiples called "records".
2171 The number of blocks in a record (i.e., the size of a record in units
2172 of 512 bytes) is called the "blocking factor". The
2173 `--blocking-factor=512-SIZE' (`-b 512-SIZE') option specifies the
2174 blocking factor of an archive. The default blocking factor is
2175 typically 20 (i.e., 10240 bytes), but can be specified at installation.
2176 To find out the blocking factor of an existing archive, use `tar --list
2177 --file=ARCHIVE-NAME'. This may not work on some devices.
2179 Records are separated by gaps, which waste space on the archive
2180 media. If you are archiving on magnetic tape, using a larger blocking
2181 factor (and therefore larger records) provides faster throughput and
2182 allows you to fit more data on a tape (because there are fewer gaps).
2183 If you are archiving on cartridge, a very large blocking factor (say
2184 126 or more) greatly increases performance. A smaller blocking factor,
2185 on the other hand, may be useful when archiving small files, to avoid
2186 archiving lots of nulls as `tar' fills out the archive to the end of
2187 the record. In general, the ideal record size depends on the size of
2188 the inter-record gaps on the tape you are using, and the average size
2189 of the files you are archiving. *Note create::, for information on
2192 Archives with blocking factors larger than 20 cannot be read by very
2193 old versions of `tar', or by some newer versions of `tar' running on
2194 old machines with small address spaces. With GNU `tar', the blocking
2195 factor of an archive is limited only by the maximum record size of the
2196 device containing the archive, or by the amount of available virtual
2199 Also, on some systems, not using adequate blocking factors, as
2200 sometimes imposed by the device drivers, may yield unexpected
2201 diagnostics. For example, this has been reported:
2203 Cannot write to /dev/dlt: Invalid argument
2205 In such cases, it sometimes happen that the `tar' bundled by the system
2206 is aware of block size idiosyncrasies, while GNU `tar' requires an
2207 explicit specification for the block size, which it cannot guess. This
2208 yields some people to consider GNU `tar' is misbehaving, because by
2209 comparison, `the bundle `tar' works OK'. Adding `-b 256', for example,
2210 might resolve the problem.
2212 If you use a non-default blocking factor when you create an archive,
2213 you must specify the same blocking factor when you modify that archive.
2214 Some archive devices will also require you to specify the blocking
2215 factor when reading that archive, however this is not typically the
2216 case. Usually, you can use `--list' (`-t') without specifying a
2217 blocking factor--`tar' reports a non-default record size and then lists
2218 the archive members as it would normally. To extract files from an
2219 archive with a non-standard blocking factor (particularly if you're not
2220 sure what the blocking factor is), you can usually use the
2221 `--read-full-records' (`-B') option while specifying a blocking factor
2222 larger then the blocking factor of the archive (i.e., `tar --extract
2223 --read-full-records --blocking-factor=300'). *Note list::, for more
2224 information on the `--list' (`-t') operation. *Note Reading::, for a
2225 more detailed explanation of that option.
2227 `--blocking-factor=NUMBER'
2229 Specifies the blocking factor of an archive. Can be used with any
2230 operation, but is usually not necessary with `--list' (`-t').
2235 `--blocking-factor=BLOCKS'
2236 Set record size to BLOCKS*512 bytes.
2238 This option is used to specify a "blocking factor" for the archive.
2239 When reading or writing the archive, `tar', will do reads and
2240 writes of the archive in records of BLOCK*512 bytes. This is true
2241 even when the archive is compressed. Some devices requires that
2242 all write operations be a multiple of a certain size, and so, `tar'
2243 pads the archive out to the next record boundary.
2245 The default blocking factor is set when `tar' is compiled, and is
2246 typically 20. Blocking factors larger than 20 cannot be read by
2247 very old versions of `tar', or by some newer versions of `tar'
2248 running on old machines with small address spaces.
2250 With a magnetic tape, larger records give faster throughput and fit
2251 more data on a tape (because there are fewer inter-record gaps).
2252 If the archive is in a disk file or a pipe, you may want to specify
2253 a smaller blocking factor, since a large one will result in a large
2254 number of null bytes at the end of the archive.
2256 When writing cartridge or other streaming tapes, a much larger
2257 blocking factor (say 126 or more) will greatly increase
2258 performance. However, you must specify the same blocking factor
2259 when reading or updating the archive.
2261 Apparently, Exabyte drives have a physical block size of 8K bytes.
2262 If we choose our blocksize as a multiple of 8k bytes, then the
2263 problem seems to disappear. Id est, we are using block size of
2264 112 right now, and we haven't had the problem since we switched...
2266 With GNU `tar' the blocking factor is limited only by the maximum
2267 record size of the device containing the archive, or by the amount
2268 of available virtual memory.
2270 However, deblocking or reblocking is virtually avoided in a special
2271 case which often occurs in practice, but which requires all the
2272 following conditions to be simultaneously true:
2273 * the archive is subject to a compression option,
2275 * the archive is not handled through standard input or output,
2276 nor redirected nor piped,
2278 * the archive is directly handled to a local disk, instead of
2281 * `--blocking-factor' is not explicitly specified on the `tar'
2284 If the output goes directly to a local disk, and not through
2285 stdout, then the last write is not extended to a full record size.
2286 Otherwise, reblocking occurs. Here are a few other remarks on this
2289 * `gzip' will complain about trailing garbage if asked to
2290 uncompress a compressed archive on tape, there is an option
2291 to turn the message off, but it breaks the regularity of
2292 simply having to use `PROG -d' for decompression. It would
2293 be nice if gzip was silently ignoring any number of trailing
2294 zeros. I'll ask Jean-loup Gailly, by sending a copy of this
2297 * `compress' does not show this problem, but as Jean-loup
2298 pointed out to Michael, `compress -d' silently adds garbage
2299 after the result of decompression, which tar ignores because
2300 it already recognized its end-of-file indicator. So this bug
2301 may be safely ignored.
2303 * `gzip -d -q' will be silent about the trailing zeros indeed,
2304 but will still return an exit status of 2 which tar reports
2305 in turn. `tar' might ignore the exit status returned, but I
2306 hate doing that, as it weakens the protection `tar' offers
2307 users against other possible problems at decompression time.
2308 If `gzip' was silently skipping trailing zeros _and_ also
2309 avoiding setting the exit status in this innocuous case, that
2310 would solve this situation.
2312 * `tar' should become more solid at not stopping to read a pipe
2313 at the first null block encountered. This inelegantly breaks
2314 the pipe. `tar' should rather drain the pipe out before
2319 Ignore blocks of zeros in archive (means EOF).
2321 The `--ignore-zeros' (`-i') option causes `tar' to ignore blocks
2322 of zeros in the archive. Normally a block of zeros indicates the
2323 end of the archive, but when reading a damaged archive, or one
2324 which was created by concatenating several archives together, this
2325 option allows `tar' to read the entire archive. This option is
2326 not on by default because many versions of `tar' write garbage
2327 after the zeroed blocks.
2329 Note that this option causes `tar' to read to the end of the
2330 archive file, which may sometimes avoid problems when multiple
2331 files are stored on a single physical tape.
2334 `--read-full-records'
2335 Reblock as we read (for reading 4.2BSD pipes).
2337 If `--read-full-records' is used, `tar' will not panic if an
2338 attempt to read a record from the archive does not return a full
2339 record. Instead, `tar' will keep reading until it has obtained a
2342 This option is turned on by default when `tar' is reading an
2343 archive from standard input, or from a remote machine. This is
2344 because on BSD Unix systems, a read of a pipe will return however
2345 much happens to be in the pipe, even if it is less than `tar'
2346 requested. If this option was not used, `tar' would fail as soon
2347 as it read an incomplete record from the pipe.
2349 This option is also useful with the commands for updating an
2355 When handling various tapes or cartridges, you have to take care of
2356 selecting a proper blocking, that is, the number of disk blocks you put
2357 together as a single tape block on the tape, without intervening tape
2358 gaps. A "tape gap" is a small landing area on the tape with no
2359 information on it, used for decelerating the tape to a full stop, and
2360 for later regaining the reading or writing speed. When the tape driver
2361 starts reading a record, the record has to be read whole without
2362 stopping, as a tape gap is needed to stop the tape motion without
2365 Using higher blocking (putting more disk blocks per tape block) will
2366 use the tape more efficiently as there will be less tape gaps. But
2367 reading such tapes may be more difficult for the system, as more memory
2368 will be required to receive at once the whole record. Further, if
2369 there is a reading error on a huge record, this is less likely that the
2370 system will succeed in recovering the information. So, blocking should
2371 not be too low, nor it should be too high. `tar' uses by default a
2372 blocking of 20 for historical reasons, and it does not really matter
2373 when reading or writing to disk. Current tape technology would easily
2374 accommodate higher blockings. Sun recommends a blocking of 126 for
2375 Exabytes and 96 for DATs. We were told that for some DLT drives, the
2376 blocking should be a multiple of 4Kb, preferably 64Kb (`-b 128') or 256
2377 for decent performance. Other manufacturers may use different
2378 recommendations for the same tapes. This might also depends of the
2379 buffering techniques used inside modern tape controllers. Some imposes
2380 a minimum blocking, or a maximum blocking. Others request blocking to
2381 be some exponent of two.
2383 So, there is no fixed rule for blocking. But blocking at read time
2384 should ideally be the same as blocking used at write time. At one place
2385 I know, with a wide variety of equipment, they found it best to use a
2386 blocking of 32 to guarantee that their tapes are fully interchangeable.
2388 I was also told that, for recycled tapes, prior erasure (by the same
2389 drive unit that will be used to create the archives) sometimes lowers
2390 the error rates observed at rewriting time.
2392 I might also use `--number-blocks' instead of `--block-number', so
2393 `--block' will then expand to `--blocking-factor' unambiguously.
2396 File: tar.info, Node: Many, Next: Using Multiple Tapes, Prev: Blocking, Up: Media
2398 9.5 Many Archives on One Tape
2399 =============================
2401 Most tape devices have two entries in the `/dev' directory, or entries
2402 that come in pairs, which differ only in the minor number for this
2403 device. Let's take for example `/dev/tape', which often points to the
2404 only or usual tape device of a given system. There might be a
2405 corresponding `/dev/nrtape' or `/dev/ntape'. The simpler name is the
2406 _rewinding_ version of the device, while the name having `nr' in it is
2407 the _no rewinding_ version of the same device.
2409 A rewinding tape device will bring back the tape to its beginning
2410 point automatically when this device is opened or closed. Since `tar'
2411 opens the archive file before using it and closes it afterwards, this
2412 means that a simple:
2414 $ tar cf /dev/tape DIRECTORY
2416 will reposition the tape to its beginning both prior and after saving
2417 DIRECTORY contents to it, thus erasing prior tape contents and making
2418 it so that any subsequent write operation will destroy what has just
2421 So, a rewinding device is normally meant to hold one and only one
2422 file. If you want to put more than one `tar' archive on a given tape,
2423 you will need to avoid using the rewinding version of the tape device.
2424 You will also have to pay special attention to tape positioning.
2425 Errors in positioning may overwrite the valuable data already on your
2426 tape. Many people, burnt by past experiences, will only use rewinding
2427 devices and limit themselves to one file per tape, precisely to avoid
2428 the risk of such errors. Be fully aware that writing at the wrong
2429 position on a tape loses all information past this point and most
2430 probably until the end of the tape, and this destroyed information
2431 _cannot_ be recovered.
2433 To save DIRECTORY-1 as a first archive at the beginning of a tape,
2434 and leave that tape ready for a second archive, you should use:
2436 $ mt -f /dev/nrtape rewind
2437 $ tar cf /dev/nrtape DIRECTORY-1
2439 "Tape marks" are special magnetic patterns written on the tape
2440 media, which are later recognizable by the reading hardware. These
2441 marks are used after each file, when there are many on a single tape.
2442 An empty file (that is to say, two tape marks in a row) signal the
2443 logical end of the tape, after which no file exist. Usually,
2444 non-rewinding tape device drivers will react to the close request issued
2445 by `tar' by first writing two tape marks after your archive, and by
2446 backspacing over one of these. So, if you remove the tape at that time
2447 from the tape drive, it is properly terminated. But if you write
2448 another file at the current position, the second tape mark will be
2449 erased by the new information, leaving only one tape mark between files.
2451 So, you may now save DIRECTORY-2 as a second archive after the first
2452 on the same tape by issuing the command:
2454 $ tar cf /dev/nrtape DIRECTORY-2
2456 and so on for all the archives you want to put on the same tape.
2458 Another usual case is that you do not write all the archives the same
2459 day, and you need to remove and store the tape between two archive
2460 sessions. In general, you must remember how many files are already
2461 saved on your tape. Suppose your tape already has 16 files on it, and
2462 that you are ready to write the 17th. You have to take care of skipping
2463 the first 16 tape marks before saving DIRECTORY-17, say, by using these
2466 $ mt -f /dev/nrtape rewind
2467 $ mt -f /dev/nrtape fsf 16
2468 $ tar cf /dev/nrtape DIRECTORY-17
2470 In all the previous examples, we put aside blocking considerations,
2471 but you should do the proper things for that as well. *Note Blocking::.
2475 * Tape Positioning:: Tape Positions and Tape Marks
2476 * mt:: The `mt' Utility
2479 File: tar.info, Node: Tape Positioning, Next: mt, Up: Many
2481 9.5.1 Tape Positions and Tape Marks
2482 -----------------------------------
2484 _(This message will disappear, once this node revised.)_
2486 Just as archives can store more than one file from the file system,
2487 tapes can store more than one archive file. To keep track of where
2488 archive files (or any other type of file stored on tape) begin and end,
2489 tape archive devices write magnetic "tape marks" on the archive media.
2490 Tape drives write one tape mark between files, two at the end of all
2493 If you think of data as a series of records "rrrr"'s, and tape marks
2494 as "*"'s, a tape might look like the following:
2496 rrrr*rrrrrr*rrrrr*rr*rrrrr**-------------------------
2498 Tape devices read and write tapes using a read/write "tape head"--a
2499 physical part of the device which can only access one point on the tape
2500 at a time. When you use `tar' to read or write archive data from a
2501 tape device, the device will begin reading or writing from wherever on
2502 the tape the tape head happens to be, regardless of which archive or
2503 what part of the archive the tape head is on. Before writing an
2504 archive, you should make sure that no data on the tape will be
2505 overwritten (unless it is no longer needed). Before reading an
2506 archive, you should make sure the tape head is at the beginning of the
2507 archive you want to read. You can do it manually via `mt' utility
2508 (*note mt::). The `restore' script does that automatically (*note
2509 Scripted Restoration::).
2511 If you want to add new archive file entries to a tape, you should
2512 advance the tape to the end of the existing file entries, backspace
2513 over the last tape mark, and write the new archive file. If you were
2514 to add two archives to the example above, the tape might look like the
2517 rrrr*rrrrrr*rrrrr*rr*rrrrr*rrr*rrrr**----------------
2520 File: tar.info, Node: mt, Prev: Tape Positioning, Up: Many
2522 9.5.2 The `mt' Utility
2523 ----------------------
2525 _(This message will disappear, once this node revised.)_
2527 *Note Blocking Factor::.
2529 You can use the `mt' utility to advance or rewind a tape past a
2530 specified number of archive files on the tape. This will allow you to
2531 move to the beginning of an archive before extracting or reading it, or
2532 to the end of all the archives before writing a new one.
2534 The syntax of the `mt' command is:
2536 mt [-f TAPENAME] OPERATION [NUMBER]
2538 where TAPENAME is the name of the tape device, NUMBER is the number
2539 of times an operation is performed (with a default of one), and
2540 OPERATION is one of the following:
2544 Writes NUMBER tape marks at the current position on the tape.
2547 Moves tape position forward NUMBER files.
2550 Moves tape position back NUMBER files.
2553 Rewinds the tape. (Ignores NUMBER.)
2557 Rewinds the tape and takes the tape device off-line. (Ignores
2561 Prints status information about the tape unit.
2564 If you don't specify a TAPENAME, `mt' uses the environment variable
2565 `TAPE'; if `TAPE' is not set, `mt' will use the default device
2566 specified in your `sys/mtio.h' file (`DEFTAPE' variable). If this is
2567 not defined, the program will display a descriptive error message and
2570 `mt' returns a 0 exit status when the operation(s) were successful,
2571 1 if the command was unrecognized, and 2 if an operation failed.
2574 File: tar.info, Node: Using Multiple Tapes, Next: label, Prev: Many, Up: Media
2576 9.6 Using Multiple Tapes
2577 ========================
2579 Often you might want to write a large archive, one larger than will fit
2580 on the actual tape you are using. In such a case, you can run multiple
2581 `tar' commands, but this can be inconvenient, particularly if you are
2582 using options like `--exclude=PATTERN' or dumping entire file systems.
2583 Therefore, `tar' provides a special mode for creating multi-volume
2586 "Multi-volume" archive is a single `tar' archive, stored on several
2587 media volumes of fixed size. Although in this section we will often
2588 call `volume' a "tape", there is absolutely no requirement for
2589 multi-volume archives to be stored on tapes. Instead, they can use
2590 whatever media type the user finds convenient, they can even be located
2593 When creating a multi-volume archive, GNU `tar' continues to fill
2594 current volume until it runs out of space, then it switches to next
2595 volume (usually the operator is queried to replace the tape on this
2596 point), and continues working on the new volume. This operation
2597 continues until all requested files are dumped. If GNU `tar' detects
2598 end of media while dumping a file, such a file is archived in split
2599 form. Some very big files can even be split across several volumes.
2601 Each volume is itself a valid GNU `tar' archive, so it can be read
2602 without any special options. Consequently any file member residing
2603 entirely on one volume can be extracted or otherwise operated upon
2604 without needing the other volume. Sure enough, to extract a split
2605 member you would need all volumes its parts reside on.
2607 Multi-volume archives suffer from several limitations. In
2608 particular, they cannot be compressed.
2610 GNU `tar' is able to create multi-volume archives of two formats
2611 (*note Formats::): `GNU' and `POSIX'.
2615 * Multi-Volume Archives:: Archives Longer than One Tape or Disk
2616 * Tape Files:: Tape Files
2617 * Tarcat:: Concatenate Volumes into a Single Archive
2620 File: tar.info, Node: Multi-Volume Archives, Next: Tape Files, Up: Using Multiple Tapes
2622 9.6.1 Archives Longer than One Tape or Disk
2623 -------------------------------------------
2625 To create an archive that is larger than will fit on a single unit of
2626 the media, use the `--multi-volume' (`-M') option in conjunction with
2627 the `--create' option (*note create::). A "multi-volume" archive can
2628 be manipulated like any other archive (provided the `--multi-volume'
2629 option is specified), but is stored on more than one tape or file.
2631 When you specify `--multi-volume', `tar' does not report an error
2632 when it comes to the end of an archive volume (when reading), or the
2633 end of the media (when writing). Instead, it prompts you to load a new
2634 storage volume. If the archive is on a magnetic tape, you should
2635 change tapes when you see the prompt; if the archive is on a floppy
2636 disk, you should change disks; etc.
2640 Creates a multi-volume archive, when used in conjunction with
2641 `--create' (`-c'). To perform any other operation on a
2642 multi-volume archive, specify `--multi-volume' in conjunction with
2643 that operation. For example:
2645 $ tar --create --multi-volume --file=/dev/tape FILES
2647 The method `tar' uses to detect end of tape is not perfect, and
2648 fails on some operating systems or on some devices. If `tar' cannot
2649 detect the end of the tape itself, you can use `--tape-length' option
2650 to inform it about the capacity of the tape:
2652 `--tape-length=SIZE[SUF]'
2654 Set maximum length of a volume. The SUF, if given, specifies
2655 units in which SIZE is expressed, e.g. `2M' mean 2 megabytes
2656 (*note Table 9.1: size-suffixes, for a list of allowed size
2657 suffixes). Without SUF, units of 1024 bytes (kilobyte) are
2660 This option selects `--multi-volume' automatically. For example:
2662 $ tar --create --tape-length=41943040 --file=/dev/tape FILES
2664 or, which is equivalent:
2666 $ tar --create --tape-length=4G --file=/dev/tape FILES
2668 When GNU `tar' comes to the end of a storage media, it asks you to
2669 change the volume. The built-in prompt for POSIX locale is(1):
2671 Prepare volume #N for 'ARCHIVE' and hit return:
2673 where N is the ordinal number of the volume to be created and ARCHIVE
2674 is archive file or device name.
2676 When prompting for a new tape, `tar' accepts any of the following
2680 Request `tar' to explain possible responses.
2683 Request `tar' to exit immediately.
2686 Request `tar' to write the next volume on the file FILE-NAME.
2689 Request `tar' to run a subshell. This option can be disabled by
2690 giving `--restrict' command line option to `tar'(2).
2693 Request `tar' to begin writing the next volume.
2695 (You should only type `y' after you have changed the tape; otherwise
2696 `tar' will write over the volume it just finished.)
2698 The volume number used by `tar' in its tape-changing prompt can be
2699 changed; if you give the `--volno-file=FILE-OF-NUMBER' option, then
2700 FILE-OF-NUMBER should be an non-existing file to be created, or else, a
2701 file already containing a decimal number. That number will be used as
2702 the volume number of the first volume written. When `tar' is finished,
2703 it will rewrite the file with the now-current volume number. (This does
2704 not change the volume number written on a tape label, as per *note
2705 label::, it _only_ affects the number used in the prompt.)
2707 If you want more elaborate behavior than this, you can write a
2708 special "new volume script", that will be responsible for changing the
2709 volume, and instruct `tar' to use it instead of its normal prompting
2712 `--info-script=COMMAND'
2713 `--new-volume-script=COMMAND'
2715 Specify the command to invoke when switching volumes. The COMMAND
2716 can be used to eject cassettes, or to broadcast messages such as
2717 `Someone please come change my tape' when performing unattended
2720 The COMMAND can contain additional options, if such are needed.
2721 *Note Running External Commands: external, for a detailed discussion of
2722 the way GNU `tar' runs external commands. It inherits `tar''s shell
2723 environment. Additional data is passed to it via the following
2724 environment variables:
2727 GNU `tar' version number.
2730 The name of the archive `tar' is processing.
2732 `TAR_BLOCKING_FACTOR'
2733 Current blocking factor (*note Blocking::).
2736 Ordinal number of the volume `tar' is about to start.
2739 A short option describing the operation `tar' is executing. *Note
2740 Operations::, for a complete list of subcommand options.
2743 Format of the archive being processed. *Note Formats::, for a
2744 complete list of archive format names.
2747 File descriptor which can be used to communicate the new volume
2750 These variables can be used in the COMMAND itself, provided that
2751 they are properly quoted to prevent them from being expanded by the
2752 shell that invokes `tar'.
2754 The volume script can instruct `tar' to use new archive name, by
2755 writing in to file descriptor `$TAR_FD' (see below for an example).
2757 If the info script fails, `tar' exits; otherwise, it begins writing
2760 If you want `tar' to cycle through a series of files or tape drives,
2761 there are three approaches to choose from. First of all, you can give
2762 `tar' multiple `--file' options. In this case the specified files will
2763 be used, in sequence, as the successive volumes of the archive. Only
2764 when the first one in the sequence needs to be used again will `tar'
2765 prompt for a tape change (or run the info script). For example,
2766 suppose someone has two tape drives on a system named `/dev/tape0' and
2767 `/dev/tape1'. For having GNU `tar' to switch to the second drive when
2768 it needs to write the second tape, and then back to the first tape,
2769 etc., just do either of:
2771 $ tar --create --multi-volume --file=/dev/tape0 --file=/dev/tape1 FILES
2772 $ tar -cM -f /dev/tape0 -f /dev/tape1 FILES
2774 The second method is to use the `n' response to the tape-change
2777 Finally, the most flexible approach is to use a volume script, that
2778 writes new archive name to the file descriptor `$TAR_FD'. For example,
2779 the following volume script will create a series of archive files, named
2780 `ARCHIVE-VOL', where ARCHIVE is the name of the archive being created
2781 (as given by `--file' option) and VOL is the ordinal number of the
2782 archive being created:
2785 # For this script it's advisable to use a shell, such as Bash,
2786 # that supports a TAR_FD value greater than 9.
2788 echo Preparing volume $TAR_VOLUME of $TAR_ARCHIVE.
2790 name=`expr $TAR_ARCHIVE : '\(.*\)-.*'`
2791 case $TAR_SUBCOMMAND in
2793 -d|-x|-t) test -r ${name:-$TAR_ARCHIVE}-$TAR_VOLUME || exit 1
2798 echo ${name:-$TAR_ARCHIVE}-$TAR_VOLUME >&$TAR_FD
2800 The same script can be used while listing, comparing or extracting
2801 from the created archive. For example:
2803 # Create a multi-volume archive:
2804 $ tar -c -L1024 -f archive.tar -F new-volume .
2805 # Extract from the created archive:
2806 $ tar -x -f archive.tar -F new-volume .
2808 Notice, that the first command had to use `-L' option, since otherwise
2809 GNU `tar' will end up writing everything to file `archive.tar'.
2811 You can read each individual volume of a multi-volume archive as if
2812 it were an archive by itself. For example, to list the contents of one
2813 volume, use `--list', without `--multi-volume' specified. To extract
2814 an archive member from one volume (assuming it is described that
2815 volume), use `--extract', again without `--multi-volume'.
2817 If an archive member is split across volumes (i.e., its entry begins
2818 on one volume of the media and ends on another), you need to specify
2819 `--multi-volume' to extract it successfully. In this case, you should
2820 load the volume where the archive member starts, and use `tar --extract
2821 --multi-volume'--`tar' will prompt for later volumes as it needs them.
2822 *Note extracting archives::, for more information about extracting
2825 Multi-volume archives can be modified like any other archive. To add
2826 files to a multi-volume archive, you need to only mount the last volume
2827 of the archive media (and new volumes, if needed). For all other
2828 operations, you need to use the entire archive.
2830 If a multi-volume archive was labeled using `--label=ARCHIVE-LABEL'
2831 (*note label::) when it was created, `tar' will not automatically label
2832 volumes which are added later. To label subsequent volumes, specify
2833 `--label=ARCHIVE-LABEL' again in conjunction with the `--append',
2834 `--update' or `--concatenate' operation.
2836 Notice that multi-volume support is a GNU extension and the archives
2837 created in this mode should be read only using GNU `tar'. If you
2838 absolutely have to process such archives using a third-party `tar'
2839 implementation, read *note Split Recovery::.
2841 ---------- Footnotes ----------
2843 (1) If you run GNU `tar' under a different locale, the translation
2844 to the locale's language will be used.
2846 (2) *Note --restrict::, for more information about this option.
2849 File: tar.info, Node: Tape Files, Next: Tarcat, Prev: Multi-Volume Archives, Up: Using Multiple Tapes
2854 _(This message will disappear, once this node revised.)_
2856 To give the archive a name which will be recorded in it, use the
2857 `--label=VOLUME-LABEL' (`-V VOLUME-LABEL') option. This will write a
2858 special block identifying VOLUME-LABEL as the name of the archive to
2859 the front of the archive which will be displayed when the archive is
2860 listed with `--list'. If you are creating a multi-volume archive with
2861 `--multi-volume' (*note Using Multiple Tapes::), then the volume label
2862 will have `Volume NNN' appended to the name you give, where NNN is the
2863 number of the volume of the archive. If you use the
2864 `--label=VOLUME-LABEL' option when reading an archive, it checks to
2865 make sure the label on the tape matches the one you gave. *Note
2868 When `tar' writes an archive to tape, it creates a single tape file.
2869 If multiple archives are written to the same tape, one after the other,
2870 they each get written as separate tape files. When extracting, it is
2871 necessary to position the tape at the right place before running `tar'.
2872 To do this, use the `mt' command. For more information on the `mt'
2873 command and on the organization of tapes into a sequence of tape files,
2876 People seem to often do:
2878 --label="SOME-PREFIX `date +SOME-FORMAT`"
2880 or such, for pushing a common date in all volumes or an archive set.
2883 File: tar.info, Node: Tarcat, Prev: Tape Files, Up: Using Multiple Tapes
2885 9.6.3 Concatenate Volumes into a Single Archive
2886 -----------------------------------------------
2888 Sometimes it is necessary to convert existing GNU `tar' multi-volume
2889 archive to a single `tar' archive. Simply concatenating all volumes
2890 into one will not work, since each volume carries an additional
2891 information at the beginning. GNU `tar' is shipped with the shell
2892 script `tarcat' designed for this purpose.
2894 The script takes a list of files comprising a multi-volume archive
2895 and creates the resulting archive at the standard output. For example:
2897 tarcat vol.1 vol.2 vol.3 | tar tf -
2899 The script implements a simple heuristics to determine the format of
2900 the first volume file and to decide how to process the rest of the
2901 files. However, it makes no attempt to verify whether the files are
2902 given in order or even if they are valid `tar' archives. It uses `dd'
2903 and does not filter its standard error, so you will usually see lots of
2907 File: tar.info, Node: label, Next: verify, Prev: Using Multiple Tapes, Up: Media
2909 9.7 Including a Label in the Archive
2910 ====================================
2912 To avoid problems caused by misplaced paper labels on the archive
2913 media, you can include a "label" entry -- an archive member which
2914 contains the name of the archive -- in the archive itself. Use the
2915 `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option(1) in conjunction
2916 with the `--create' operation to include a label entry in the archive
2917 as it is being created.
2919 `--label=ARCHIVE-LABEL'
2921 Includes an "archive-label" at the beginning of the archive when
2922 the archive is being created, when used in conjunction with the
2923 `--create' operation. Checks to make sure the archive label
2924 matches the one specified (when used in conjunction with any other
2927 If you create an archive using both `--label=ARCHIVE-LABEL' (`-V
2928 ARCHIVE-LABEL') and `--multi-volume' (`-M'), each volume of the archive
2929 will have an archive label of the form `ARCHIVE-LABEL Volume N', where
2930 N is 1 for the first volume, 2 for the next, and so on. *Note Using
2931 Multiple Tapes::, for information on creating multiple volume archives.
2933 The volume label will be displayed by `--list' along with the file
2934 contents. If verbose display is requested, it will also be explicitly
2935 marked as in the example below:
2937 $ tar --verbose --list --file=iamanarchive
2938 V--------- 0/0 0 1992-03-07 12:01 iamalabel--Volume Header--
2939 -rw-r--r-- ringo/user 40 1990-05-21 13:30 iamafilename
2941 However, `--list' option will cause listing entire contents of the
2942 archive, which may be undesirable (for example, if the archive is
2943 stored on a tape). You can request checking only the volume label by
2944 specifying `--test-label' option. This option reads only the first
2945 block of an archive, so it can be used with slow storage devices. For
2948 $ tar --test-label --file=iamanarchive
2951 If `--test-label' is used with one or more command line arguments,
2952 `tar' compares the volume label with each argument. It exits with code
2953 0 if a match is found, and with code 1 otherwise(2). No output is
2954 displayed, unless you also used the `--verbose' option. For example:
2956 $ tar --test-label --file=iamanarchive 'iamalabel'
2958 $ tar --test-label --file=iamanarchive 'alabel'
2961 When used with the `--verbose' option, `tar' prints the actual
2962 volume label (if any), and a verbose diagnostics in case of a mismatch:
2964 $ tar --test-label --verbose --file=iamanarchive 'iamalabel'
2967 $ tar --test-label --verbose --file=iamanarchive 'alabel'
2969 tar: Archive label mismatch
2972 If you request any operation, other than `--create', along with
2973 using `--label' option, `tar' will first check if the archive label
2974 matches the one specified and will refuse to proceed if it does not.
2975 Use this as a safety precaution to avoid accidentally overwriting
2976 existing archives. For example, if you wish to add files to `archive',
2977 presumably labeled with string `My volume', you will get:
2979 $ tar -rf archive --label 'My volume' .
2980 tar: Archive not labeled to match 'My volume'
2982 in case its label does not match. This will work even if `archive' is
2985 Similarly, `tar' will refuse to list or extract the archive if its
2986 label doesn't match the ARCHIVE-LABEL specified. In those cases,
2987 ARCHIVE-LABEL argument is interpreted as a globbing-style pattern which
2988 must match the actual magnetic volume label. *Note exclude::, for a
2989 precise description of how match is attempted(3). If the switch
2990 `--multi-volume' (`-M') is being used, the volume label matcher will
2991 also suffix ARCHIVE-LABEL by ` Volume [1-9]*' if the initial match
2992 fails, before giving up. Since the volume numbering is automatically
2993 added in labels at creation time, it sounded logical to equally help
2994 the user taking care of it when the archive is being read.
2996 You can also use `--label' to get a common information on all tapes
2997 of a series. For having this information different in each series
2998 created through a single script used on a regular basis, just manage to
2999 get some date string as part of the label. For example:
3001 $ tar -cM -f /dev/tape -V "Daily backup for `date +%Y-%m-%d`"
3002 $ tar --create --file=/dev/tape --multi-volume \
3003 --label="Daily backup for `date +%Y-%m-%d`"
3005 Some more notes about volume labels:
3007 * Each label has its own date and time, which corresponds to the
3008 time when GNU `tar' initially attempted to write it, often soon
3009 after the operator launches `tar' or types the carriage return
3010 telling that the next tape is ready.
3012 * Comparing date labels to get an idea of tape throughput is
3013 unreliable. It gives correct results only if the delays for
3014 rewinding tapes and the operator switching them were negligible,
3015 which is usually not the case.
3017 ---------- Footnotes ----------
3019 (1) Until version 1.10, that option was called `--volume', but is
3020 not available under that name anymore.
3022 (2) Note that GNU `tar' versions up to 1.23 indicated mismatch with
3023 an exit code 2 and printed a spurious diagnostics on stderr.
3025 (3) Previous versions of `tar' used full regular expression
3026 matching, or before that, only exact string matching, instead of
3027 wildcard matchers. We decided for the sake of simplicity to use a
3028 uniform matching device through `tar'.
3031 File: tar.info, Node: verify, Next: Write Protection, Prev: label, Up: Media
3033 9.8 Verifying Data as It is Stored
3034 ==================================
3038 Attempt to verify the archive after writing.
3040 This option causes `tar' to verify the archive after writing it.
3041 Each volume is checked after it is written, and any discrepancies are
3042 recorded on the standard error output.
3044 Verification requires that the archive be on a back-space-able
3045 medium. This means pipes, some cartridge tape drives, and some other
3046 devices cannot be verified.
3048 You can insure the accuracy of an archive by comparing files in the
3049 system with archive members. `tar' can compare an archive to the file
3050 system as the archive is being written, to verify a write operation, or
3051 can compare a previously written archive, to insure that it is up to
3054 To check for discrepancies in an archive immediately after it is
3055 written, use the `--verify' (`-W') option in conjunction with the
3056 `--create' operation. When this option is specified, `tar' checks
3057 archive members against their counterparts in the file system, and
3058 reports discrepancies on the standard error.
3060 To verify an archive, you must be able to read it from before the end
3061 of the last written entry. This option is useful for detecting data
3062 errors on some tapes. Archives written to pipes, some cartridge tape
3063 drives, and some other devices cannot be verified.
3065 One can explicitly compare an already made archive with the file
3066 system by using the `--compare' (`--diff', `-d') option, instead of
3067 using the more automatic `--verify' option. *Note compare::.
3069 Note that these two options have a slightly different intent. The
3070 `--compare' option checks how identical are the logical contents of some
3071 archive with what is on your disks, while the `--verify' option is
3072 really for checking if the physical contents agree and if the recording
3073 media itself is of dependable quality. So, for the `--verify'
3074 operation, `tar' tries to defeat all in-memory cache pertaining to the
3075 archive, while it lets the speed optimization undisturbed for the
3076 `--compare' option. If you nevertheless use `--compare' for media
3077 verification, you may have to defeat the in-memory cache yourself,
3078 maybe by opening and reclosing the door latch of your recording unit,
3079 forcing some doubt in your operating system about the fact this is
3080 really the same volume as the one just written or read.
3082 The `--verify' option would not be necessary if drivers were indeed
3083 able to detect dependably all write failures. This sometimes require
3084 many magnetic heads, some able to read after the writes occurred. One
3085 would not say that drivers unable to detect all cases are necessarily
3086 flawed, as long as programming is concerned.
3088 The `--verify' (`-W') option will not work in conjunction with the
3089 `--multi-volume' (`-M') option or the `--append' (`-r'), `--update'
3090 (`-u') and `--delete' operations. *Note Operations::, for more
3091 information on these operations.
3093 Also, since `tar' normally strips leading `/' from file names (*note
3094 absolute::), a command like `tar --verify -cf /tmp/foo.tar /etc' will
3095 work as desired only if the working directory is `/', as `tar' uses the
3096 archive's relative member names (e.g., `etc/motd') when verifying the
3100 File: tar.info, Node: Write Protection, Prev: verify, Up: Media
3102 9.9 Write Protection
3103 ====================
3105 Almost all tapes and diskettes, and in a few rare cases, even disks can
3106 be "write protected", to protect data on them from being changed. Once
3107 an archive is written, you should write protect the media to prevent
3108 the archive from being accidentally overwritten or deleted. (This will
3109 protect the archive from being changed with a tape or floppy drive--it
3110 will not protect it from magnet fields or other physical hazards.)
3112 The write protection device itself is usually an integral part of the
3113 physical media, and can be a two position (write enabled/write
3114 disabled) switch, a notch which can be popped out or covered, a ring
3115 which can be removed from the center of a tape reel, or some other
3119 File: tar.info, Node: Reliability and security, Next: Changes, Prev: Media, Up: Top
3121 10 Reliability and Security
3122 ***************************
3124 The `tar' command reads and writes files as any other application does,
3125 and is subject to the usual caveats about reliability and security.
3126 This section contains some commonsense advice on the topic.
3134 File: tar.info, Node: Reliability, Next: Security, Up: Reliability and security
3139 Ideally, when `tar' is creating an archive, it reads from a file system
3140 that is not being modified, and encounters no errors or inconsistencies
3141 while reading and writing. If this is the case, the archive should
3142 faithfully reflect what was read. Similarly, when extracting from an
3143 archive, ideally `tar' ideally encounters no errors and the extracted
3144 files faithfully reflect what was in the archive.
3146 However, when reading or writing real-world file systems, several
3147 things can go wrong; these include permissions problems, corruption of
3148 data, and race conditions.
3152 * Permissions problems::
3153 * Data corruption and repair::
3157 File: tar.info, Node: Permissions problems, Next: Data corruption and repair, Up: Reliability
3159 10.1.1 Permissions Problems
3160 ---------------------------
3162 If `tar' encounters errors while reading or writing files, it normally
3163 reports an error and exits with nonzero status. The work it does may
3164 therefore be incomplete. For example, when creating an archive, if
3165 `tar' cannot read a file then it cannot copy the file into the archive.
3168 File: tar.info, Node: Data corruption and repair, Next: Race conditions, Prev: Permissions problems, Up: Reliability
3170 10.1.2 Data Corruption and Repair
3171 ---------------------------------
3173 If an archive becomes corrupted by an I/O error, this may corrupt the
3174 data in an extracted file. Worse, it may corrupt the file's metadata,
3175 which may cause later parts of the archive to become misinterpreted.
3176 An tar-format archive contains a checksum that most likely will detect
3177 errors in the metadata, but it will not detect errors in the data.
3179 If data corruption is a concern, you can compute and check your own
3180 checksums of an archive by using other programs, such as `cksum'.
3182 When attempting to recover from a read error or data corruption in an
3183 archive, you may need to skip past the questionable data and read the
3184 rest of the archive. This requires some expertise in the archive
3185 format and in other software tools.
3188 File: tar.info, Node: Race conditions, Prev: Data corruption and repair, Up: Reliability
3190 10.1.3 Race conditions
3191 ----------------------
3193 If some other process is modifying the file system while `tar' is
3194 reading or writing files, the result may well be inconsistent due to
3195 race conditions. For example, if another process creates some files in
3196 a directory while `tar' is creating an archive containing the
3197 directory's files, `tar' may see some of the files but not others, or
3198 it may see a file that is in the process of being created. The
3199 resulting archive may not be a snapshot of the file system at any point
3200 in time. If an application such as a database system depends on an
3201 accurate snapshot, restoring from the `tar' archive of a live file
3202 system may therefore break that consistency and may break the
3203 application. The simplest way to avoid the consistency issues is to
3204 avoid making other changes to the file system while tar is reading it
3207 When creating an archive, several options are available to avoid race
3208 conditions. Some hosts have a way of snapshotting a file system, or of
3209 temporarily suspending all changes to a file system, by (say)
3210 suspending the only virtual machine that can modify a file system; if
3211 you use these facilities and have `tar -c' read from a snapshot when
3212 creating an archive, you can avoid inconsistency problems. More
3213 drastically, before starting `tar' you could suspend or shut down all
3214 processes other than `tar' that have access to the file system, or you
3215 could unmount the file system and then mount it read-only.
3217 When extracting from an archive, one approach to avoid race
3218 conditions is to create a directory that no other process can write to,
3219 and extract into that.
3222 File: tar.info, Node: Security, Prev: Reliability, Up: Reliability and security
3227 In some cases `tar' may be used in an adversarial situation, where an
3228 untrusted user is attempting to gain information about or modify
3229 otherwise-inaccessible files. Dealing with untrusted data (that is,
3230 data generated by an untrusted user) typically requires extra care,
3231 because even the smallest mistake in the use of `tar' is more likely to
3232 be exploited by an adversary than by a race condition.
3238 * Live untrusted data::
3239 * Security rules of thumb::
3242 File: tar.info, Node: Privacy, Next: Integrity, Up: Security
3247 Standard privacy concerns apply when using `tar'. For example, suppose
3248 you are archiving your home directory into a file
3249 `/archive/myhome.tar'. Any secret information in your home directory,
3250 such as your SSH secret keys, are copied faithfully into the archive.
3251 Therefore, if your home directory contains any file that should not be
3252 read by some other user, the archive itself should be not be readable
3253 by that user. And even if the archive's data are inaccessible to
3254 untrusted users, its metadata (such as size or last-modified date) may
3255 reveal some information about your home directory; if the metadata are
3256 intended to be private, the archive's parent directory should also be
3257 inaccessible to untrusted users.
3259 One precaution is to create `/archive' so that it is not accessible
3260 to any user, unless that user also has permission to access all the
3261 files in your home directory.
3263 Similarly, when extracting from an archive, take care that the
3264 permissions of the extracted files are not more generous than what you
3265 want. Even if the archive itself is readable only to you, files
3266 extracted from it have their own permissions that may differ.
3269 File: tar.info, Node: Integrity, Next: Live untrusted data, Prev: Privacy, Up: Security
3274 When creating archives, take care that they are not writable by a
3275 untrusted user; otherwise, that user could modify the archive, and when
3276 you later extract from the archive you will get incorrect data.
3278 When `tar' extracts from an archive, by default it writes into files
3279 relative to the working directory. If the archive was generated by an
3280 untrusted user, that user therefore can write into any file under the
3281 working directory. If the working directory contains a symbolic link
3282 to another directory, the untrusted user can also write into any file
3283 under the referenced directory. When extracting from an untrusted
3284 archive, it is therefore good practice to create an empty directory and
3285 run `tar' in that directory.
3287 When extracting from two or more untrusted archives, each one should
3288 be extracted independently, into different empty directories.
3289 Otherwise, the first archive could create a symbolic link into an area
3290 outside the working directory, and the second one could follow the link
3291 and overwrite data that is not under the working directory. For
3292 example, when restoring from a series of incremental dumps, the
3293 archives should have been created by a trusted process, as otherwise
3294 the incremental restores might alter data outside the working directory.
3296 If you use the `--absolute-names' (`-P') option when extracting,
3297 `tar' respects any file names in the archive, even file names that
3298 begin with `/' or contain `..'. As this lets the archive overwrite any
3299 file in your system that you can write, the `--absolute-names' (`-P')
3300 option should be used only for trusted archives.
3302 Conversely, with the `--keep-old-files' (`-k') and
3303 `--skip-old-files' options, `tar' refuses to replace existing files
3304 when extracting. The difference between the two options is that the
3305 former treats existing files as errors whereas the latter just silently
3308 Finally, with the `--no-overwrite-dir' option, `tar' refuses to
3309 replace the permissions or ownership of already-existing directories.
3310 These options may help when extracting from untrusted archives.
3313 File: tar.info, Node: Live untrusted data, Next: Security rules of thumb, Prev: Integrity, Up: Security
3315 10.2.3 Dealing with Live Untrusted Data
3316 ---------------------------------------
3318 Extra care is required when creating from or extracting into a file
3319 system that is accessible to untrusted users. For example, superusers
3320 who invoke `tar' must be wary about its actions being hijacked by an
3321 adversary who is reading or writing the file system at the same time
3322 that `tar' is operating.
3324 When creating an archive from a live file system, `tar' is
3325 vulnerable to denial-of-service attacks. For example, an adversarial
3326 user could create the illusion of an indefinitely-deep directory
3327 hierarchy `d/e/f/g/...' by creating directories one step ahead of
3328 `tar', or the illusion of an indefinitely-long file by creating a
3329 sparse file but arranging for blocks to be allocated just before `tar'
3330 reads them. There is no easy way for `tar' to distinguish these
3331 scenarios from legitimate uses, so you may need to monitor `tar', just
3332 as you'd need to monitor any other system service, to detect such
3335 While a superuser is extracting from an archive into a live file
3336 system, an untrusted user might replace a directory with a symbolic
3337 link, in hopes that `tar' will follow the symbolic link and extract
3338 data into files that the untrusted user does not have access to. Even
3339 if the archive was generated by the superuser, it may contain a file
3340 such as `d/etc/passwd' that the untrusted user earlier created in order
3341 to break in; if the untrusted user replaces the directory `d/etc' with
3342 a symbolic link to `/etc' while `tar' is running, `tar' will overwrite
3343 `/etc/passwd'. This attack can be prevented by extracting into a
3344 directory that is inaccessible to untrusted users.
3346 Similar attacks via symbolic links are also possible when creating an
3347 archive, if the untrusted user can modify an ancestor of a top-level
3348 argument of `tar'. For example, an untrusted user that can modify
3349 `/home/eve' can hijack a running instance of `tar -cf -
3350 /home/eve/Documents/yesterday' by replacing `/home/eve/Documents' with
3351 a symbolic link to some other location. Attacks like these can be
3352 prevented by making sure that untrusted users cannot modify any files
3353 that are top-level arguments to `tar', or any ancestor directories of
3357 File: tar.info, Node: Security rules of thumb, Prev: Live untrusted data, Up: Security
3359 10.2.4 Security Rules of Thumb
3360 ------------------------------
3362 This section briefly summarizes rules of thumb for avoiding security
3365 * Protect archives at least as much as you protect any of the files
3368 * Extract from an untrusted archive only into an otherwise-empty
3369 directory. This directory and its parent should be accessible
3370 only to trusted users. For example:
3373 $ mkdir -m go-rwx dir
3375 $ tar -xvf /archives/got-it-off-the-net.tar.gz
3377 As a corollary, do not do an incremental restore from an untrusted
3380 * Do not let untrusted users access files extracted from untrusted
3381 archives without checking first for problems such as setuid
3384 * Do not let untrusted users modify directories that are ancestors of
3385 top-level arguments of `tar'. For example, while you are
3386 executing `tar -cf /archive/u-home.tar /u/home', do not let an
3387 untrusted user modify `/', `/archive', or `/u'.
3389 * Pay attention to the diagnostics and exit status of `tar'.
3391 * When archiving live file systems, monitor running instances of
3392 `tar' to detect denial-of-service attacks.
3394 * Avoid unusual options such as `--absolute-names' (`-P'),
3395 `--dereference' (`-h'), `--overwrite', `--recursive-unlink', and
3396 `--remove-files' unless you understand their security implications.
3400 File: tar.info, Node: Changes, Next: Configuring Help Summary, Prev: Reliability and security, Up: Top
3405 This appendix lists some important user-visible changes between version
3406 GNU `tar' 1.28 and previous versions. An up-to-date version of this
3407 document is available at the GNU `tar' documentation page
3408 (http://www.gnu.org/software/tar/manual/changes.html).
3410 Use of globbing patterns when listing and extracting.
3411 Previous versions of GNU tar assumed shell-style globbing when
3412 extracting from or listing an archive. For example:
3414 $ tar xf foo.tar '*.c'
3416 would extract all files whose names end in `.c'. This behavior
3417 was not documented and was incompatible with traditional tar
3418 implementations. Therefore, starting from version 1.15.91, GNU tar
3419 no longer uses globbing by default. For example, the above
3420 invocation is now interpreted as a request to extract from the
3421 archive the file named `*.c'.
3423 To facilitate transition to the new behavior for those users who
3424 got used to the previous incorrect one, `tar' will print a warning
3425 if it finds out that a requested member was not found in the
3426 archive and its name looks like a globbing pattern. For example:
3428 $ tar xf foo.tar '*.c'
3429 tar: Pattern matching characters used in file names. Please,
3430 tar: use --wildcards to enable pattern matching, or --no-wildcards to
3431 tar: suppress this warning.
3432 tar: *.c: Not found in archive
3433 tar: Error exit delayed from previous errors
3435 To treat member names as globbing patterns, use the `--wildcards'
3436 option. If you want to tar to mimic the behavior of versions
3437 prior to 1.15.91, add this option to your `TAR_OPTIONS' variable.
3439 *Note wildcards::, for the detailed discussion of the use of
3440 globbing patterns by GNU `tar'.
3442 Use of short option `-o'.
3443 Earlier versions of GNU `tar' understood `-o' command line option
3444 as a synonym for `--old-archive'.
3446 GNU `tar' starting from version 1.13.90 understands this option as
3447 a synonym for `--no-same-owner'. This is compatible with UNIX98
3448 `tar' implementations.
3450 However, to facilitate transition, `-o' option retains its old
3451 semantics when it is used with one of archive-creation commands.
3452 Users are encouraged to use `--format=oldgnu' instead.
3454 It is especially important, since versions of GNU Automake up to
3455 and including 1.8.4 invoke tar with this option to produce
3456 distribution tarballs. *Note v7: Formats, for the detailed
3457 discussion of this issue and its implications.
3459 *Note tar-formats: (automake)Options, for a description on how to
3460 use various archive formats with `automake'.
3462 Future versions of GNU `tar' will understand `-o' only as a
3463 synonym for `--no-same-owner'.
3465 Use of short option `-l'
3466 Earlier versions of GNU `tar' understood `-l' option as a synonym
3467 for `--one-file-system'. Since such usage contradicted to UNIX98
3468 specification and harmed compatibility with other implementations,
3469 it was declared deprecated in version 1.14. However, to
3470 facilitate transition to its new semantics, it was supported by
3471 versions 1.15 and 1.15.90. The present use of `-l' as a short
3472 variant of `--check-links' was introduced in version 1.15.91.
3474 Use of options `--portability' and `--old-archive'
3475 These options are deprecated. Please use `--format=v7' instead.
3477 Use of option `--posix'
3478 This option is deprecated. Please use `--format=posix' instead.
3481 File: tar.info, Node: Configuring Help Summary, Next: Fixing Snapshot Files, Prev: Changes, Up: Top
3483 Appendix B Configuring Help Summary
3484 ***********************************
3486 Running `tar --help' displays the short `tar' option summary (*note
3487 help::). This summary is organized by "groups" of semantically close
3488 options. The options within each group are printed in the following
3489 order: a short option, eventually followed by a list of corresponding
3490 long option names, followed by a short description of the option. For
3491 example, here is an excerpt from the actual `tar --help' output:
3493 Main operation mode:
3495 -A, --catenate, --concatenate append tar files to an archive
3496 -c, --create create a new archive
3497 -d, --diff, --compare find differences between archive and
3499 --delete delete from the archive
3501 The exact visual representation of the help output is configurable
3502 via `ARGP_HELP_FMT' environment variable. The value of this variable is
3503 a comma-separated list of "format variable" assignments. There are two
3504 kinds of format variables. An "offset variable" keeps the offset of
3505 some part of help output text from the leftmost column on the screen. A
3506 "boolean" variable is a flag that toggles some output feature on or
3507 off. Depending on the type of the corresponding variable, there are two
3508 kinds of assignments:
3511 The assignment to an offset variable has the following syntax:
3515 where VARIABLE is the variable name, and VALUE is a numeric value
3516 to be assigned to the variable.
3519 To assign `true' value to a variable, simply put this variable
3520 name. To assign `false' value, prefix the variable name with
3523 # Assign `true' value:
3525 # Assign `false' value:
3528 Following variables are declared:
3530 -- Help Output: boolean dup-args
3531 If true, arguments for an option are shown with both short and long
3532 options, even when a given option has both forms, for example:
3534 -f ARCHIVE, --file=ARCHIVE use archive file or device ARCHIVE
3536 If false, then if an option has both short and long forms, the
3537 argument is only shown with the long one, for example:
3539 -f, --file=ARCHIVE use archive file or device ARCHIVE
3541 and a message indicating that the argument is applicable to both
3542 forms is printed below the options. This message can be disabled
3543 using `dup-args-note' (see below).
3545 The default is false.
3547 -- Help Output: boolean dup-args-note
3548 If this variable is true, which is the default, the following
3549 notice is displayed at the end of the help output:
3551 Mandatory or optional arguments to long options are also
3552 mandatory or optional for any corresponding short options.
3554 Setting `no-dup-args-note' inhibits this message. Normally, only
3555 one of variables `dup-args' or `dup-args-note' should be set.
3557 -- Help Output: offset short-opt-col
3558 Column in which short options start. Default is 2.
3560 $ tar --help|grep ARCHIVE
3561 -f, --file=ARCHIVE use archive file or device ARCHIVE
3562 $ ARGP_HELP_FMT=short-opt-col=6 tar --help|grep ARCHIVE
3563 -f, --file=ARCHIVE use archive file or device ARCHIVE
3565 -- Help Output: offset long-opt-col
3566 Column in which long options start. Default is 6. For example:
3568 $ tar --help|grep ARCHIVE
3569 -f, --file=ARCHIVE use archive file or device ARCHIVE
3570 $ ARGP_HELP_FMT=long-opt-col=16 tar --help|grep ARCHIVE
3571 -f, --file=ARCHIVE use archive file or device ARCHIVE
3573 -- Help Output: offset doc-opt-col
3574 Column in which "doc options" start. A doc option isn't actually
3575 an option, but rather an arbitrary piece of documentation that is
3576 displayed in much the same manner as the options. For example, in
3577 the description of `--format' option:
3579 -H, --format=FORMAT create archive of the given format.
3581 FORMAT is one of the following:
3583 gnu GNU tar 1.13.x format
3584 oldgnu GNU format as per tar <= 1.12
3585 pax POSIX 1003.1-2001 (pax) format
3587 ustar POSIX 1003.1-1988 (ustar) format
3588 v7 old V7 tar format
3590 the format names are doc options. Thus, if you set
3591 `ARGP_HELP_FMT=doc-opt-col=6' the above part of the help output
3592 will look as follows:
3594 -H, --format=FORMAT create archive of the given format.
3596 FORMAT is one of the following:
3598 gnu GNU tar 1.13.x format
3599 oldgnu GNU format as per tar <= 1.12
3600 pax POSIX 1003.1-2001 (pax) format
3602 ustar POSIX 1003.1-1988 (ustar) format
3603 v7 old V7 tar format
3605 -- Help Output: offset opt-doc-col
3606 Column in which option description starts. Default is 29.
3608 $ tar --help|grep ARCHIVE
3609 -f, --file=ARCHIVE use archive file or device ARCHIVE
3610 $ ARGP_HELP_FMT=opt-doc-col=19 tar --help|grep ARCHIVE
3611 -f, --file=ARCHIVE use archive file or device ARCHIVE
3612 $ ARGP_HELP_FMT=opt-doc-col=9 tar --help|grep ARCHIVE
3614 use archive file or device ARCHIVE
3616 Notice, that the description starts on a separate line if
3617 `opt-doc-col' value is too small.
3619 -- Help Output: offset header-col
3620 Column in which "group headers" are printed. A group header is a
3621 descriptive text preceding an option group. For example, in the
3624 Main operation mode:
3626 -A, --catenate, --concatenate append tar files to
3628 -c, --create create a new archive
3629 `Main operation mode:' is the group header.
3631 The default value is 1.
3633 -- Help Output: offset usage-indent
3634 Indentation of wrapped usage lines. Affects `--usage' output.
3637 -- Help Output: offset rmargin
3638 Right margin of the text output. Used for wrapping.
3641 File: tar.info, Node: Fixing Snapshot Files, Next: Tar Internals, Prev: Configuring Help Summary, Up: Top
3643 Appendix C Fixing Snapshot Files
3644 ********************************
3646 Various situations can cause device numbers to change: upgrading your
3647 kernel version, reconfiguring your hardware, loading kernel modules in a
3648 different order, using virtual volumes that are assembled dynamically
3649 (such as with LVM or RAID), hot-plugging drives (e.g. external USB or
3650 Firewire drives), etc. In the majority of cases this change is
3651 unnoticed by the users. However, it influences `tar' incremental
3652 backups: the device number is stored in tar snapshot files (*note
3653 Snapshot Files::) and is used to determine whether the file has changed
3654 since the last backup. If the device numbers change for some reason,
3655 by default the next backup you run will be a full backup.
3657 To minimize the impact in these cases, GNU `tar' comes with the
3658 `tar-snapshot-edit' utility for inspecting and updating device numbers
3659 in snapshot files. (The utility, written by Dustin J. Mitchell, is
3660 also available from the GNU `tar' home page
3661 (http://www.gnu.org/software/tar/utils/tar-snapshot-edit.html).)
3663 To obtain a summary of the device numbers found in the snapshot
3666 $ tar-snapshot-edit SNAPFILE
3668 where SNAPFILE is the name of the snapshot file (you can supply as many
3669 files as you wish in a single command line). You can then compare the
3670 numbers across snapshot files, or against those currently in use on the
3671 live filesystem (using `ls -l' or `stat').
3673 Assuming the device numbers have indeed changed, it's often possible
3674 to simply tell GNU `tar' to ignore the device number when processing the
3675 incremental snapshot files for these backups, using the
3676 `--no-check-device' option (*note device numbers::).
3678 Alternatively, you can use the `tar-edit-snapshot' script's `-r'
3679 option to update all occurrences of the given device number in the
3680 snapshot file(s). It takes a single argument of the form
3681 `OLDDEV-NEWDEV', where OLDDEV is the device number used in the
3682 snapshot file, and NEWDEV is the corresponding new device number. Both
3683 numbers may be specified in hex (e.g., `0xfe01'), decimal (e.g.,
3684 `65025'), or as a major:minor number pair (e.g., `254:1'). To change
3685 several device numbers at once, specify them in a single
3686 comma-separated list, as in `-r 0x3060-0x4500,0x307-0x4600'.
3688 Before updating the snapshot file, it is a good idea to create a
3689 backup copy of it. This is accomplished by `-b' option. The name of
3690 the backup file is obtained by appending `~' to the original file name.
3693 $ tar-snapshot-edit root_snap.0 boot_snap.0
3695 Detected snapshot file version: 2
3697 Device 0x0000 occurs 1 times.
3698 Device 0x0003 occurs 1 times.
3699 Device 0x0005 occurs 1 times.
3700 Device 0x0013 occurs 1 times.
3701 Device 0x6801 occurs 1 times.
3702 Device 0x6803 occurs 6626 times.
3703 Device 0xfb00 occurs 1 times.
3706 Detected snapshot file version: 2
3708 Device 0x6801 occurs 3 times.
3709 $ tar-snapshot-edit -b -r 0x6801-0x6901,0x6803-0x6903 root_snap.0 boot_snap.0
3711 Detected snapshot file version: 2
3713 Updated 6627 records.
3716 Detected snapshot file version: 2
3721 File: tar.info, Node: Tar Internals, Next: Genfile, Prev: Fixing Snapshot Files, Up: Top
3723 Appendix D Tar Internals
3724 ************************
3728 * Standard:: Basic Tar Format
3729 * Extensions:: GNU Extensions to the Archive Format
3730 * Sparse Formats:: Storing Sparse Files
3735 File: tar.info, Node: Standard, Next: Extensions, Up: Tar Internals
3740 _(This message will disappear, once this node revised.)_
3742 While an archive may contain many files, the archive itself is a single
3743 ordinary file. Like any other file, an archive file can be written to
3744 a storage device such as a tape or disk, sent through a pipe or over a
3745 network, saved on the active file system, or even stored in another
3746 archive. An archive file is not easy to read or manipulate without
3747 using the `tar' utility or Tar mode in GNU Emacs.
3749 Physically, an archive consists of a series of file entries
3750 terminated by an end-of-archive entry, which consists of two 512 blocks
3751 of zero bytes. A file entry usually describes one of the files in the
3752 archive (an "archive member"), and consists of a file header and the
3753 contents of the file. File headers contain file names and statistics,
3754 checksum information which `tar' uses to detect file corruption, and
3755 information about file types.
3757 Archives are permitted to have more than one member with the same
3758 member name. One way this situation can occur is if more than one
3759 version of a file has been stored in the archive. For information
3760 about adding new versions of a file to an archive, see *note update::.
3762 In addition to entries describing archive members, an archive may
3763 contain entries which `tar' itself uses to store information. *Note
3764 label::, for an example of such an archive entry.
3766 A `tar' archive file contains a series of blocks. Each block
3767 contains `BLOCKSIZE' bytes. Although this format may be thought of as
3768 being on magnetic tape, other media are often used.
3770 Each file archived is represented by a header block which describes
3771 the file, followed by zero or more blocks which give the contents of
3772 the file. At the end of the archive file there are two 512-byte blocks
3773 filled with binary zeros as an end-of-file marker. A reasonable system
3774 should write such end-of-file marker at the end of an archive, but must
3775 not assume that such a block exists when reading an archive. In
3776 particular GNU `tar' always issues a warning if it does not encounter
3779 The blocks may be "blocked" for physical I/O operations. Each
3780 record of N blocks (where N is set by the `--blocking-factor=512-SIZE'
3781 (`-b 512-SIZE') option to `tar') is written with a single `write ()'
3782 operation. On magnetic tapes, the result of such a write is a single
3783 record. When writing an archive, the last record of blocks should be
3784 written at the full size, with blocks after the zero block containing
3785 all zeros. When reading an archive, a reasonable system should
3786 properly handle an archive whose last record is shorter than the rest,
3787 or which contains garbage records after a zero block.
3789 The header block is defined in C as follows. In the GNU `tar'
3790 distribution, this is part of file `src/tar.h':
3793 /* tar Header Block, from POSIX 1003.1-1990. */
3799 char name[100]; /* 0 */
3800 char mode[8]; /* 100 */
3801 char uid[8]; /* 108 */
3802 char gid[8]; /* 116 */
3803 char size[12]; /* 124 */
3804 char mtime[12]; /* 136 */
3805 char chksum[8]; /* 148 */
3806 char typeflag; /* 156 */
3807 char linkname[100]; /* 157 */
3808 char magic[6]; /* 257 */
3809 char version[2]; /* 263 */
3810 char uname[32]; /* 265 */
3811 char gname[32]; /* 297 */
3812 char devmajor[8]; /* 329 */
3813 char devminor[8]; /* 337 */
3814 char prefix[155]; /* 345 */
3818 #define TMAGIC "ustar" /* ustar and a null */
3820 #define TVERSION "00" /* 00 and no null */
3823 /* Values used in typeflag field. */
3824 #define REGTYPE '0' /* regular file */
3825 #define AREGTYPE '\0' /* regular file */
3826 #define LNKTYPE '1' /* link */
3827 #define SYMTYPE '2' /* reserved */
3828 #define CHRTYPE '3' /* character special */
3829 #define BLKTYPE '4' /* block special */
3830 #define DIRTYPE '5' /* directory */
3831 #define FIFOTYPE '6' /* FIFO special */
3832 #define CONTTYPE '7' /* reserved */
3834 #define XHDTYPE 'x' /* Extended header referring to the
3835 next file in the archive */
3836 #define XGLTYPE 'g' /* Global extended header */
3838 /* Bits used in the mode field, values in octal. */
3839 #define TSUID 04000 /* set UID on execution */
3840 #define TSGID 02000 /* set GID on execution */
3841 #define TSVTX 01000 /* reserved */
3842 /* file permissions */
3843 #define TUREAD 00400 /* read by owner */
3844 #define TUWRITE 00200 /* write by owner */
3845 #define TUEXEC 00100 /* execute/search by owner */
3846 #define TGREAD 00040 /* read by group */
3847 #define TGWRITE 00020 /* write by group */
3848 #define TGEXEC 00010 /* execute/search by group */
3849 #define TOREAD 00004 /* read by other */
3850 #define TOWRITE 00002 /* write by other */
3851 #define TOEXEC 00001 /* execute/search by other */
3853 /* tar Header Block, GNU extensions. */
3855 /* In GNU tar, SYMTYPE is for to symbolic links, and CONTTYPE is for
3856 contiguous files, so maybe disobeying the "reserved" comment in POSIX
3857 header description. I suspect these were meant to be used this way, and
3858 should not have really been "reserved" in the published standards. */
3860 /* *BEWARE* *BEWARE* *BEWARE* that the following information is still
3861 boiling, and may change. Even if the OLDGNU format description should be
3862 accurate, the so-called GNU format is not yet fully decided. It is
3863 surely meant to use only extensions allowed by POSIX, but the sketch
3864 below repeats some ugliness from the OLDGNU format, which should rather
3865 go away. Sparse files should be saved in such a way that they do *not*
3866 require two passes at archive creation time. Huge files get some POSIX
3867 fields to overflow, alternate solutions have to be sought for this. */
3869 /* Descriptor for a single file hole. */
3873 char offset[12]; /* 0 */
3874 char numbytes[12]; /* 12 */
3878 /* Sparse files are not supported in POSIX ustar format. For sparse files
3879 with a POSIX header, a GNU extra header is provided which holds overall
3880 sparse information and a few sparse descriptors. When an old GNU header
3881 replaces both the POSIX header and the GNU extra header, it holds some
3882 sparse descriptors too. Whether POSIX or not, if more sparse descriptors
3883 are still needed, they are put into as many successive sparse headers as
3884 necessary. The following constants tell how many sparse descriptors fit
3885 in each kind of header able to hold them. */
3887 #define SPARSES_IN_EXTRA_HEADER 16
3888 #define SPARSES_IN_OLDGNU_HEADER 4
3889 #define SPARSES_IN_SPARSE_HEADER 21
3891 /* Extension header for sparse files, used immediately after the GNU extra
3892 header, and used only if all sparse information cannot fit into that
3893 extra header. There might even be many such extension headers, one after
3894 the other, until all sparse information has been recorded. */
3896 struct sparse_header
3898 struct sparse sp[SPARSES_IN_SPARSE_HEADER];
3900 char isextended; /* 504 */
3904 /* The old GNU format header conflicts with POSIX format in such a way that
3905 POSIX archives may fool old GNU tar's, and POSIX tar's might well be
3906 fooled by old GNU tar archives. An old GNU format header uses the space
3907 used by the prefix field in a POSIX header, and cumulates information
3908 normally found in a GNU extra header. With an old GNU tar header, we
3909 never see any POSIX header nor GNU extra header. Supplementary sparse
3910 headers are allowed, however. */
3912 struct oldgnu_header
3914 char unused_pad1[345]; /* 0 */
3915 char atime[12]; /* 345 Incr. archive: atime of the file */
3916 char ctime[12]; /* 357 Incr. archive: ctime of the file */
3917 char offset[12]; /* 369 Multivolume archive: the offset of
3918 the start of this volume */
3919 char longnames[4]; /* 381 Not used */
3920 char unused_pad2; /* 385 */
3921 struct sparse sp[SPARSES_IN_OLDGNU_HEADER];
3923 char isextended; /* 482 Sparse file: Extension sparse header
3925 char realsize[12]; /* 483 Sparse file: Real size*/
3929 /* OLDGNU_MAGIC uses both magic and version fields, which are contiguous.
3930 Found in an archive, it indicates an old GNU header format, which will be
3931 hopefully become obsolescent. With OLDGNU_MAGIC, uname and gname are
3932 valid, though the header is not truly POSIX conforming. */
3933 #define OLDGNU_MAGIC "ustar " /* 7 chars and a null */
3935 /* The standards committee allows only capital A through capital Z for
3936 user-defined expansion. Other letters in use include:
3938 'A' Solaris Access Control List
3939 'E' Solaris Extended Attribute File
3940 'I' Inode only, as in 'star'
3941 'N' Obsolete GNU tar, for file names that do not fit into the main header.
3942 'X' POSIX 1003.1-2001 eXtended (VU version) */
3944 /* This is a dir entry that contains the names of files that were in the
3945 dir at the time the dump was made. */
3946 #define GNUTYPE_DUMPDIR 'D'
3948 /* Identifies the *next* file on the tape as having a long linkname. */
3949 #define GNUTYPE_LONGLINK 'K'
3951 /* Identifies the *next* file on the tape as having a long name. */
3952 #define GNUTYPE_LONGNAME 'L'
3954 /* This is the continuation of a file that began on another volume. */
3955 #define GNUTYPE_MULTIVOL 'M'
3957 /* This is for sparse files. */
3958 #define GNUTYPE_SPARSE 'S'
3960 /* This file is a tape/volume header. Ignore it on extraction. */
3961 #define GNUTYPE_VOLHDR 'V'
3963 /* Solaris extended header */
3964 #define SOLARIS_XHDTYPE 'X'
3966 /* Jo"rg Schilling star header */
3970 char name[100]; /* 0 */
3971 char mode[8]; /* 100 */
3972 char uid[8]; /* 108 */
3973 char gid[8]; /* 116 */
3974 char size[12]; /* 124 */
3975 char mtime[12]; /* 136 */
3976 char chksum[8]; /* 148 */
3977 char typeflag; /* 156 */
3978 char linkname[100]; /* 157 */
3979 char magic[6]; /* 257 */
3980 char version[2]; /* 263 */
3981 char uname[32]; /* 265 */
3982 char gname[32]; /* 297 */
3983 char devmajor[8]; /* 329 */
3984 char devminor[8]; /* 337 */
3985 char prefix[131]; /* 345 */
3986 char atime[12]; /* 476 */
3987 char ctime[12]; /* 488 */
3991 #define SPARSES_IN_STAR_HEADER 4
3992 #define SPARSES_IN_STAR_EXT_HEADER 21
3994 struct star_in_header
3996 char fill[345]; /* 0 Everything that is before t_prefix */
3997 char prefix[1]; /* 345 t_name prefix */
3998 char fill2; /* 346 */
3999 char fill3[8]; /* 347 */
4000 char isextended; /* 355 */
4001 struct sparse sp[SPARSES_IN_STAR_HEADER]; /* 356 */
4002 char realsize[12]; /* 452 Actual size of the file */
4003 char offset[12]; /* 464 Offset of multivolume contents */
4004 char atime[12]; /* 476 */
4005 char ctime[12]; /* 488 */
4006 char mfill[8]; /* 500 */
4007 char xmagic[4]; /* 508 "tar" */
4010 struct star_ext_header
4012 struct sparse sp[SPARSES_IN_STAR_EXT_HEADER];
4016 All characters in header blocks are represented by using 8-bit
4017 characters in the local variant of ASCII. Each field within the
4018 structure is contiguous; that is, there is no padding used within the
4019 structure. Each character on the archive medium is stored contiguously.
4021 Bytes representing the contents of files (after the header block of
4022 each file) are not translated in any way and are not constrained to
4023 represent characters in any character set. The `tar' format does not
4024 distinguish text files from binary files, and no translation of file
4025 contents is performed.
4027 The `name', `linkname', `magic', `uname', and `gname' are
4028 null-terminated character strings. All other fields are zero-filled
4029 octal numbers in ASCII. Each numeric field of width W contains W minus
4030 1 digits, and a null.
4032 The `name' field is the file name of the file, with directory names
4033 (if any) preceding the file name, separated by slashes.
4035 The `mode' field provides nine bits specifying file permissions and
4036 three bits to specify the Set UID, Set GID, and Save Text ("sticky")
4037 modes. Values for these bits are defined above. When special
4038 permissions are required to create a file with a given mode, and the
4039 user restoring files from the archive does not hold such permissions,
4040 the mode bit(s) specifying those special permissions are ignored.
4041 Modes which are not supported by the operating system restoring files
4042 from the archive will be ignored. Unsupported modes should be faked up
4043 when creating or updating an archive; e.g., the group permission could
4044 be copied from the _other_ permission.
4046 The `uid' and `gid' fields are the numeric user and group ID of the
4047 file owners, respectively. If the operating system does not support
4048 numeric user or group IDs, these fields should be ignored.
4050 The `size' field is the size of the file in bytes; linked files are
4051 archived with this field specified as zero.
4053 The `mtime' field is the data modification time of the file at the
4054 time it was archived. It is the ASCII representation of the octal
4055 value of the last time the file's contents were modified, represented
4056 as an integer number of seconds since January 1, 1970, 00:00
4057 Coordinated Universal Time.
4059 The `chksum' field is the ASCII representation of the octal value of
4060 the simple sum of all bytes in the header block. Each 8-bit byte in
4061 the header is added to an unsigned integer, initialized to zero, the
4062 precision of which shall be no less than seventeen bits. When
4063 calculating the checksum, the `chksum' field is treated as if it were
4066 The `typeflag' field specifies the type of file archived. If a
4067 particular implementation does not recognize or permit the specified
4068 type, the file will be extracted as if it were a regular file. As this
4069 action occurs, `tar' issues a warning to the standard error.
4071 The `atime' and `ctime' fields are used in making incremental
4072 backups; they store, respectively, the particular file's access and
4073 status change times.
4075 The `offset' is used by the `--multi-volume' (`-M') option, when
4076 making a multi-volume archive. The offset is number of bytes into the
4077 file that we need to restart at to continue the file on the next tape,
4078 i.e., where we store the location that a continued file is continued at.
4080 The following fields were added to deal with sparse files. A file
4081 is "sparse" if it takes in unallocated blocks which end up being
4082 represented as zeros, i.e., no useful data. A test to see if a file is
4083 sparse is to look at the number blocks allocated for it versus the
4084 number of characters in the file; if there are fewer blocks allocated
4085 for the file than would normally be allocated for a file of that size,
4086 then the file is sparse. This is the method `tar' uses to detect a
4087 sparse file, and once such a file is detected, it is treated
4088 differently from non-sparse files.
4090 Sparse files are often `dbm' files, or other database-type files
4091 which have data at some points and emptiness in the greater part of the
4092 file. Such files can appear to be very large when an `ls -l' is done
4093 on them, when in truth, there may be a very small amount of important
4094 data contained in the file. It is thus undesirable to have `tar' think
4095 that it must back up this entire file, as great quantities of room are
4096 wasted on empty blocks, which can lead to running out of room on a tape
4097 far earlier than is necessary. Thus, sparse files are dealt with so
4098 that these empty blocks are not written to the tape. Instead, what is
4099 written to the tape is a description, of sorts, of the sparse file:
4100 where the holes are, how big the holes are, and how much data is found
4101 at the end of the hole. This way, the file takes up potentially far
4102 less room on the tape, and when the file is extracted later on, it will
4103 look exactly the way it looked beforehand. The following is a
4104 description of the fields used to handle a sparse file:
4106 The `sp' is an array of `struct sparse'. Each `struct sparse'
4107 contains two 12-character strings which represent an offset into the
4108 file and a number of bytes to be written at that offset. The offset is
4109 absolute, and not relative to the offset in preceding array element.
4111 The header can hold four of these `struct sparse' at the moment; if
4112 more are needed, they are not stored in the header.
4114 The `isextended' flag is set when an `extended_header' is needed to
4115 deal with a file. Note that this means that this flag can only be set
4116 when dealing with a sparse file, and it is only set in the event that
4117 the description of the file will not fit in the allotted room for
4118 sparse structures in the header. In other words, an extended_header is
4121 The `extended_header' structure is used for sparse files which need
4122 more sparse structures than can fit in the header. The header can fit
4123 4 such structures; if more are needed, the flag `isextended' gets set
4124 and the next block is an `extended_header'.
4126 Each `extended_header' structure contains an array of 21 sparse
4127 structures, along with a similar `isextended' flag that the header had.
4128 There can be an indeterminate number of such `extended_header's to
4129 describe a sparse file.
4133 These flags represent a regular file. In order to be compatible
4134 with older versions of `tar', a `typeflag' value of `AREGTYPE'
4135 should be silently recognized as a regular file. New archives
4136 should be created using `REGTYPE'. Also, for backward
4137 compatibility, `tar' treats a regular file whose name ends with a
4138 slash as a directory.
4141 This flag represents a file linked to another file, of any type,
4142 previously archived. Such files are identified in Unix by each
4143 file having the same device and inode number. The linked-to name
4144 is specified in the `linkname' field with a trailing null.
4147 This represents a symbolic link to another file. The linked-to
4148 name is specified in the `linkname' field with a trailing null.
4152 These represent character special files and block special files
4153 respectively. In this case the `devmajor' and `devminor' fields
4154 will contain the major and minor device numbers respectively.
4155 Operating systems may map the device specifications to their own
4156 local specification, or may ignore the entry.
4159 This flag specifies a directory or sub-directory. The directory
4160 name in the `name' field should end with a slash. On systems where
4161 disk allocation is performed on a directory basis, the `size' field
4162 will contain the maximum number of bytes (which may be rounded to
4163 the nearest disk block allocation unit) which the directory may
4164 hold. A `size' field of zero indicates no such limiting. Systems
4165 which do not support limiting in this manner should ignore the
4169 This specifies a FIFO special file. Note that the archiving of a
4170 FIFO file archives the existence of this file and not its contents.
4173 This specifies a contiguous file, which is the same as a normal
4174 file except that, in operating systems which support it, all its
4175 space is allocated contiguously on the disk. Operating systems
4176 which do not allow contiguous allocation should silently treat this
4177 type as a normal file.
4180 These are reserved for custom implementations. Some of these are
4181 used in the GNU modified format, as described below.
4184 Other values are reserved for specification in future revisions of
4185 the P1003 standard, and should not be used by any `tar' program.
4187 The `magic' field indicates that this archive was output in the
4188 P1003 archive format. If this field contains `TMAGIC', the `uname' and
4189 `gname' fields will contain the ASCII representation of the owner and
4190 group of the file respectively. If found, the user and group IDs are
4191 used rather than the values in the `uid' and `gid' fields.
4193 For references, see ISO/IEC 9945-1:1990 or IEEE Std 1003.1-1990,
4194 pages 169-173 (section 10.1) for `Archive/Interchange File Format'; and
4195 IEEE Std 1003.2-1992, pages 380-388 (section 4.48) and pages 936-940
4196 (section E.4.48) for `pax - Portable archive interchange'.
4199 File: tar.info, Node: Extensions, Next: Sparse Formats, Prev: Standard, Up: Tar Internals
4201 GNU Extensions to the Archive Format
4202 ====================================
4204 _(This message will disappear, once this node revised.)_
4206 The GNU format uses additional file types to describe new types of
4207 files in an archive. These are listed below.
4211 This represents a directory and a list of files created by the
4212 `--incremental' (`-G') option. The `size' field gives the total
4213 size of the associated list of files. Each file name is preceded
4214 by either a `Y' (the file should be in this archive) or an `N'.
4215 (The file is a directory, or is not stored in the archive.) Each
4216 file name is terminated by a null. There is an additional null
4217 after the last file name.
4221 This represents a file continued from another volume of a
4222 multi-volume archive created with the `--multi-volume' (`-M')
4223 option. The original type of the file is not given here. The
4224 `size' field gives the maximum size of this piece of the file
4225 (assuming the volume does not end before the file is written out).
4226 The `offset' field gives the offset from the beginning of the file
4227 where this part of the file begins. Thus `size' plus `offset'
4228 should equal the original size of the file.
4232 This flag indicates that we are dealing with a sparse file. Note
4233 that archiving a sparse file requires special operations to find
4234 holes in the file, which mark the positions of these holes, along
4235 with the number of bytes of data to be found after the hole.
4239 This file type is used to mark the volume header that was given
4240 with the `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option when
4241 the archive was created. The `name' field contains the `name'
4242 given after the `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL')
4243 option. The `size' field is zero. Only the first file in each
4244 volume of an archive should have this type.
4247 You may have trouble reading a GNU format archive on a non-GNU
4248 system if the options `--incremental' (`-G'), `--multi-volume' (`-M'),
4249 `--sparse' (`-S'), or `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') were
4250 used when writing the archive. In general, if `tar' does not use the
4251 GNU-added fields of the header, other versions of `tar' should be able
4252 to read the archive. Otherwise, the `tar' program will give an error,
4253 the most likely one being a checksum error.
4256 File: tar.info, Node: Sparse Formats, Next: Snapshot Files, Prev: Extensions, Up: Tar Internals
4258 Storing Sparse Files
4259 ====================
4261 The notion of sparse file, and the ways of handling it from the point
4262 of view of GNU `tar' user have been described in detail in *note
4263 sparse::. This chapter describes the internal format GNU `tar' uses to
4266 The support for sparse files in GNU `tar' has a long history. The
4267 earliest version featuring this support that I was able to find was
4268 1.09, released in November, 1990. The format introduced back then is
4269 called "old GNU" sparse format and in spite of the fact that its design
4270 contained many flaws, it was the only format GNU `tar' supported until
4271 version 1.14 (May, 2004), which introduced initial support for sparse
4272 archives in PAX archives (*note posix::). This format was not free
4273 from design flaws, either and it was subsequently improved in versions
4274 1.15.2 (November, 2005) and 1.15.92 (June, 2006).
4276 In addition to GNU sparse format, GNU `tar' is able to read and
4277 extract sparse files archived by `star'.
4279 The following subsections describe each format in detail.
4284 * PAX 0:: PAX Format, Versions 0.0 and 0.1
4285 * PAX 1:: PAX Format, Version 1.0
4288 File: tar.info, Node: Old GNU Format, Next: PAX 0, Up: Sparse Formats
4290 D.0.1 Old GNU Format
4291 --------------------
4293 The format introduced in November 1990 (v. 1.09) was designed on top of
4294 standard `ustar' headers in such an unfortunate way that some of its
4295 fields overwrote fields required by POSIX.
4297 An old GNU sparse header is designated by type `S'
4298 (`GNUTYPE_SPARSE') and has the following layout:
4300 Offset Size Name Data type Contents
4301 ----------------------------------------------------------------------------
4303 345 12 atime Number `atime' of the file.
4304 357 12 ctime Number `ctime' of the file .
4305 369 12 offset Number For multivolume archives:
4306 the offset of the start of
4310 386 96 sp `sparse_header'(4 entries) File map.
4311 482 1 isextended Bool `1' if an extension sparse
4314 483 12 realsize Number Real size of the file.
4316 Each of `sparse_header' object at offset 386 describes a single data
4317 chunk. It has the following structure:
4319 Offset Size Data type Contents
4320 ---------------------------------------------------------------------------
4321 0 12 Number Offset of the beginning of the chunk.
4322 12 12 Number Size of the chunk.
4324 If the member contains more than four chunks, the `isextended' field
4325 of the header has the value `1' and the main header is followed by one
4326 or more "extension headers". Each such header has the following
4329 Offset Size Name Data type Contents
4330 ----------------------------------------------------------------------------
4331 0 21 sp `sparse_header' (21 entries) File map.
4332 504 1 isextended Bool `1' if an extension sparse
4333 header follows, or `0'
4336 A header with `isextended=0' ends the map.
4339 File: tar.info, Node: PAX 0, Next: PAX 1, Prev: Old GNU Format, Up: Sparse Formats
4341 D.0.2 PAX Format, Versions 0.0 and 0.1
4342 --------------------------------------
4344 There are two formats available in this branch. The version `0.0' is
4345 the initial version of sparse format used by `tar' versions
4346 1.14-1.15.1. The sparse file map is kept in extended (`x') PAX header
4350 Real size of the stored file;
4352 `GNU.sparse.numblocks'
4353 Number of blocks in the sparse map;
4356 Offset of the data block;
4358 `GNU.sparse.numbytes'
4359 Size of the data block.
4361 The latter two variables repeat for each data block, so the overall
4362 structure is like this:
4364 GNU.sparse.size=SIZE
4365 GNU.sparse.numblocks=NUMBLOCKS
4366 repeat NUMBLOCKS times
4367 GNU.sparse.offset=OFFSET
4368 GNU.sparse.numbytes=NUMBYTES
4371 This format presented the following two problems:
4373 1. Whereas the POSIX specification allows a variable to appear
4374 multiple times in a header, it requires that only the last
4375 occurrence be meaningful. Thus, multiple occurrences of
4376 `GNU.sparse.offset' and `GNU.sparse.numbytes' are conflicting with
4379 2. Attempting to extract such archives using a third-party's `tar'
4380 results in extraction of sparse files in _condensed form_. If the
4381 `tar' implementation in question does not support POSIX format, it
4382 will also extract a file containing extension header attributes.
4383 This file can be used to expand the file to its original state.
4384 However, posix-aware `tar's will usually ignore the unknown
4385 variables, which makes restoring the file more difficult. *Note
4386 Extraction of sparse members in v.0.0 format: extracting sparse
4387 v.0.x, for the detailed description of how to restore such members
4388 using non-GNU `tar's.
4390 GNU `tar' 1.15.2 introduced sparse format version `0.1', which
4391 attempted to solve these problems. As its predecessor, this format
4392 stores sparse map in the extended POSIX header. It retains
4393 `GNU.sparse.size' and `GNU.sparse.numblocks' variables, but instead of
4394 `GNU.sparse.offset'/`GNU.sparse.numbytes' pairs it uses a single
4398 Map of non-null data chunks. It is a string consisting of
4399 comma-separated values "OFFSET,SIZE[,OFFSET-1,SIZE-1...]"
4401 To address the 2nd problem, the `name' field in `ustar' is replaced
4402 with a special name, constructed using the following pattern:
4404 %d/GNUSparseFile.%p/%f
4406 The real name of the sparse file is stored in the variable
4407 `GNU.sparse.name'. Thus, those `tar' implementations that are not
4408 aware of GNU extensions will at least extract the files into separate
4409 directories, giving the user a possibility to expand it afterwards.
4410 *Note Extraction of sparse members in v.0.1 format: extracting sparse
4411 v.0.x, for the detailed description of how to restore such members
4412 using non-GNU `tar's.
4414 The resulting `GNU.sparse.map' string can be _very_ long. Although
4415 POSIX does not impose any limit on the length of a `x' header variable,
4416 this possibly can confuse some `tar's.
4419 File: tar.info, Node: PAX 1, Prev: PAX 0, Up: Sparse Formats
4421 D.0.3 PAX Format, Version 1.0
4422 -----------------------------
4424 The version `1.0' of sparse format was introduced with GNU `tar'
4425 1.15.92. Its main objective was to make the resulting file extractable
4426 with little effort even by non-posix aware `tar' implementations.
4427 Starting from this version, the extended header preceding a sparse
4428 member always contains the following variables that identify the format
4437 The `name' field in `ustar' header contains a special name,
4438 constructed using the following pattern:
4440 %d/GNUSparseFile.%p/%f
4442 The real name of the sparse file is stored in the variable
4443 `GNU.sparse.name'. The real size of the file is stored in the variable
4444 `GNU.sparse.realsize'.
4446 The sparse map itself is stored in the file data block, preceding
4447 the actual file data. It consists of a series of octal numbers of
4448 arbitrary length, delimited by newlines. The map is padded with nulls
4449 to the nearest block boundary.
4451 The first number gives the number of entries in the map. Following
4452 are map entries, each one consisting of two numbers giving the offset
4453 and size of the data block it describes.
4455 The format is designed in such a way that non-posix aware `tar's and
4456 `tar's not supporting `GNU.sparse.*' keywords will extract each sparse
4457 file in its condensed form with the file map prepended and will place it
4458 into a separate directory. Then, using a simple program it would be
4459 possible to expand the file to its original form even without GNU `tar'.
4460 *Note Sparse Recovery::, for the detailed information on how to extract
4461 sparse members without GNU `tar'.
4464 File: tar.info, Node: Snapshot Files, Next: Dumpdir, Prev: Sparse Formats, Up: Tar Internals
4466 Format of the Incremental Snapshot Files
4467 ========================================
4469 A "snapshot file" (or "directory file") is created during incremental
4470 backups (*note Incremental Dumps::). It contains the status of the
4471 file system at the time of the dump and is used to determine which
4472 files were modified since the last backup.
4474 GNU `tar' version 1.28 supports three snapshot file formats. The
4475 first format, called "format 0", is the one used by GNU `tar' versions
4476 up to and including 1.15.1. The second format, called "format 1" is an
4477 extended version of this format, that contains more metadata and allows
4478 for further extensions. It was used by alpha release version 1.15.90.
4479 For alpha version 1.15.91 and stable releases version 1.16 up through
4480 1.28, the "format 2" is used.
4482 GNU `tar' is able to read all three formats, but will create
4483 snapshots only in format 2.
4485 This appendix describes all three formats in detail.
4487 0. `Format 0' snapshot file begins with a line containing a decimal
4488 number that represents a UNIX timestamp of the beginning of the
4489 last archivation. This line is followed by directory metadata
4490 descriptions, one per line. Each description has the following
4498 A single plus character (`+'), if this directory is located on
4499 an NFS-mounted partition, otherwise empty.
4501 (That is, for non-NFS directories, the first character on the
4502 description line contains the start of the DEV field.)
4505 Device number of the directory;
4508 I-node number of the directory;
4511 Name of the directory. Any special characters (white-space,
4512 backslashes, etc.) are quoted.
4514 1. `Format 1' snapshot file begins with a line specifying the
4515 format of the file. This line has the following structure:
4517 `GNU tar-'TAR-VERSION`-'INCR-FORMAT-VERSION
4519 where TAR-VERSION is the version number of GNU `tar'
4520 implementation that created this snapshot, and INCR-FORMAT-VERSION
4521 is the version number of the snapshot format (in this case `1').
4523 Next line contains two decimal numbers, representing the time of
4524 the last backup. First number is the number of seconds, the second
4525 one is the number of nanoseconds, since the beginning of the epoch.
4527 Lines that follow contain directory metadata, one line per
4528 directory. Each line is formatted as follows:
4530 [NFS]MTIME-SEC MTIME-NSEC DEV INODE NAME
4532 where MTIME-SEC and MTIME-NSEC represent last modification time of
4533 this directory with nanosecond precision; NFS, DEV, INODE and NAME
4534 have the same meaning as with `format 0'.
4536 2. `Format 2' snapshot file begins with a format identifier, as
4537 described for version 1, e.g.:
4541 This line is followed by newline. Rest of file consists of
4542 records, separated by null (ASCII 0) characters. Thus, in contrast
4543 to the previous formats, format 2 snapshot is a binary file.
4545 First two records are decimal integers, representing the time of
4546 the last backup. First number is the number of seconds, the
4547 second one is the number of nanoseconds, since the beginning of the
4548 epoch. These are followed by arbitrary number of directory
4551 Each "directory record" contains a set of metadata describing a
4552 particular directory. Parts of a directory record are delimited
4553 with ASCII 0 characters. The following table describes each part.
4554 The "Number" type in this table stands for a decimal integer in
4555 ASCII notation. (Negative values are preceeded with a "-"
4556 character, while positive values have no leading punctuation.)
4558 Field Type Description
4559 ----------------------------------------------------------------------
4560 nfs Character `1' if the directory is located on an
4561 NFS-mounted partition, or `0' otherwise;
4562 timestamp_sec Number Modification time, seconds;
4563 timestamp_nsec Number Modification time, nanoseconds;
4564 dev Number Device number;
4565 ino Number I-node number;
4566 name String Directory name; in contrast to the
4567 previous versions it is not quoted;
4568 contents Dumpdir Contents of the directory; *Note
4569 Dumpdir::, for a description of its
4573 Dumpdirs stored in snapshot files contain only records of types
4576 The specific range of values allowed in each of the "Number" fields
4577 depends on the underlying C datatypes as determined when `tar' is
4578 compiled. To see the specific ranges allowed for a particular
4579 `tar' binary, you can use the `--show-snapshot-field-ranges'
4582 $ tar --show-shapshot-field-ranges
4583 This tar's snapshot file field ranges are
4584 (field name => [ min, max ]):
4587 timestamp_sec => [ -9223372036854775808, 9223372036854775807 ],
4588 timestamp_nsec => [ 0, 999999999 ],
4589 dev => [ 0, 18446744073709551615 ],
4590 ino => [ 0, 18446744073709551615 ],
4592 (This example is from a GNU/Linux x86_64 system.)
4596 File: tar.info, Node: Dumpdir, Prev: Snapshot Files, Up: Tar Internals
4601 Incremental archives keep information about contents of each dumped
4602 directory in special data blocks called "dumpdirs".
4604 Dumpdir is a sequence of entries of the following form:
4608 where C is one of the "control codes" described below, FILENAME is the
4609 name of the file C operates upon, and `\0' represents a nul character
4610 (ASCII 0). The white space characters were added for readability, real
4611 dumpdirs do not contain them.
4613 Each dumpdir ends with a single nul character.
4615 The following table describes control codes and their meanings:
4618 FILENAME is contained in the archive.
4621 FILENAME was present in the directory at the time the archive was
4622 made, yet it was not dumped to the archive, because it had not
4623 changed since the last backup.
4626 FILENAME is a directory.
4629 This code requests renaming of the FILENAME to the name specified
4630 with the `T' command, that immediately follows it.
4633 Specify target file name for `R' command (see below).
4636 Specify "temporary directory" name for a rename operation (see
4639 Codes `Y', `N' and `D' require FILENAME argument to be a relative
4640 file name to the directory this dumpdir describes, whereas codes `R',
4641 `T' and `X' require their argument to be an absolute file name.
4643 The three codes `R', `T' and `X' specify a "renaming operation". In
4644 the simplest case it is:
4646 R`source'\0T`dest'\0
4648 which means "rename file `source' to file `dest'".
4650 However, there are cases that require using a "temporary directory".
4651 For example, consider the following scenario:
4653 1. Previous run dumped a directory `foo' which contained the
4654 following three directories:
4660 2. They were renamed _cyclically_, so that:
4666 3. New incremental dump was made.
4668 This case cannot be handled by three successive renames, since
4669 renaming `a' to `b' will destroy the existing directory. To correctly
4670 process it, GNU `tar' needs a temporary directory, so it creates the
4671 following dumpdir (newlines have been added for readability):
4679 The first command, `Xfoo\0', instructs the extractor to create a
4680 temporary directory in the directory `foo'. Second command,
4681 `Rfoo/aT\0', says "rename file `foo/a' to the temporary directory that
4682 has just been created" (empty file name after a command means use
4683 temporary directory). Third and fourth commands work as usual, and,
4684 finally, the last command, `R\0Tfoo/a\0' tells tar to rename the
4685 temporary directory to `foo/a'.
4687 The exact placement of a dumpdir in the archive depends on the
4688 archive format (*note Formats::):
4692 In PAX archives, dumpdir is stored in the extended header of the
4693 corresponding directory, in variable `GNU.dumpdir'.
4695 * GNU and old GNU archives
4697 These formats implement special header type `D', which is similar
4698 to ustar header `5' (directory), except that it precedes a data
4699 block containing the dumpdir.
4702 File: tar.info, Node: Genfile, Next: Free Software Needs Free Documentation, Prev: Tar Internals, Up: Top
4707 This appendix describes `genfile', an auxiliary program used in the GNU
4708 tar testsuite. If you are not interested in developing GNU tar, skip
4711 Initially, `genfile' was used to generate data files for the
4712 testsuite, hence its name. However, new operation modes were being
4713 implemented as the testsuite grew more sophisticated, and now `genfile'
4714 is a multi-purpose instrument.
4716 There are three basic operation modes:
4719 This is the default mode. In this mode, `genfile' generates data
4723 In this mode `genfile' displays status of specified files.
4725 Synchronous Execution.
4726 In this mode `genfile' executes the given program with
4727 `--checkpoint' option and executes a set of actions when specified
4728 checkpoints are reached.
4732 * Generate Mode:: File Generation Mode.
4733 * Status Mode:: File Status Mode.
4734 * Exec Mode:: Synchronous Execution mode.
4737 File: tar.info, Node: Generate Mode, Next: Status Mode, Up: Genfile
4742 In this mode `genfile' creates a data file for the test suite. The size
4743 of the file is given with the `--length' (`-l') option. By default the
4744 file contents is written to the standard output, this can be changed
4745 using `--file' (`-f') command line option. Thus, the following two
4746 commands are equivalent:
4748 genfile --length 100 > outfile
4749 genfile --length 100 --file outfile
4751 If `--length' is not given, `genfile' will generate an empty
4754 The command line option `--seek=N' istructs `genfile' to skip the
4755 given number of bytes (N) in the output file before writing to it. It
4756 is similar to the `seek=N' of the `dd' utility.
4758 You can instruct `genfile' to create several files at one go, by
4759 giving it `--files-from' (`-T') option followed by a name of file
4760 containing a list of file names. Using dash (`-') instead of the file
4761 name causes `genfile' to read file list from the standard input. For
4764 # Read file names from file `file.list'
4765 genfile --files-from file.list
4766 # Read file names from standard input
4767 genfile --files-from -
4769 The list file is supposed to contain one file name per line. To use
4770 file lists separated by ASCII NUL character, use `--null' (`-0')
4771 command line option:
4773 genfile --null --files-from file.list
4775 The default data pattern for filling the generated file consists of
4776 first 256 letters of ASCII code, repeated enough times to fill the
4777 entire file. This behavior can be changed with `--pattern' option. This
4778 option takes a mandatory argument, specifying pattern name to use.
4779 Currently two patterns are implemented:
4782 The default pattern as described above.
4785 Fills the file with zeroes.
4787 If no file name was given, the program exits with the code `0'.
4788 Otherwise, it exits with `0' only if it was able to create a file of
4789 the specified length.
4791 Special option `--sparse' (`-s') instructs `genfile' to create a
4792 sparse file. Sparse files consist of "data fragments", separated by
4793 "holes" or blocks of zeros. On many operating systems, actual disk
4794 storage is not allocated for holes, but they are counted in the length
4795 of the file. To create a sparse file, `genfile' should know where to
4796 put data fragments, and what data to use to fill them. So, when
4797 `--sparse' is given the rest of the command line specifies a so-called
4800 The file map consists of any number of "fragment descriptors". Each
4801 descriptor is composed of two values: a number, specifying fragment
4802 offset from the end of the previous fragment or, for the very first
4803 fragment, from the beginning of the file, and "contents string", i.e.,
4804 a string of characters, specifying the pattern to fill the fragment
4805 with. File offset can be suffixed with the following quantifiers:
4809 The number is expressed in kilobytes.
4813 The number is expressed in megabytes.
4817 The number is expressed in gigabytes.
4819 For each letter in contents string `genfile' will generate a "block"
4820 of data, filled with this letter and will write it to the fragment. The
4821 size of block is given by `--block-size' option. It defaults to 512.
4822 Thus, if the string consists of N characters, the resulting file
4823 fragment will contain `N*BLOCK-SIZE' of data.
4825 Last fragment descriptor can have only file offset part. In this
4826 case `genfile' will create a hole at the end of the file up to the
4829 For example, consider the following invocation:
4831 genfile --sparse --file sparsefile 0 ABCD 1M EFGHI 2000K
4833 It will create 3101184-bytes long file of the following structure:
4835 Offset Length Contents
4836 0 4*512=2048 Four 512-byte blocks, filled
4837 with letters `A', `B', `C' and
4839 2048 1046528 Zero bytes
4840 1050624 5*512=2560 Five blocks, filled with letters
4841 `E', `F', `G', `H', `I'.
4842 1053184 2048000 Zero bytes
4844 The exit code of `genfile --status' command is `0' only if created
4845 file is actually sparse.
4848 File: tar.info, Node: Status Mode, Next: Exec Mode, Prev: Generate Mode, Up: Genfile
4853 In status mode, `genfile' prints file system status for each file
4854 specified in the command line. This mode is toggled by `--stat' (`-S')
4855 command line option. An optional argument to this option specifies
4856 output "format": a comma-separated list of `struct stat' fields to be
4857 displayed. This list can contain following identifiers:
4864 Device number in decimal.
4872 File mode in octal. Optional NUMBER specifies octal mask to be
4873 applied to the mode before outputting. For example, `--stat
4874 mode.777' will preserve lower nine bits of it. Notice, that you
4875 can use any punctuation character in place of `.'.
4879 Number of hard links.
4891 File size in decimal.
4895 The size in bytes of each file block.
4899 Number of blocks allocated.
4903 Time of last access.
4907 Time of last modification
4911 Time of last status change
4914 A boolean value indicating whether the file is `sparse'.
4916 Modification times are displayed in UTC as UNIX timestamps, unless
4917 suffixed with `H' (for "human-readable"), as in `ctimeH', in which case
4918 usual `tar tv' output format is used.
4920 The default output format is: `name,dev,ino,mode,
4921 nlink,uid,gid,size,blksize,blocks,atime,mtime,ctime'.
4923 For example, the following command will display file names and
4924 corresponding times of last access for each file in the current working
4927 genfile --stat=name,atime *
4930 File: tar.info, Node: Exec Mode, Prev: Status Mode, Up: Genfile
4935 This mode is designed for testing the behavior of `paxutils' commands
4936 when some of the files change during archiving. It is an experimental
4939 The `Exec Mode' is toggled by `--run' command line option (or its
4940 alias `-r'). The non-optional arguments to `getopt' give the command
4941 line to be executed. Normally, it should contain at least the
4942 `--checkpoint' option.
4944 A set of options is provided for defining checkpoint values and
4945 actions to be executed upon reaching them. Checkpoint values are
4946 introduced with the `--checkpoint' command line option. Argument to
4947 this option is the number of checkpoint in decimal.
4949 Any number of "actions" may be specified after a checkpoint.
4950 Available actions are
4954 Truncate FILE to the size specified by previous `--length' option
4955 (or 0, if it is not given).
4958 Append data to FILE. The size of data and its pattern are given by
4959 previous `--length' and `pattern' options.
4962 Update the access and modification times of FILE. These timestamps
4963 are changed to the current time, unless `--date' option was given,
4964 in which case they are changed to the specified time. Argument to
4965 `--date' option is a date specification in an almost arbitrary
4966 format (*note Date input formats::).
4969 Execute given shell command.
4974 Option `--verbose' instructs `genfile' to print on standard output
4975 notifications about checkpoints being executed and to verbosely
4976 describe exit status of the command.
4978 While the command is being executed its standard output remains
4979 connected to descriptor 1. All messages it prints to file descriptor 2,
4980 except checkpoint notifications, are forwarded to standard error.
4982 `Genfile' exits with the exit status of the executed command.
4984 For compatibility with previous `genfile' versions, the `--run'
4985 option takes an optional argument. If used this way, its argument
4986 supplies the command line to be executed. There should be no
4987 non-optional arguments in the `genfile' command line.
4989 The actual command line is constructed by inserting the
4990 `--checkpoint' option between the command name and its first argument
4991 (if any). Due to this, the argument to `--run' may not use traditional
4992 `tar' option syntax, i.e., the following is wrong:
4995 genfile --run='tar cf foo bar'
4997 Use the following syntax instead:
4999 genfile --run='tar -cf foo bar' ACTIONS...
5001 The above command line is equivalent to
5003 genfile ACTIONS... -- tar -cf foo bar
5005 Notice, that the use of compatibility mode is deprecated.
5008 File: tar.info, Node: Free Software Needs Free Documentation, Next: GNU Free Documentation License, Prev: Genfile, Up: Top
5010 Appendix F Free Software Needs Free Documentation
5011 *************************************************
5013 The biggest deficiency in the free software community today is not in
5014 the software--it is the lack of good free documentation that we can
5015 include with the free software. Many of our most important programs do
5016 not come with free reference manuals and free introductory texts.
5017 Documentation is an essential part of any software package; when an
5018 important free software package does not come with a free manual and a
5019 free tutorial, that is a major gap. We have many such gaps today.
5021 Consider Perl, for instance. The tutorial manuals that people
5022 normally use are non-free. How did this come about? Because the
5023 authors of those manuals published them with restrictive terms--no
5024 copying, no modification, source files not available--which exclude
5025 them from the free software world.
5027 That wasn't the first time this sort of thing happened, and it was
5028 far from the last. Many times we have heard a GNU user eagerly
5029 describe a manual that he is writing, his intended contribution to the
5030 community, only to learn that he had ruined everything by signing a
5031 publication contract to make it non-free.
5033 Free documentation, like free software, is a matter of freedom, not
5034 price. The problem with the non-free manual is not that publishers
5035 charge a price for printed copies--that in itself is fine. (The Free
5036 Software Foundation sells printed copies of manuals, too.) The problem
5037 is the restrictions on the use of the manual. Free manuals are
5038 available in source code form, and give you permission to copy and
5039 modify. Non-free manuals do not allow this.
5041 The criteria of freedom for a free manual are roughly the same as for
5042 free software. Redistribution (including the normal kinds of
5043 commercial redistribution) must be permitted, so that the manual can
5044 accompany every copy of the program, both on-line and on paper.
5046 Permission for modification of the technical content is crucial too.
5047 When people modify the software, adding or changing features, if they
5048 are conscientious they will change the manual too--so they can provide
5049 accurate and clear documentation for the modified program. A manual
5050 that leaves you no choice but to write a new manual to document a
5051 changed version of the program is not really available to our community.
5053 Some kinds of limits on the way modification is handled are
5054 acceptable. For example, requirements to preserve the original
5055 author's copyright notice, the distribution terms, or the list of
5056 authors, are ok. It is also no problem to require modified versions to
5057 include notice that they were modified. Even entire sections that may
5058 not be deleted or changed are acceptable, as long as they deal with
5059 nontechnical topics (like this one). These kinds of restrictions are
5060 acceptable because they don't obstruct the community's normal use of
5063 However, it must be possible to modify all the _technical_ content
5064 of the manual, and then distribute the result in all the usual media,
5065 through all the usual channels. Otherwise, the restrictions obstruct
5066 the use of the manual, it is not free, and we need another manual to
5069 Please spread the word about this issue. Our community continues to
5070 lose manuals to proprietary publishing. If we spread the word that
5071 free software needs free reference manuals and free tutorials, perhaps
5072 the next person who wants to contribute by writing documentation will
5073 realize, before it is too late, that only free manuals contribute to
5074 the free software community.
5076 If you are writing documentation, please insist on publishing it
5077 under the GNU Free Documentation License or another free documentation
5078 license. Remember that this decision requires your approval--you don't
5079 have to let the publisher decide. Some commercial publishers will use
5080 a free license if you insist, but they will not propose the option; it
5081 is up to you to raise the issue and say firmly that this is what you
5082 want. If the publisher you are dealing with refuses, please try other
5083 publishers. If you're not sure whether a proposed license is free,
5084 write to <licensing@gnu.org>.
5086 You can encourage commercial publishers to sell more free, copylefted
5087 manuals and tutorials by buying them, and particularly by buying copies
5088 from the publishers that paid for their writing or for major
5089 improvements. Meanwhile, try to avoid buying non-free documentation at
5090 all. Check the distribution terms of a manual before you buy it, and
5091 insist that whoever seeks your business must respect your freedom.
5092 Check the history of the book, and try reward the publishers that have
5093 paid or pay the authors to work on it.
5095 The Free Software Foundation maintains a list of free documentation
5096 published by other publishers, at
5097 `http://www.fsf.org/doc/other-free-books.html'.
5100 File: tar.info, Node: GNU Free Documentation License, Next: Index of Command Line Options, Prev: Free Software Needs Free Documentation, Up: Top
5102 Appendix G GNU Free Documentation License
5103 *****************************************
5105 Version 1.3, 3 November 2008
5107 Copyright (C) 2000-2002, 2007-2008, 2014 Free Software
5111 Everyone is permitted to copy and distribute verbatim copies
5112 of this license document, but changing it is not allowed.
5116 The purpose of this License is to make a manual, textbook, or other
5117 functional and useful document "free" in the sense of freedom: to
5118 assure everyone the effective freedom to copy and redistribute it,
5119 with or without modifying it, either commercially or
5120 noncommercially. Secondarily, this License preserves for the
5121 author and publisher a way to get credit for their work, while not
5122 being considered responsible for modifications made by others.
5124 This License is a kind of "copyleft", which means that derivative
5125 works of the document must themselves be free in the same sense.
5126 It complements the GNU General Public License, which is a copyleft
5127 license designed for free software.
5129 We have designed this License in order to use it for manuals for
5130 free software, because free software needs free documentation: a
5131 free program should come with manuals providing the same freedoms
5132 that the software does. But this License is not limited to
5133 software manuals; it can be used for any textual work, regardless
5134 of subject matter or whether it is published as a printed book.
5135 We recommend this License principally for works whose purpose is
5136 instruction or reference.
5138 1. APPLICABILITY AND DEFINITIONS
5140 This License applies to any manual or other work, in any medium,
5141 that contains a notice placed by the copyright holder saying it
5142 can be distributed under the terms of this License. Such a notice
5143 grants a world-wide, royalty-free license, unlimited in duration,
5144 to use that work under the conditions stated herein. The
5145 "Document", below, refers to any such manual or work. Any member
5146 of the public is a licensee, and is addressed as "you". You
5147 accept the license if you copy, modify or distribute the work in a
5148 way requiring permission under copyright law.
5150 A "Modified Version" of the Document means any work containing the
5151 Document or a portion of it, either copied verbatim, or with
5152 modifications and/or translated into another language.
5154 A "Secondary Section" is a named appendix or a front-matter section
5155 of the Document that deals exclusively with the relationship of the
5156 publishers or authors of the Document to the Document's overall
5157 subject (or to related matters) and contains nothing that could
5158 fall directly within that overall subject. (Thus, if the Document
5159 is in part a textbook of mathematics, a Secondary Section may not
5160 explain any mathematics.) The relationship could be a matter of
5161 historical connection with the subject or with related matters, or
5162 of legal, commercial, philosophical, ethical or political position
5165 The "Invariant Sections" are certain Secondary Sections whose
5166 titles are designated, as being those of Invariant Sections, in
5167 the notice that says that the Document is released under this
5168 License. If a section does not fit the above definition of
5169 Secondary then it is not allowed to be designated as Invariant.
5170 The Document may contain zero Invariant Sections. If the Document
5171 does not identify any Invariant Sections then there are none.
5173 The "Cover Texts" are certain short passages of text that are
5174 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
5175 that says that the Document is released under this License. A
5176 Front-Cover Text may be at most 5 words, and a Back-Cover Text may
5177 be at most 25 words.
5179 A "Transparent" copy of the Document means a machine-readable copy,
5180 represented in a format whose specification is available to the
5181 general public, that is suitable for revising the document
5182 straightforwardly with generic text editors or (for images
5183 composed of pixels) generic paint programs or (for drawings) some
5184 widely available drawing editor, and that is suitable for input to
5185 text formatters or for automatic translation to a variety of
5186 formats suitable for input to text formatters. A copy made in an
5187 otherwise Transparent file format whose markup, or absence of
5188 markup, has been arranged to thwart or discourage subsequent
5189 modification by readers is not Transparent. An image format is
5190 not Transparent if used for any substantial amount of text. A
5191 copy that is not "Transparent" is called "Opaque".
5193 Examples of suitable formats for Transparent copies include plain
5194 ASCII without markup, Texinfo input format, LaTeX input format,
5195 SGML or XML using a publicly available DTD, and
5196 standard-conforming simple HTML, PostScript or PDF designed for
5197 human modification. Examples of transparent image formats include
5198 PNG, XCF and JPG. Opaque formats include proprietary formats that
5199 can be read and edited only by proprietary word processors, SGML or
5200 XML for which the DTD and/or processing tools are not generally
5201 available, and the machine-generated HTML, PostScript or PDF
5202 produced by some word processors for output purposes only.
5204 The "Title Page" means, for a printed book, the title page itself,
5205 plus such following pages as are needed to hold, legibly, the
5206 material this License requires to appear in the title page. For
5207 works in formats which do not have any title page as such, "Title
5208 Page" means the text near the most prominent appearance of the
5209 work's title, preceding the beginning of the body of the text.
5211 The "publisher" means any person or entity that distributes copies
5212 of the Document to the public.
5214 A section "Entitled XYZ" means a named subunit of the Document
5215 whose title either is precisely XYZ or contains XYZ in parentheses
5216 following text that translates XYZ in another language. (Here XYZ
5217 stands for a specific section name mentioned below, such as
5218 "Acknowledgements", "Dedications", "Endorsements", or "History".)
5219 To "Preserve the Title" of such a section when you modify the
5220 Document means that it remains a section "Entitled XYZ" according
5223 The Document may include Warranty Disclaimers next to the notice
5224 which states that this License applies to the Document. These
5225 Warranty Disclaimers are considered to be included by reference in
5226 this License, but only as regards disclaiming warranties: any other
5227 implication that these Warranty Disclaimers may have is void and
5228 has no effect on the meaning of this License.
5232 You may copy and distribute the Document in any medium, either
5233 commercially or noncommercially, provided that this License, the
5234 copyright notices, and the license notice saying this License
5235 applies to the Document are reproduced in all copies, and that you
5236 add no other conditions whatsoever to those of this License. You
5237 may not use technical measures to obstruct or control the reading
5238 or further copying of the copies you make or distribute. However,
5239 you may accept compensation in exchange for copies. If you
5240 distribute a large enough number of copies you must also follow
5241 the conditions in section 3.
5243 You may also lend copies, under the same conditions stated above,
5244 and you may publicly display copies.
5246 3. COPYING IN QUANTITY
5248 If you publish printed copies (or copies in media that commonly
5249 have printed covers) of the Document, numbering more than 100, and
5250 the Document's license notice requires Cover Texts, you must
5251 enclose the copies in covers that carry, clearly and legibly, all
5252 these Cover Texts: Front-Cover Texts on the front cover, and
5253 Back-Cover Texts on the back cover. Both covers must also clearly
5254 and legibly identify you as the publisher of these copies. The
5255 front cover must present the full title with all words of the
5256 title equally prominent and visible. You may add other material
5257 on the covers in addition. Copying with changes limited to the
5258 covers, as long as they preserve the title of the Document and
5259 satisfy these conditions, can be treated as verbatim copying in
5262 If the required texts for either cover are too voluminous to fit
5263 legibly, you should put the first ones listed (as many as fit
5264 reasonably) on the actual cover, and continue the rest onto
5267 If you publish or distribute Opaque copies of the Document
5268 numbering more than 100, you must either include a
5269 machine-readable Transparent copy along with each Opaque copy, or
5270 state in or with each Opaque copy a computer-network location from
5271 which the general network-using public has access to download
5272 using public-standard network protocols a complete Transparent
5273 copy of the Document, free of added material. If you use the
5274 latter option, you must take reasonably prudent steps, when you
5275 begin distribution of Opaque copies in quantity, to ensure that
5276 this Transparent copy will remain thus accessible at the stated
5277 location until at least one year after the last time you
5278 distribute an Opaque copy (directly or through your agents or
5279 retailers) of that edition to the public.
5281 It is requested, but not required, that you contact the authors of
5282 the Document well before redistributing any large number of
5283 copies, to give them a chance to provide you with an updated
5284 version of the Document.
5288 You may copy and distribute a Modified Version of the Document
5289 under the conditions of sections 2 and 3 above, provided that you
5290 release the Modified Version under precisely this License, with
5291 the Modified Version filling the role of the Document, thus
5292 licensing distribution and modification of the Modified Version to
5293 whoever possesses a copy of it. In addition, you must do these
5294 things in the Modified Version:
5296 A. Use in the Title Page (and on the covers, if any) a title
5297 distinct from that of the Document, and from those of
5298 previous versions (which should, if there were any, be listed
5299 in the History section of the Document). You may use the
5300 same title as a previous version if the original publisher of
5301 that version gives permission.
5303 B. List on the Title Page, as authors, one or more persons or
5304 entities responsible for authorship of the modifications in
5305 the Modified Version, together with at least five of the
5306 principal authors of the Document (all of its principal
5307 authors, if it has fewer than five), unless they release you
5308 from this requirement.
5310 C. State on the Title page the name of the publisher of the
5311 Modified Version, as the publisher.
5313 D. Preserve all the copyright notices of the Document.
5315 E. Add an appropriate copyright notice for your modifications
5316 adjacent to the other copyright notices.
5318 F. Include, immediately after the copyright notices, a license
5319 notice giving the public permission to use the Modified
5320 Version under the terms of this License, in the form shown in
5323 G. Preserve in that license notice the full lists of Invariant
5324 Sections and required Cover Texts given in the Document's
5327 H. Include an unaltered copy of this License.
5329 I. Preserve the section Entitled "History", Preserve its Title,
5330 and add to it an item stating at least the title, year, new
5331 authors, and publisher of the Modified Version as given on
5332 the Title Page. If there is no section Entitled "History" in
5333 the Document, create one stating the title, year, authors,
5334 and publisher of the Document as given on its Title Page,
5335 then add an item describing the Modified Version as stated in
5336 the previous sentence.
5338 J. Preserve the network location, if any, given in the Document
5339 for public access to a Transparent copy of the Document, and
5340 likewise the network locations given in the Document for
5341 previous versions it was based on. These may be placed in
5342 the "History" section. You may omit a network location for a
5343 work that was published at least four years before the
5344 Document itself, or if the original publisher of the version
5345 it refers to gives permission.
5347 K. For any section Entitled "Acknowledgements" or "Dedications",
5348 Preserve the Title of the section, and preserve in the
5349 section all the substance and tone of each of the contributor
5350 acknowledgements and/or dedications given therein.
5352 L. Preserve all the Invariant Sections of the Document,
5353 unaltered in their text and in their titles. Section numbers
5354 or the equivalent are not considered part of the section
5357 M. Delete any section Entitled "Endorsements". Such a section
5358 may not be included in the Modified Version.
5360 N. Do not retitle any existing section to be Entitled
5361 "Endorsements" or to conflict in title with any Invariant
5364 O. Preserve any Warranty Disclaimers.
5366 If the Modified Version includes new front-matter sections or
5367 appendices that qualify as Secondary Sections and contain no
5368 material copied from the Document, you may at your option
5369 designate some or all of these sections as invariant. To do this,
5370 add their titles to the list of Invariant Sections in the Modified
5371 Version's license notice. These titles must be distinct from any
5372 other section titles.
5374 You may add a section Entitled "Endorsements", provided it contains
5375 nothing but endorsements of your Modified Version by various
5376 parties--for example, statements of peer review or that the text
5377 has been approved by an organization as the authoritative
5378 definition of a standard.
5380 You may add a passage of up to five words as a Front-Cover Text,
5381 and a passage of up to 25 words as a Back-Cover Text, to the end
5382 of the list of Cover Texts in the Modified Version. Only one
5383 passage of Front-Cover Text and one of Back-Cover Text may be
5384 added by (or through arrangements made by) any one entity. If the
5385 Document already includes a cover text for the same cover,
5386 previously added by you or by arrangement made by the same entity
5387 you are acting on behalf of, you may not add another; but you may
5388 replace the old one, on explicit permission from the previous
5389 publisher that added the old one.
5391 The author(s) and publisher(s) of the Document do not by this
5392 License give permission to use their names for publicity for or to
5393 assert or imply endorsement of any Modified Version.
5395 5. COMBINING DOCUMENTS
5397 You may combine the Document with other documents released under
5398 this License, under the terms defined in section 4 above for
5399 modified versions, provided that you include in the combination
5400 all of the Invariant Sections of all of the original documents,
5401 unmodified, and list them all as Invariant Sections of your
5402 combined work in its license notice, and that you preserve all
5403 their Warranty Disclaimers.
5405 The combined work need only contain one copy of this License, and
5406 multiple identical Invariant Sections may be replaced with a single
5407 copy. If there are multiple Invariant Sections with the same name
5408 but different contents, make the title of each such section unique
5409 by adding at the end of it, in parentheses, the name of the
5410 original author or publisher of that section if known, or else a
5411 unique number. Make the same adjustment to the section titles in
5412 the list of Invariant Sections in the license notice of the
5415 In the combination, you must combine any sections Entitled
5416 "History" in the various original documents, forming one section
5417 Entitled "History"; likewise combine any sections Entitled
5418 "Acknowledgements", and any sections Entitled "Dedications". You
5419 must delete all sections Entitled "Endorsements."
5421 6. COLLECTIONS OF DOCUMENTS
5423 You may make a collection consisting of the Document and other
5424 documents released under this License, and replace the individual
5425 copies of this License in the various documents with a single copy
5426 that is included in the collection, provided that you follow the
5427 rules of this License for verbatim copying of each of the
5428 documents in all other respects.
5430 You may extract a single document from such a collection, and
5431 distribute it individually under this License, provided you insert
5432 a copy of this License into the extracted document, and follow
5433 this License in all other respects regarding verbatim copying of
5436 7. AGGREGATION WITH INDEPENDENT WORKS
5438 A compilation of the Document or its derivatives with other
5439 separate and independent documents or works, in or on a volume of
5440 a storage or distribution medium, is called an "aggregate" if the
5441 copyright resulting from the compilation is not used to limit the
5442 legal rights of the compilation's users beyond what the individual
5443 works permit. When the Document is included in an aggregate, this
5444 License does not apply to the other works in the aggregate which
5445 are not themselves derivative works of the Document.
5447 If the Cover Text requirement of section 3 is applicable to these
5448 copies of the Document, then if the Document is less than one half
5449 of the entire aggregate, the Document's Cover Texts may be placed
5450 on covers that bracket the Document within the aggregate, or the
5451 electronic equivalent of covers if the Document is in electronic
5452 form. Otherwise they must appear on printed covers that bracket
5453 the whole aggregate.
5457 Translation is considered a kind of modification, so you may
5458 distribute translations of the Document under the terms of section
5459 4. Replacing Invariant Sections with translations requires special
5460 permission from their copyright holders, but you may include
5461 translations of some or all Invariant Sections in addition to the
5462 original versions of these Invariant Sections. You may include a
5463 translation of this License, and all the license notices in the
5464 Document, and any Warranty Disclaimers, provided that you also
5465 include the original English version of this License and the
5466 original versions of those notices and disclaimers. In case of a
5467 disagreement between the translation and the original version of
5468 this License or a notice or disclaimer, the original version will
5471 If a section in the Document is Entitled "Acknowledgements",
5472 "Dedications", or "History", the requirement (section 4) to
5473 Preserve its Title (section 1) will typically require changing the
5478 You may not copy, modify, sublicense, or distribute the Document
5479 except as expressly provided under this License. Any attempt
5480 otherwise to copy, modify, sublicense, or distribute it is void,
5481 and will automatically terminate your rights under this License.
5483 However, if you cease all violation of this License, then your
5484 license from a particular copyright holder is reinstated (a)
5485 provisionally, unless and until the copyright holder explicitly
5486 and finally terminates your license, and (b) permanently, if the
5487 copyright holder fails to notify you of the violation by some
5488 reasonable means prior to 60 days after the cessation.
5490 Moreover, your license from a particular copyright holder is
5491 reinstated permanently if the copyright holder notifies you of the
5492 violation by some reasonable means, this is the first time you have
5493 received notice of violation of this License (for any work) from
5494 that copyright holder, and you cure the violation prior to 30 days
5495 after your receipt of the notice.
5497 Termination of your rights under this section does not terminate
5498 the licenses of parties who have received copies or rights from
5499 you under this License. If your rights have been terminated and
5500 not permanently reinstated, receipt of a copy of some or all of
5501 the same material does not give you any rights to use it.
5503 10. FUTURE REVISIONS OF THIS LICENSE
5505 The Free Software Foundation may publish new, revised versions of
5506 the GNU Free Documentation License from time to time. Such new
5507 versions will be similar in spirit to the present version, but may
5508 differ in detail to address new problems or concerns. See
5509 `http://www.gnu.org/copyleft/'.
5511 Each version of the License is given a distinguishing version
5512 number. If the Document specifies that a particular numbered
5513 version of this License "or any later version" applies to it, you
5514 have the option of following the terms and conditions either of
5515 that specified version or of any later version that has been
5516 published (not as a draft) by the Free Software Foundation. If
5517 the Document does not specify a version number of this License,
5518 you may choose any version ever published (not as a draft) by the
5519 Free Software Foundation. If the Document specifies that a proxy
5520 can decide which future versions of this License can be used, that
5521 proxy's public statement of acceptance of a version permanently
5522 authorizes you to choose that version for the Document.
5526 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
5527 World Wide Web server that publishes copyrightable works and also
5528 provides prominent facilities for anybody to edit those works. A
5529 public wiki that anybody can edit is an example of such a server.
5530 A "Massive Multiauthor Collaboration" (or "MMC") contained in the
5531 site means any set of copyrightable works thus published on the MMC
5534 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
5535 license published by Creative Commons Corporation, a not-for-profit
5536 corporation with a principal place of business in San Francisco,
5537 California, as well as future copyleft versions of that license
5538 published by that same organization.
5540 "Incorporate" means to publish or republish a Document, in whole or
5541 in part, as part of another Document.
5543 An MMC is "eligible for relicensing" if it is licensed under this
5544 License, and if all works that were first published under this
5545 License somewhere other than this MMC, and subsequently
5546 incorporated in whole or in part into the MMC, (1) had no cover
5547 texts or invariant sections, and (2) were thus incorporated prior
5548 to November 1, 2008.
5550 The operator of an MMC Site may republish an MMC contained in the
5551 site under CC-BY-SA on the same site at any time before August 1,
5552 2009, provided the MMC is eligible for relicensing.
5555 ADDENDUM: How to use this License for your documents
5556 ====================================================
5558 To use this License in a document you have written, include a copy of
5559 the License in the document and put the following copyright and license
5560 notices just after the title page:
5562 Copyright (C) YEAR YOUR NAME.
5563 Permission is granted to copy, distribute and/or modify this document
5564 under the terms of the GNU Free Documentation License, Version 1.3
5565 or any later version published by the Free Software Foundation;
5566 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
5567 Texts. A copy of the license is included in the section entitled ``GNU
5568 Free Documentation License''.
5570 If you have Invariant Sections, Front-Cover Texts and Back-Cover
5571 Texts, replace the "with...Texts." line with this:
5573 with the Invariant Sections being LIST THEIR TITLES, with
5574 the Front-Cover Texts being LIST, and with the Back-Cover Texts
5577 If you have Invariant Sections without Cover Texts, or some other
5578 combination of the three, merge those two alternatives to suit the
5581 If your document contains nontrivial examples of program code, we
5582 recommend releasing these examples in parallel under your choice of
5583 free software license, such as the GNU General Public License, to
5584 permit their use in free software.
5587 File: tar.info, Node: Index of Command Line Options, Next: Index, Prev: GNU Free Documentation License, Up: Top
5589 Appendix H Index of Command Line Options
5590 ****************************************
5592 This appendix contains an index of all GNU `tar' long command line
5593 options. The options are listed without the preceding double-dash. For
5594 a cross-reference of short command line options, see *note Short Option
5600 * --keep-directory-symlink, summary: Option Summary. (line 377)
5601 * absolute-names: absolute. (line 10)
5602 * absolute-names, summary: Option Summary. (line 6)
5603 * add-file: files. (line 60)
5604 * after-date: after. (line 24)
5605 * after-date, summary: Option Summary. (line 13)
5606 * anchored: controlling pattern-matching.
5608 * anchored, summary: Option Summary. (line 16)
5609 * append <1>: appending files. (line 6)
5610 * append: append. (line 6)
5611 * append, summary: Operation Summary. (line 6)
5612 * atime-preserve: Attributes. (line 10)
5613 * atime-preserve, summary: Option Summary. (line 20)
5614 * auto-compress: gzip. (line 155)
5615 * auto-compress, summary: Option Summary. (line 66)
5616 * backup: backup. (line 41)
5617 * backup, summary: Option Summary. (line 72)
5618 * block-number: verbose. (line 115)
5619 * block-number, summary: Option Summary. (line 77)
5620 * blocking-factor: Blocking Factor. (line 8)
5621 * blocking-factor, summary: Option Summary. (line 83)
5622 * bzip2, summary: Option Summary. (line 88)
5623 * catenate: concatenate. (line 6)
5624 * catenate, summary: Operation Summary. (line 10)
5625 * check-device, described: Incremental Dumps. (line 108)
5626 * check-device, summary: Option Summary. (line 93)
5627 * check-links, described: hard links. (line 31)
5628 * check-links, summary: Option Summary. (line 144)
5629 * checkpoint: checkpoints. (line 6)
5630 * checkpoint, defined: checkpoints. (line 13)
5631 * checkpoint, summary: Option Summary. (line 98)
5632 * checkpoint-action: checkpoints. (line 6)
5633 * checkpoint-action, defined: checkpoints. (line 22)
5634 * checkpoint-action, summary: Option Summary. (line 106)
5635 * compare: compare. (line 6)
5636 * compare, summary: Operation Summary. (line 14)
5637 * compress: gzip. (line 113)
5638 * compress, summary: Option Summary. (line 153)
5639 * concatenate: concatenate. (line 6)
5640 * concatenate, summary: Operation Summary. (line 20)
5641 * confirmation, summary: Option Summary. (line 160)
5642 * create, additional options: create options. (line 6)
5643 * create, complementary notes: Basic tar. (line 11)
5644 * create, introduced: Creating the archive.
5646 * create, summary: Operation Summary. (line 25)
5647 * create, using with --verbose: create verbose. (line 6)
5648 * create, using with --verify: verify. (line 24)
5649 * delay-directory-restore: Directory Modification Times and Permissions.
5651 * delay-directory-restore, summary: Option Summary. (line 163)
5652 * delete: delete. (line 6)
5653 * delete, summary: Operation Summary. (line 29)
5654 * delete, using before -append: append. (line 47)
5655 * dereference: dereference. (line 6)
5656 * dereference, summary: Option Summary. (line 168)
5657 * diff, summary: Operation Summary. (line 33)
5658 * directory: directory. (line 11)
5659 * directory, summary: Option Summary. (line 174)
5660 * exclude: exclude. (line 6)
5661 * exclude, potential problems with: problems with exclude.
5663 * exclude, summary: Option Summary. (line 181)
5664 * exclude-backups: exclude. (line 130)
5665 * exclude-backups, summary: Option Summary. (line 185)
5666 * exclude-caches: exclude. (line 153)
5667 * exclude-caches, summary: Option Summary. (line 193)
5668 * exclude-caches-all: exclude. (line 161)
5669 * exclude-caches-all, summary: Option Summary. (line 206)
5670 * exclude-caches-under: exclude. (line 157)
5671 * exclude-caches-under, summary: Option Summary. (line 200)
5672 * exclude-from: exclude. (line 6)
5673 * exclude-from, summary: Option Summary. (line 188)
5674 * exclude-ignore: exclude. (line 76)
5675 * exclude-ignore, summary: Option Summary. (line 210)
5676 * exclude-ignore-recursive: exclude. (line 81)
5677 * exclude-ignore-recursive, summary: Option Summary. (line 215)
5678 * exclude-tag: exclude. (line 170)
5679 * exclude-tag, summary: Option Summary. (line 220)
5680 * exclude-tag-all: exclude. (line 178)
5681 * exclude-tag-all, summary: Option Summary. (line 230)
5682 * exclude-tag-under: exclude. (line 174)
5683 * exclude-tag-under, summary: Option Summary. (line 225)
5684 * exclude-vcs: exclude. (line 85)
5685 * exclude-vcs, summary: Option Summary. (line 234)
5686 * exclude-vcs-ignores: exclude. (line 42)
5687 * exclude-vcs-ignores, summary: Option Summary. (line 240)
5688 * extract: extract. (line 6)
5689 * extract, additional options: extract options. (line 6)
5690 * extract, complementary notes: Basic tar. (line 48)
5691 * extract, summary: Operation Summary. (line 37)
5692 * extract, using with --listed-incremental: Incremental Dumps.
5694 * file: file. (line 6)
5695 * file, short description: file. (line 15)
5696 * file, summary: Option Summary. (line 248)
5697 * file, tutorial: file tutorial. (line 6)
5698 * files-from: files. (line 14)
5699 * files-from, summary: Option Summary. (line 254)
5700 * force-local, short description: Device. (line 70)
5701 * force-local, summary: Option Summary. (line 260)
5702 * format, summary: Option Summary. (line 265)
5703 * full-time, summary: Option Summary. (line 290)
5704 * get, summary: Operation Summary. (line 42)
5705 * group: override. (line 88)
5706 * group, summary: Option Summary. (line 308)
5707 * gunzip, summary: Option Summary. (line 316)
5708 * gzip: gzip. (line 91)
5709 * gzip, summary: Option Summary. (line 316)
5710 * hard-dereference, described: hard links. (line 59)
5711 * hard-dereference, summary: Option Summary. (line 324)
5712 * help: help tutorial. (line 6)
5713 * help, introduction: help. (line 26)
5714 * help, summary: Option Summary. (line 330)
5715 * ignore-case: controlling pattern-matching.
5717 * ignore-case, summary: Option Summary. (line 335)
5718 * ignore-command-error: Writing to an External Program.
5720 * ignore-command-error, summary: Option Summary. (line 339)
5721 * ignore-failed-read: Ignore Failed Read. (line 7)
5722 * ignore-failed-read, summary: Option Summary. (line 343)
5723 * ignore-zeros: Ignore Zeros. (line 6)
5724 * ignore-zeros, short description: Blocking Factor. (line 156)
5725 * ignore-zeros, summary: Option Summary. (line 347)
5726 * incremental, summary: Option Summary. (line 352)
5727 * incremental, using with --list: Incremental Dumps. (line 186)
5728 * index-file, summary: Option Summary. (line 359)
5729 * info-script: Multi-Volume Archives.
5731 * info-script, short description: Device. (line 122)
5732 * info-script, summary: Option Summary. (line 362)
5733 * interactive: interactive. (line 14)
5734 * interactive, summary: Option Summary. (line 370)
5735 * keep-newer-files: Keep Newer Files. (line 6)
5736 * keep-newer-files, summary: Option Summary. (line 390)
5737 * keep-old-files: Keep Old Files. (line 9)
5738 * keep-old-files, introduced: Dealing with Old Files.
5740 * keep-old-files, summary: Option Summary. (line 394)
5741 * label <1>: label. (line 6)
5742 * label: Tape Files. (line 6)
5743 * label, summary: Option Summary. (line 402)
5744 * level, described: Incremental Dumps. (line 76)
5745 * level, summary: Option Summary. (line 409)
5746 * list: list. (line 6)
5747 * list, summary: Operation Summary. (line 46)
5748 * list, using with --incremental: Incremental Dumps. (line 186)
5749 * list, using with --listed-incremental: Incremental Dumps. (line 186)
5750 * list, using with --verbose: list. (line 30)
5751 * list, using with file name arguments: list. (line 68)
5752 * listed-incremental, described: Incremental Dumps. (line 14)
5753 * listed-incremental, summary: Option Summary. (line 419)
5754 * listed-incremental, using with --extract: Incremental Dumps.
5756 * listed-incremental, using with --list: Incremental Dumps. (line 186)
5757 * lzip: gzip. (line 104)
5758 * lzip, summary: Option Summary. (line 427)
5759 * lzma: gzip. (line 107)
5760 * lzma, summary: Option Summary. (line 431)
5761 * lzop: gzip. (line 110)
5762 * mode: override. (line 14)
5763 * mode, summary: Option Summary. (line 439)
5764 * mtime: override. (line 29)
5765 * mtime, summary: Option Summary. (line 445)
5766 * multi-volume: Multi-Volume Archives.
5768 * multi-volume, short description: Device. (line 88)
5769 * multi-volume, summary: Option Summary. (line 454)
5770 * new-volume-script: Multi-Volume Archives.
5772 * new-volume-script, short description: Device. (line 122)
5773 * new-volume-script, summary: Option Summary. (line 362)
5774 * newer: after. (line 24)
5775 * newer, summary: Option Summary. (line 462)
5776 * newer-mtime: after. (line 35)
5777 * newer-mtime, summary: Option Summary. (line 470)
5778 * no-anchored: controlling pattern-matching.
5780 * no-anchored, summary: Option Summary. (line 475)
5781 * no-auto-compress, summary: Option Summary. (line 479)
5782 * no-check-device, described: Incremental Dumps. (line 104)
5783 * no-check-device, summary: Option Summary. (line 483)
5784 * no-delay-directory-restore: Directory Modification Times and Permissions.
5786 * no-delay-directory-restore, summary: Option Summary. (line 488)
5787 * no-ignore-case: controlling pattern-matching.
5789 * no-ignore-case, summary: Option Summary. (line 494)
5790 * no-ignore-command-error: Writing to an External Program.
5792 * no-ignore-command-error, summary: Option Summary. (line 497)
5793 * no-null, described: nul. (line 15)
5794 * no-null, summary: Option Summary. (line 501)
5795 * no-overwrite-dir, summary: Option Summary. (line 506)
5796 * no-quote-chars, summary: Option Summary. (line 510)
5797 * no-recursion: recurse. (line 11)
5798 * no-recursion, summary: Option Summary. (line 515)
5799 * no-same-owner: Attributes. (line 63)
5800 * no-same-owner, summary: Option Summary. (line 519)
5801 * no-same-permissions, summary: Option Summary. (line 525)
5802 * no-seek, summary: Option Summary. (line 530)
5803 * no-unquote: Selecting Archive Members.
5805 * no-unquote, summary: Option Summary. (line 535)
5806 * no-wildcards: controlling pattern-matching.
5808 * no-wildcards, summary: Option Summary. (line 539)
5809 * no-wildcards-match-slash: controlling pattern-matching.
5811 * no-wildcards-match-slash, summary: Option Summary. (line 542)
5812 * null, described: nul. (line 11)
5813 * null, summary: Option Summary. (line 545)
5814 * numeric-owner: Attributes. (line 69)
5815 * numeric-owner, summary: Option Summary. (line 551)
5816 * occurrence, described: append. (line 34)
5817 * occurrence, summary: Option Summary. (line 568)
5818 * old-archive, summary: Option Summary. (line 582)
5819 * one-file-system: one. (line 14)
5820 * one-file-system, summary: Option Summary. (line 585)
5821 * one-top-level, summary: Option Summary. (line 590)
5822 * overwrite: Overwrite Old Files. (line 6)
5823 * overwrite, introduced: Dealing with Old Files.
5825 * overwrite, summary: Option Summary. (line 601)
5826 * overwrite-dir: Overwrite Old Files. (line 28)
5827 * overwrite-dir, introduced: Dealing with Old Files.
5829 * overwrite-dir, summary: Option Summary. (line 605)
5830 * owner: override. (line 57)
5831 * owner, summary: Option Summary. (line 609)
5832 * pax-option: PAX keywords. (line 6)
5833 * pax-option, summary: Option Summary. (line 617)
5834 * portability, summary: Option Summary. (line 623)
5835 * posix, summary: Option Summary. (line 627)
5836 * preserve: Attributes. (line 122)
5837 * preserve, summary: Option Summary. (line 630)
5838 * preserve-order: Same Order. (line 6)
5839 * preserve-order, summary: Option Summary. (line 634)
5840 * preserve-permissions: Setting Access Permissions.
5842 * preserve-permissions, short description: Attributes. (line 109)
5843 * preserve-permissions, summary: Option Summary. (line 637)
5844 * quote-chars, summary: Option Summary. (line 647)
5845 * quoting-style: quoting styles. (line 38)
5846 * quoting-style, summary: Option Summary. (line 651)
5847 * read-full-records <1>: read full records. (line 6)
5848 * read-full-records: Reading. (line 6)
5849 * read-full-records, short description: Blocking Factor. (line 172)
5850 * read-full-records, summary: Option Summary. (line 658)
5851 * record-size, summary: Option Summary. (line 663)
5852 * recursion: recurse. (line 22)
5853 * recursion, summary: Option Summary. (line 670)
5854 * recursive-unlink: Recursive Unlink. (line 6)
5855 * recursive-unlink, summary: Option Summary. (line 674)
5856 * remove-files: remove files. (line 6)
5857 * remove-files, summary: Option Summary. (line 679)
5858 * restrict, summary: Option Summary. (line 683)
5859 * rmt-command, summary: Option Summary. (line 688)
5860 * rsh-command: Device. (line 73)
5861 * rsh-command, summary: Option Summary. (line 692)
5862 * same-order: Same Order. (line 6)
5863 * same-order, summary: Option Summary. (line 696)
5864 * same-owner: Attributes. (line 44)
5865 * same-owner, summary: Option Summary. (line 704)
5866 * same-permissions: Setting Access Permissions.
5868 * same-permissions, short description: Attributes. (line 109)
5869 * same-permissions, summary: Option Summary. (line 637)
5870 * seek, summary: Option Summary. (line 713)
5871 * show-defaults: defaults. (line 6)
5872 * show-defaults, summary: Option Summary. (line 722)
5873 * show-omitted-dirs: verbose. (line 107)
5874 * show-omitted-dirs, summary: Option Summary. (line 734)
5875 * show-snapshot-field-ranges: Snapshot Files. (line 113)
5876 * show-snapshot-field-ranges, summary: Option Summary. (line 738)
5877 * show-stored-names: list. (line 60)
5878 * show-stored-names, summary: Option Summary. (line 743)
5879 * show-transformed-names: transform. (line 45)
5880 * show-transformed-names, summary: Option Summary. (line 743)
5881 * skip-old-files, introduced: Dealing with Old Files.
5883 * skip-old-files, summary: Option Summary. (line 751)
5884 * sort, summary: Option Summary. (line 763)
5885 * sparse: sparse. (line 22)
5886 * sparse, summary: Option Summary. (line 782)
5887 * sparse-version: sparse. (line 57)
5888 * sparse-version, summary: Option Summary. (line 787)
5889 * starting-file: Starting File. (line 6)
5890 * starting-file, summary: Option Summary. (line 792)
5891 * strip-components: transform. (line 25)
5892 * strip-components, summary: Option Summary. (line 798)
5893 * suffix: backup. (line 68)
5894 * suffix, summary: Option Summary. (line 807)
5895 * tape-length: Multi-Volume Archives.
5897 * tape-length, short description: Device. (line 96)
5898 * tape-length, summary: Option Summary. (line 811)
5899 * test-label: label. (line 35)
5900 * test-label, summary: Option Summary. (line 820)
5901 * to-command: Writing to an External Program.
5903 * to-command, summary: Option Summary. (line 824)
5904 * to-stdout: Writing to Standard Output.
5906 * to-stdout, summary: Option Summary. (line 828)
5907 * totals: verbose. (line 46)
5908 * totals, summary: Option Summary. (line 833)
5909 * touch <1>: Attributes. (line 33)
5910 * touch: Data Modification Times.
5912 * touch, summary: Option Summary. (line 838)
5913 * transform: transform. (line 74)
5914 * transform, summary: Option Summary. (line 844)
5915 * uncompress: gzip. (line 113)
5916 * uncompress, summary: Option Summary. (line 153)
5917 * ungzip: gzip. (line 91)
5918 * ungzip, summary: Option Summary. (line 316)
5919 * unlink-first: Unlink First. (line 6)
5920 * unlink-first, introduced: Dealing with Old Files.
5922 * unlink-first, summary: Option Summary. (line 864)
5923 * unquote: Selecting Archive Members.
5925 * unquote, summary: Option Summary. (line 870)
5926 * update <1>: how to update. (line 6)
5927 * update: update. (line 6)
5928 * update, summary: Operation Summary. (line 50)
5929 * usage: help. (line 53)
5930 * use-compress-program: gzip. (line 177)
5931 * use-compress-program, summary: Option Summary. (line 874)
5932 * utc, summary: Option Summary. (line 879)
5933 * verbose: verbose. (line 18)
5934 * verbose, introduced: verbose tutorial. (line 6)
5935 * verbose, summary: Option Summary. (line 883)
5936 * verbose, using with --create: create verbose. (line 6)
5937 * verbose, using with --list: list. (line 30)
5938 * verify, short description: verify. (line 8)
5939 * verify, summary: Option Summary. (line 890)
5940 * verify, using with --create: verify. (line 24)
5941 * version: help. (line 6)
5942 * version, summary: Option Summary. (line 895)
5943 * volno-file: Multi-Volume Archives.
5945 * volno-file, summary: Option Summary. (line 900)
5946 * warning, explained: warnings. (line 12)
5947 * warning, summary: Option Summary. (line 905)
5948 * wildcards: controlling pattern-matching.
5950 * wildcards, summary: Option Summary. (line 910)
5951 * wildcards-match-slash: controlling pattern-matching.
5953 * wildcards-match-slash, summary: Option Summary. (line 914)
5954 * xform: transform. (line 74)
5955 * xform, summary: Option Summary. (line 844)
5956 * xz: gzip. (line 96)
5957 * xz, summary: Option Summary. (line 917)