home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / tar.info-5 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  48.8 KB  |  1,184 lines

  1. This is Info file tar.info, produced by Makeinfo-1.64 from the input
  2. file /ade-src/fsf/tar/doc/tar.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * tar: (tar).            Making tape (or disk) archives.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents GNU `tar', a utility used to store, backup, and
  9. transport files.
  10.  
  11.    Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided that
  19. the entire resulting derived work is distributed under the terms of a
  20. permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions, except that this permission notice may be stated in a
  25. translation approved by the Foundation.
  26.  
  27. 
  28. File: tar.info,  Node: Checksumming Problems,  Prev: Old V7 and POSIX,  Up: Portability
  29.  
  30. Checksumming Problems
  31. ---------------------
  32.  
  33.    SunOS and HP-UX `tar' fail to accept archives created using GNU
  34. `tar' and containing non-ASCII file names, because they use signed
  35. checksums, while GNU `tar' uses unsigned checksums while creating
  36. archives, as per POSIX standards.  On reading, GNU `tar' computes both
  37. checksums and accept any.  It is somewhat worrying that a lot of people
  38. may go around doing backup of their files using faulty (or at least
  39. non-standard) software, not learning about it until it's time to
  40. restore their missing files with an incompatible file extractor, or vice
  41. versa.
  42.  
  43.    GNU `tar' is supposed to compute both checksums, signed and
  44. unsigned, and accept any.  However, 1.11.2 has a bug by which signed
  45. checksums are incorrectly initialized, so they do not work.  This is
  46. corrected in the subsequent GNU `tar' versions.  However, GNU `tar' has
  47. not been modified to *produce* incorrect archives to be read by buggy
  48. `tar''s.
  49.  
  50.    I've been told that when Sun first imported `tar' on their system,
  51. they recompiled it without realizing that the checksums were computed
  52. differently, because of a change in the default signing of `char''s in
  53. their compiler.  So they started computing checksums wrongly, and
  54. stayed compatible with themselves afterwards.  It now falls on the
  55. shoulders of SunOS and HP-UX users to get a `tar' able to read the good
  56. archives they receive.
  57.  
  58. 
  59. File: tar.info,  Node: Write Protection,  Prev: Portability,  Up: Being Careful
  60.  
  61. Write Protection
  62. ================
  63.  
  64.    All tapes and disks can be "write protected", to protect data on
  65. them from being changed.  Once an archive is written, you should write
  66. protect the media to prevent the archive from being accidently
  67. overwritten or deleted.  (This will protect the archive from being
  68. changed with a tape or floppy drive--it will not protect it from magnet
  69. fields or other physical hazards).
  70.  
  71.    The write protection device itself is usually an integral part of the
  72. physical media, and can be a two position (write enabled/write
  73. disabled) switch, a notch which can be popped out or covered, a ring
  74. which can be removed from the center of a tape reel, or some other
  75. changeable feature.
  76.  
  77. 
  78. File: tar.info,  Node: Format Control,  Next: Media,  Prev: Being Careful,  Up: Top
  79.  
  80. Controlling the Archive Format
  81. ******************************
  82.  
  83. * Menu:
  84.  
  85. * Attributes Options::
  86. * Type Options::
  87. * Compression::
  88. * Special Options for Archiving::
  89. * Archive Structure::
  90. * Modifiers Options::
  91.  
  92. 
  93. File: tar.info,  Node: Attributes Options,  Next: Type Options,  Prev: Format Control,  Up: Format Control
  94.  
  95. Handling of file attributes
  96. ===========================
  97.  
  98.      *(This message will disappear, once this node revised.)*
  99.  
  100.    Handling of file attributes
  101.  
  102. `--atime-preserve'
  103.      Do not change access times on dumped files.
  104.  
  105. `-m'
  106. `--modification-time'
  107.      Do not extract file modified time.
  108.  
  109.      When this option is used, `tar' leaves the modification times of
  110.      the files it extracts as the time when the files were extracted,
  111.      instead of setting it to the time recorded in the archive.
  112.  
  113.      This option is meaningless with `--list' (`-t').
  114.  
  115. `--same-owner'
  116.      Create extracted files with the same ownership.
  117.  
  118. `-p'
  119. `--same-permissions'
  120. `--preserve-permissions'
  121.      Extract all protection information.
  122.  
  123.      This option causes `tar' to set the modes (access permissions) of
  124.      extracted files exactly as recorded in the archive.  If this option
  125.      is not used, the current `umask' setting limits the permissions on
  126.      extracted files.
  127.  
  128.      This option is meaningless with `--list' (`-t').
  129.  
  130. `-s'
  131. `--same-order'
  132. `--preserve-order'
  133.      Sort names to extract to match archive.
  134.  
  135.      This option tells `tar' that the list of file names to be listed
  136.      or extracted is sorted in the same order as the files in the
  137.      archive.  This allows a large list of names to be used, even on a
  138.      small machine that would not otherwise be able to hold all the
  139.      names in memory at the same time.  Such a sorted list can easily
  140.      be created by running `tar -t' on the archive and editing its
  141.      output.
  142.  
  143.      This option is probably never needed on modern computer systems.
  144.  
  145. `--preserve'
  146.      Same as both `--same-permissions' (`-p') and `--same-order' (`-s').
  147.  
  148.      The `--preserve' option has no equivalent short option name.  It
  149.      is equivalent to `--same-permissions' (`-p') plus `--same-order'
  150.      (`-s').
  151.  
  152. 
  153. File: tar.info,  Node: Type Options,  Next: Compression,  Prev: Attributes Options,  Up: Format Control
  154.  
  155. Archive format selection
  156. ========================
  157.  
  158.      *(This message will disappear, once this node revised.)*
  159.  
  160.    Archive format selection
  161.  
  162. `-V NAME'
  163. `--label=NAME'
  164.      Create archive with volume name NAME.
  165.  
  166.      This option causes `tar' to write out a "volume header" at the
  167.      beginning of the archive.  If `--multi-volume' (`-M') is used, each
  168.      volume of the archive will have a volume header of `NAME Volume
  169.      N', where N is 1 for the first volume, 2 for the next, and so on.
  170.  
  171. `-z'
  172. `--gzip'
  173. `--ungzip'
  174.      Filter the archive through `gzip'.
  175.  
  176.      This option works on physical devices (tape drives, etc.) and
  177.      remote files as well as on normal files; data to or from such
  178.      devices or remote files is reblocked by another copy of the `tar'
  179.      program to enforce the specified (or default) block size.  The
  180.      default compression parameters are used; if you need to override
  181.      them, avoid the `--gzip' (`-z') option and run `gzip' explicitly.
  182.      (Or set the `GZIP' environment variable.)
  183.  
  184.      If the `--gzip' (`-z') option is given twice, or the
  185.      `--compress-blocks' option is used, `tar' will pad the archive out
  186.      to the next block boundary (
  187.      FIXME: pxref Blocking
  188.      ).  This may be useful with some devices that require that all
  189.      write operations be a multiple of a certain size.
  190.  
  191.      The `--gzip' (`-z') option does not work with the `--multi-volume'
  192.      (`-M') option, or with the `--update' (`-u'), `--append' (`-r'),
  193.      `--concatenate' (`-A'), or `--delete' commands.
  194.  
  195.      It is not exact to say that GNU `tar' is to work in concert with
  196.      `gzip' in a way similar to `zip', say.  Surely, it is possible
  197.      that `tar' and `gzip' be done with a single call, like in:
  198.  
  199.           tar cfz archive.tar.gz subdir
  200.  
  201.      to save all of `subdir' into a `gzip''ed archive.  Later you can
  202.      do:
  203.  
  204.           tar xfz archive.tar.gz
  205.  
  206.      to explode and unpack.
  207.  
  208.      The difference is that the whole archive is compressed.  With
  209.      `zip', archive members are archived individually.  `tar''s method
  210.      yields better compression.  On the other hand, one can view the
  211.      contents of a `zip' archive without having to decompress it.  As
  212.      for the `tar' and `gzip' tandem, you need to decompress the
  213.      archive to see its contents.  However, this may be done without
  214.      needing disk space, by using pipes internally:
  215.  
  216.           tar tfz archive.tar.gz
  217.  
  218.      About corrupted compressed archives: `gzip''ed files have no
  219.      redundancy, for maximum compression.  The adaptive nature of the
  220.      compression scheme means that the compression tables are implicitly
  221.      spread all over the archive.  If you lose a few blocks, the dynamic
  222.      construction of the compression tables becomes unsychronized, and
  223.      there is little chance that you could recover later in the archive.
  224.  
  225.      There are pending suggestions for having a per-volume or per-file
  226.      compression in GNU `tar'.  This would allow for viewing the
  227.      contents without decompression, and for resynchronizing
  228.      decompression at every volume or file, in case of corrupted
  229.      archives.  Doing so, we might loose some compressibility.  But
  230.      this would have make recovering easier.  So, there are pros and
  231.      cons.  We'll see!
  232.  
  233. `-Z'
  234. `--compress'
  235. `--uncompress'
  236.      Filter the archive through `compress'.  Otherwise like `--gzip'
  237.      (`-z').
  238.  
  239. `--use-compress-program=PROG'
  240.      Filter through PROG (must accept `-d').
  241.  
  242. 
  243. File: tar.info,  Node: Compression,  Next: Special Options for Archiving,  Prev: Type Options,  Up: Format Control
  244.  
  245. Using Less Space through Compression
  246. ====================================
  247.  
  248. * Menu:
  249.  
  250. * Compressed Archives::
  251. * Dealing with Compressed Archives::
  252. * Sparse Files::
  253.  
  254. 
  255. File: tar.info,  Node: Compressed Archives,  Next: Dealing with Compressed Archives,  Prev: Compression,  Up: Compression
  256.  
  257. Creating and Reading Compressed Archives
  258. ----------------------------------------
  259.  
  260.      *(This message will disappear, once this node revised.)*
  261.  
  262.    `--compress' (`-Z') indicates an archive stored in compressed format.
  263. The `--compress' (`-Z') option is useful in saving time over networks
  264. and space in pipes, and when storage space is at a premium.
  265. `--compress' (`-Z') causes `tar' to compress when writing the archive,
  266. or to uncompress when reading the archive.
  267.  
  268.    To perform compression and uncompression on the archive, `tar' runs
  269. the `compress' utility.  `tar' uses the default compression parameters;
  270. if you need to override them, avoid the `--compress' (`-Z') option and
  271. run the `compress' utility explicitly.  It is useful to be able to call
  272. the `compress' utility from within `tar' because the `compress' utility
  273. by itself cannot access remote tape drives.
  274.  
  275.    The `--compress' (`-Z') option will not work in conjunction with the
  276. `--multi-volume' (`-M') option or the `--append' (`-r'), `--update'
  277. (`-u'), `--append' (`-r') and `--delete' operations.
  278. FIXME: xref Modifying
  279.    , for more information on these operations.
  280.  
  281.    If there is no compress utility available, `tar' will report an
  282. error.
  283.  
  284.    `--compress-blocks' is like `--compress' (`-Z'), but when used in
  285. conjunction with `--create' (`-c') also causes `tar' to pad the last
  286. block of the archive out to the next block boundary as it is written.
  287. This is useful with certain devices which require all write operations
  288. be a multiple of a specific size.
  289.  
  290.      *Please Note:* The `compress' program may be covered by a patent,
  291.      and therefore we recommend you stop using it.  We hope to have a
  292.      different compress program in the future.  We may change the name
  293.      of this option at that time.
  294.  
  295. `--compress'
  296. `--uncompress'
  297. `-z'
  298. `-Z'
  299.      When this option is specified, `tar' will compress (when writing
  300.      an archive), or uncompress (when reading an archive).  Used in
  301.      conjunction with the `--create' (`-c'), `--extract' (`-x'),
  302.      `--list' (`-t') and `--compare' (`-d') operations.
  303.  
  304. `--compress-block'
  305. `-z -z'
  306.      Acts like `--compress' (`-Z'), but pads the archive out to the
  307.      next block boundary as it is written when used in conjunction with
  308.      the `--create' (`-c') operation.
  309.  
  310. FIXME: why not use -Z instead of -z -z ?
  311.  
  312. 
  313. File: tar.info,  Node: Dealing with Compressed Archives,  Next: Sparse Files,  Prev: Compressed Archives,  Up: Compression
  314.  
  315. Dealing with Compressed Archives
  316. --------------------------------
  317.  
  318.      *(This message will disappear, once this node revised.)*
  319.  
  320.    You can have archives be compressed by using the `--gzip' (`-z')
  321. option.  This will arrange for `tar' to use the `gzip' program to be
  322. used to compress or uncompress the archive wren writing or reading it.
  323.  
  324.    To use the older, obsolete, `compress' program, use the `--compress'
  325. (`-Z') option.  The GNU Project recommends you not use `compress',
  326. because there is a patent covering the algorithm it uses.  Merely by
  327. running `compress' you could be sued for patent infringment.
  328.  
  329.    When using either `--gzip' (`-z') or `--compress' (`-Z'), `tar' does
  330. not do blocking (
  331. FIXME: pxref Blocking
  332.    ) correctly.  Use `--gzip-block' or `--compress-blocks' instead when
  333. using real tape drives.
  334.  
  335. 
  336. File: tar.info,  Node: Sparse Files,  Prev: Dealing with Compressed Archives,  Up: Compression
  337.  
  338. Archiving Sparse Files
  339. ----------------------
  340.  
  341.      *(This message will disappear, once this node revised.)*
  342.  
  343.    A file is sparse if it contains blocks of zeros whose existance is
  344. recorded, but that have no space allocated on disk.  When you specify
  345. the `--sparse' (`-S') option in conjunction with the `--create' (`-c')
  346. operation, `tar' tests all files for sparseness while archiving.  If
  347. `tar' finds a file to be sparse, it uses a sparse representation of the
  348. file in the archive.
  349. FIXME: xref Creating Archives
  350.    , for more information about creating archives.
  351.  
  352.    `--sparse' (`-S') is useful when archiving files, such as dbm files,
  353. likely to contain many nulls.  This option dramatically decreases the
  354. amount of space needed to store such an archive.
  355.  
  356.      *Please Note:* Always use `--sparse' (`-S') when performing file
  357.      system backups, to avoid archiving the expanded forms of files
  358.      stored sparsely in the system.
  359.  
  360.      Even if your system has no no sparse files currently, some may be
  361.      created in the future.  If you use `--sparse' (`-S') while making
  362.      file system backups as a matter of course, you can be assured the
  363.      archive will always take no more space on the media than the files
  364.      take on disk (otherwise, archiving a disk filled with sparse files
  365.      might take hundreds of tapes).
  366.      FIXME: xref incremental when node name is set.
  367.  
  368.    `tar' ignores the `--sparse' (`-S') option when reading an archive.
  369.  
  370. `--sparse'
  371. `-S'
  372.      Files stored sparsely in the file system are represented sparsely
  373.      in the archive.  Use in conjunction with write operations.
  374.  
  375. 
  376. File: tar.info,  Node: Special Options for Archiving,  Next: Archive Structure,  Prev: Compression,  Up: Format Control
  377.  
  378. Special Options for Archiving
  379. =============================
  380.  
  381.      *(This message will disappear, once this node revised.)*
  382.  
  383.    To give the archive a name which will be recorded in it, use the
  384. `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option.  This will write a
  385. special record identifying VOLUME-LABEL as the name of the archive to
  386. the front of the archive which will be displayed when the archive is
  387. listed with `--list' (`-t').  If you are creating a multi-volume
  388. archive with `--multi-volume' (`-M') (
  389. FIXME: pxref Using Multiple Tapes
  390.    ), then the volume label will have `Volume NNN' appended to the name
  391. you give, where NNN is the number of the volume of the archive.  (If
  392. you use the `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option when
  393. reading an archive, it checks to make sure the label on the tape
  394. matches the one you give.
  395.  
  396. FIXME: xref Special Options for Archiving
  397.    .)
  398.  
  399.    Files in the filesystem occasionally have "holes."  A hole in a file
  400. is a section of the file's contents which was never written.  The
  401. contents of a hole read as all zeros.  On many operating systems,
  402. actualdisk storage is not allocated for holes, but they are counted in
  403. the length of the file.  If you archive such a file, `tar' could create
  404. an archive longer than the original.  To have `tar' attempt to
  405. recognize the holes in a file, use `--sparse' (`-S').  When you use the
  406. `--sparse' (`-S') option, then, for any file using less disk space than
  407. would be expected from its length, `tar' searches the file for
  408. consecutive stretches of zeros.  It then records in the archive for the
  409. file where the consecutive stretches of zeros are, and only archives the
  410. "real contents" of the file.  On extraction (using `--sparse' (`-S') is
  411. not needed on extraction) any such files have hols created wherever the
  412. continuous stretches of zeros were found.  Thus, if you use `--sparse'
  413. (`-S'), `tar' archives won't take more space than the original.
  414.  
  415.    When `tar' reads files, this causes them to have the access times
  416. updated.  To have `tar' attempt to set the access times back to what
  417. they were before they were read, use the `--atime-preserve' option.
  418. This doesn't work for files that you don't own, unless you're root, and
  419. it doesn't interact with incremental dumps nicely (
  420. FIXME: pxref Making Backups
  421.    ), but it is good enough for some purposes.
  422.  
  423. 
  424. File: tar.info,  Node: Archive Structure,  Next: Modifiers Options,  Prev: Special Options for Archiving,  Up: Format Control
  425.  
  426. The Structure of an Archive
  427. ===========================
  428.  
  429.      *(This message will disappear, once this node revised.)*
  430.  
  431.    While an archive may contain many files, the archive itself is a
  432. single ordinary file.  Like any other file, an archive file can be
  433. written to a storage device such as a tape or disk, sent through a pipe
  434. or over a network, saved on the active file system, or even stored in
  435. another archive.  An archive file is not easy to read or manipulate
  436. without using the `tar' utility or Tar mode in Emacs.
  437.  
  438.    Physically, an archive consists of a series of file entries
  439. terminated by an end-of-archive entry, which consists of 512 zero
  440. bytes.  A file entry usually describes one of the files in the archive
  441. (an "archive member"), and consists of a file header and the contents
  442. of the file.  File headers contain file names and statistics, checksum
  443. information which `tar' uses to detect file corruption, and information
  444. about file types.
  445.  
  446.    More than archive member can have the same file name.  One way this
  447. situation can occur is if more than one version of a file has been
  448. stored in the archive.  For information about adding new versions of a
  449. file to an archive,
  450. FIXME: pxref Modifying
  451.    .
  452.  
  453.    In addition to entries describing archive members, an archive may
  454. contain entries which `tar' itself uses to store information.
  455.  
  456. FIXME: xref Archive Label
  457.    , for an example of such an archive entry.
  458.  
  459. 
  460. File: tar.info,  Node: Modifiers Options,  Prev: Archive Structure,  Up: Format Control
  461.  
  462. Operation mode modifiers
  463. ========================
  464.  
  465.      *(This message will disappear, once this node revised.)*
  466.  
  467.    Operation mode modifiers
  468.  
  469. `-W'
  470. `--verify'
  471.      Attempt to verify the archive after writing.
  472.  
  473.      This option causes `tar' to verify the archive after writing it.
  474.      Each volume is checked after it is written, and any discrepancies
  475.      are recorded on the standard error output.
  476.  
  477.      Verification requires that the archive be on a back-space-able
  478.      medium.  This means pipes, some cartridge tape drives, and some
  479.      other devices cannot be verified.
  480.  
  481. `--remove-files'
  482.      Remove files after adding them to the archive.
  483.  
  484. `-k'
  485. `--keep-old-files'
  486.      Do not overwrite existing files from archive.
  487.  
  488.      The `--keep-old-files' (`-k') option prevents `tar' from
  489.      over-writing existing files with files with the same name from the
  490.      archive.
  491.  
  492.      The `--keep-old-files' (`-k') option is meaningless with `--list'
  493.      (`-t').
  494.  
  495. `-S'
  496. `--sparse'
  497.      Handle sparse files efficiently.
  498.  
  499.      This option causes all files to be put in the archive to be tested
  500.      for sparseness, and handled specially if they are.  The `--sparse'
  501.      (`-S') option is useful when many `dbm' files, for example, are
  502.      being backed up.  Using this option dramatically decreases the
  503.      amount of space needed to store such a file.
  504.  
  505.      In later versions, this option may be removed, and the testing and
  506.      treatment of sparse files may be done automatically with any
  507.      special GNU options.  For now, it is an option needing to be
  508.      specified on the command line with the creation or updating of an
  509.      archive.
  510.  
  511. `-O'
  512. `--to-stdout'
  513.      Extract files to standard output.
  514.  
  515.      When this option is used, instead of creating the files specified,
  516.      `tar' writes the contents of the files extracted to its standard
  517.      output.  This may be useful if you are only extracting the files in
  518.      order to send them through a pipe.
  519.  
  520.      This option is meaningless with `--list' (`-t').
  521.  
  522. `--ignore-failed-read'
  523.      Do not exit with non-zero on unreadable files.
  524.  
  525. FIXME: This section needs to be written
  526.  
  527.    *To come:* using Unix file linking capability to recreate directory
  528. structures--linking files into one subdirectory and then `tar'ring that
  529. directory.
  530.  
  531.    *to come:* nice hairy example using absolute-names, newer, etc.
  532.  
  533.    Piping one `tar' to another is an easy way to copy a directory's
  534. contents from one disk to another, while preserving the dates, modes,
  535. owners and link-structure of all the files therein.
  536.  
  537.      cd sourcedirectory; tar cf - . | (cd targetdir; tar xf -)
  538.  
  539. or
  540.  
  541. FIXME: the following using standard input/output correct??
  542.  
  543.      cd sourcedirectory; tar --create --file=- . | (cd targetdir; tar --extract --file=-)
  544.  
  545. Archive files can be used for transporting a group of files from one
  546. system to another:  put all relevant files into an archive on one
  547. computer system, transfer the archive to another, and extract the
  548. contents there. The basic transfer medium might be magnetic tape,
  549. Internet FTP, or even electronic mail (though you must encode the
  550. archive with `uuencode' in order to transport it properly by mail).
  551. Both machines do not have to use the same operating system, as long as
  552. they both support the `tar' program.
  553. FIXME: mention uuencode on a paragraph of its own
  554.  
  555. FIXME: end construction
  556.  
  557. 
  558. File: tar.info,  Node: Media,  Next: Backups and Restoration,  Prev: Format Control,  Up: Top
  559.  
  560. Tapes and Other Archive Media
  561. *****************************
  562.  
  563.      *(This message will disappear, once this node revised.)*
  564.  
  565.    A few special cases about tape handling warrant more detailed
  566. description.  These special cases are discussed below.
  567.  
  568.    Many complexities surround the use of `tar' on tape drives.  Since
  569. the creation and manipulation of archives located on magnetic tape was
  570. the original purpose of `tar', it contains many features making such
  571. manipulation easier.
  572.  
  573.    Archives are usually written on dismountable media--tape cartridges,
  574. mag tapes, or floppy disks.
  575.  
  576.    The amount of data a tape or disk holds depends not only on its size,
  577. but also on how it is formatted.  A 2400 foot long reel of mag tape
  578. holds 40 megabytes of data when formated at 1600 bits per inch.  The
  579. physically smaller EXABYTE tape cartridge holds 2.3 gigabytes.
  580.  
  581.    Magnetic media are re-usable--once the archive on a tape is no longer
  582. needed, the archive can be erased and the tape or disk used over.
  583. Media quality does deteriorate with use, however.  Most tapes or disks
  584. should be disgarded when they begin to produce data errors.  EXABYTE
  585. tape cartridges should be disgarded when they generate an "error count"
  586. (number of non-usable bits) of more than 10k.
  587.  
  588.    Magnetic media are written and erased using magnetic fields, and
  589. should be protected from such fields to avoid damage to stored data.
  590. Sticking a floppy disk to a filing cabinet using a magnet is probably
  591. not a good idea.
  592.  
  593. * Menu:
  594.  
  595. * Device::
  596. * Blocking::
  597. * Many::
  598. * Using Multiple Tapes::
  599. * Archive Label::
  600.  
  601. 
  602. File: tar.info,  Node: Device,  Next: Blocking,  Prev: Media,  Up: Media
  603.  
  604. Device selection and switching
  605. ==============================
  606.  
  607.      *(This message will disappear, once this node revised.)*
  608.  
  609. `-f [HOSTNAME:]FILE'
  610. `--file=[HOSTNAME:]FILE'
  611.      Use archive file or device FILE on HOSTNAME.
  612.  
  613.      This option is used to specify the file name of the archive `tar'
  614.      works on.
  615.  
  616.      If the file name is `-', `tar' reads the archive from standard
  617.      input (when listing or extracting), or writes it to standard output
  618.      (when creating).  If the `-' file name is given when updating an
  619.      archive, `tar' will read the original archive from its standard
  620.      input, and will write the entire new archive to its standard
  621.      output.
  622.  
  623.      If the file name contains a `:', it is interpreted as
  624.      `hostname:filename'.  If the HOSTNAME contains an "at" sign (`@'),
  625.      it is treated as `user@hostname:filename'.  In either case, `tar'
  626.      will invoke the command `rsh' (or `remsh') to start up an
  627.      `/etc/rmt' on the remote machine.  If you give an alternate login
  628.      name, it will be given to the `rsh'.  Naturally, the remote
  629.      machine must have an executable `/etc/rmt'.  This program is free
  630.      software from the University of California, and a copy of the
  631.      source code can be found with the sources for `tar'; it's compiled
  632.      and installed by default.
  633.  
  634.      If this option is not given, but the environment variable `TAPE' is
  635.      set, its value is used; otherwise, old versions of `tar' used a
  636.      default archive name (which was picked when `tar' was compiled).
  637.      The default is normally set up to be the "first" tape drive or
  638.      other transportable I/O medium on the system.
  639.  
  640.      Starting with version 1.11.5, GNU `tar' uses standard input and
  641.      standard output as the default device, and I will not try anymore
  642.      supporting automatic device detection at installation time.  This
  643.      was failing really in too many cases, it was hopeless.  This is now
  644.      completely left to the installer to override standard input and
  645.      standard output for default device, if this seems preferrable to
  646.      him/her.  Further, I think *most* actual usages of `tar' are done
  647.      with pipes or disks, not really tapes, cartridges or diskettes.
  648.  
  649.      Some users think that using standard input and output is running
  650.      after trouble.  This could lead to a nasty surprise on your screen
  651.      if you forget to specify an output file name--especially if you
  652.      are going through a network or terminal server capable of
  653.      buffering large amounts of output.  We had so many bug reports in
  654.      that area of configuring default tapes automatically, and so many
  655.      contradicting requests, that we finally consider the problem to be
  656.      portably intractable.  We could of course use something like
  657.      `/dev/tape' as a default, but this is *also* running after various
  658.      kind of trouble, going from hung processes to accidental
  659.      destruction of real tapes.  After having seen all this mess, using
  660.      standard input and output as a default really sounds like the only
  661.      clean choice left, and a very useful one too.
  662.  
  663.      GNU `tar' reads and writes archive in blocks, I suspect this is the
  664.      main reason why block devices are preferred over character devices.
  665.      Most probably, block devices are more efficient too.  The installer
  666.      could also check for `DEFTAPE' in `<sys/mtio.h>'.
  667.  
  668. `--force-local'
  669.      Archive file is local even if it contains a colon.
  670.  
  671. `--rsh-command=COMMAND'
  672.      Use remote COMMAND instead of `rsh'.  This option exists so that
  673.      people who use something other than the standard `rsh' (e.g., a
  674.      Kerberized `rsh') can access a remote device.
  675.  
  676.      When this command is not used, the shell command found when the
  677.      `tar' program was installed is used instead.  This is the first
  678.      found of `/usr/ucb/rsh', `/usr/bin/remsh', `/usr/bin/rsh',
  679.      `/usr/bsd/rsh' or `/usr/bin/nsh'.  The installer may have
  680.      overriden this by defining the environment variable `RSH' *at
  681.      installation time*.
  682.  
  683. `-[0-7][lmh]'
  684.      Specify drive and density.
  685.  
  686. `-M'
  687. `--multi-volume'
  688.      Create/list/extract multi-volume archive.
  689.  
  690.      This option causes `tar' to write a "multi-volume" archive--one
  691.      that may be larger than will fit on the medium used to hold it.
  692.      FIXME: xref Multi
  693.      .
  694.  
  695. `-L NUM'
  696. `--tape-length=NUM'
  697.      Change tape after writing NUM x 1024 bytes.
  698.  
  699.      This option might be useful when your tape drivers do not properly
  700.      detect end of physical tapes.  By being slightly conservative on
  701.      the maximum tape length, you might avoid the problem entirely.
  702.  
  703. `-F FILE'
  704. `--info-script=FILE'
  705. `--new-volume-script=FILE'
  706.      Execute `file' at end of each tape.  This implies `--multi-volume'
  707.      (`-M').
  708.  
  709.    The Remote Tape Server
  710.  
  711.    In order to access the tape drive on a remote machine, `tar' uses
  712. the remote tape server written at the University of California at
  713. Berkeley.  The remote tape server must be installed as `/etc/rmt' on
  714. any machine whose tape drive you want to use.  `tar' calls `/etc/rmt'
  715. by running an `rsh' or `remsh' to the remote machine, optionally using
  716. a different login name if one is supplied.
  717.  
  718.    A copy of the source for the remote tape server is provided.  It is
  719. Copyright (C) 1983 by the Regents of the University of California, but
  720. can be freely distributed.  Instructions for compiling and installing
  721. it are included in the `Makefile'.
  722.  
  723.    Unless you use the {No Value For "absolue-names"} option, GNU `tar'
  724. will not allow you to create an archive that contains absolute file
  725. names (a file name beginning with `/'.) If you try, `tar' will
  726. automatically remove the leading `/' from the file names it stores in
  727. the archive.  It will also type a warning message telling you what it
  728. is doing.
  729.  
  730.    When reading an archive that was created with a different `tar'
  731. program, GNU `tar' automatically extracts entries in the archive which
  732. have absolute file names as if the file names were not absolute.  This
  733. is an important feature.  A visitor here once gave a `tar' tape to an
  734. operator to restore; the operator used Sun `tar' instead of GNU `tar',
  735. and the result was that it replaced large portions of our `/bin' and
  736. friends with versions from the tape; needless to say, we were unhappy
  737. about having to recover the file system from backup tapes.
  738.  
  739.    For example, if the archive contained a file `/usr/bin/computoy',
  740. GNU `tar' would extract the file to `usr/bin/computoy', relative to the
  741. current directory.  If you want to extract the files in an archive to
  742. the same absolute names that they had when the archive was created, you
  743. should do a `cd /' before extracting the files from the archive, or you
  744. should either use the `--absolute-names' (`-P') option, or use the
  745. command `tar -C / ...'.
  746.  
  747.    Some versions of Unix (Ultrix 3.1 is know to have this problem), can
  748. claim that a short write near the end of a tape succeeded, when it
  749. actually failed.  This will result in the -M option not working
  750. correctly.  The best workaround at the moment is to use a significantly
  751. larger blocksize than the default 20.
  752.  
  753.    In order to update an archive, `tar' must be able to backspace the
  754. archive in order to reread or rewrite a block that was just read (or
  755. written).  This is currently possible only on two kinds of files: normal
  756. disk files (or any other file that can be backspaced with `lseek'), and
  757. industry-standard 9-track magnetic tape (or any other kind of tape that
  758. can be backspaced with the `MTIOCTOP' `ioctl'.
  759.  
  760.    This means that the `--append' (`-r'), `--update' (`-u'),
  761. `--concatenate' (`-A'), and `--delete' commands will not work on any
  762. other kind of file.  Some media simply cannot be backspaced, which
  763. means these commands and options will never be able to work on them.
  764. These non-backspacing media include pipes and cartridge tape drives.
  765.  
  766.    Some other media can be backspaced, and `tar' will work on them once
  767. `tar' is modified to do so.
  768.  
  769.    Archives created with the `--multi-volume' (`-M'),
  770. `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL'), and `--incremental'
  771. (`-G') options may not be readable by other version of `tar'.  In
  772. particular, restoring a file that was split over a volume boundary will
  773. require some careful work with `dd', if it can be done at all.  Other
  774. versions of `tar' may also create an empty file whose name is that of
  775. the volume header.  Some versions of `tar' may create normal files
  776. instead of directories archived with the `--incremental' (`-G') option.
  777.  
  778.    Some Common Problems and their Solutions:
  779.  
  780. errors from system:
  781. permission denied
  782. no such file or directory
  783. not owner
  784.  
  785. errors from `tar':
  786. directory checksum error
  787. header format error
  788.  
  789. errors from media/system:
  790. i/o error
  791. device busy
  792.  
  793. 
  794. File: tar.info,  Node: Blocking,  Next: Many,  Prev: Device,  Up: Media
  795.  
  796. Blocking
  797. ========
  798.  
  799.      *(This message will disappear, once this node revised.)*
  800.  
  801.    When writing to tapes, `tar' writes the contents of the archive in
  802. chunks known as "blocks".  To change the default blocksize, use the
  803. `--block-size=512-SIZE' (`-b 512-SIZE') option.  Each block will then
  804. be composed of SIZE records.  (Each `tar' record is 512 bytes.
  805.  
  806. FIXME: xref Archive Format
  807.    .)  Each file written to the archive uses at least one full block.
  808. As a result, using a larger block size can result in more wasted space
  809. for small files.  On the other hand, a larger block size can ofter be
  810. read and written much more efficiently.
  811.  
  812.    Further complicating the problem is that some tape drives ignore the
  813. blocking entirely.  For these, a larger block size can still improve
  814. performance (because the software layers above the tape drive still
  815. honor the blocking), but not as dramatically as on tape drives that
  816. honor blocking.
  817.  
  818.    Wher reading an archive, `tar' can usually figure out the block size
  819. on itself.  When this is the case, and a non-standard block size was
  820. used when the archive was created, `tar' will print a message about a
  821. non-standard blocking factor, and then operate normally.  On some tape
  822. devices, however, `tar' cannot figure out the block size itself.  On
  823. most of those, you can specify a blocking factor (with
  824. `--block-size=512-SIZE' (`-b 512-SIZE')) larger than the actual
  825. blocking factor, and then use the `--read-full-blocks' (`-B') option.
  826. (If you specify a blocking factor with `--block-size=512-SIZE' (`-b
  827. 512-SIZE') and don't use the `--read-full-blocks' (`-B') option, then
  828. `tar' will not attempt to figure out the blocking size itself.)  On
  829. some devices, you must always specify the block size exactly with
  830. `--block-size=512-SIZE' (`-b 512-SIZE') when reading, because `tar'
  831. cannot figure it out.  In any case, use `--list' (`-t') before doing any
  832. extractions to see whether `tar' is reading the archive correctly.
  833.  
  834.    If you use a blocking factor larger than 20, older `tar' programs
  835. might not be able to read the archive, so we recommend this as a limit
  836. to use in practice.  GNU `tar', however, will support arbitrarily large
  837. block sizes, limited only by the amount of virtual memory or the
  838. physical characteristics of the tape device.
  839.  
  840.    If you are writing a compressed archive to tape with `--compress'
  841. (`-Z') or `--gzip' (`-z') (
  842. FIXME: pxref Input and Output
  843.    ), `tar' will not block the archive correctly.  This doesn't matter
  844. if you are writing the archive to a normal file or through a pipe, but
  845. if you are writing it to a tape drive, then this causes problems.  Use
  846. `--compress-blocks' or `--gzip-block' instead, to cause `tar' to
  847. arrange to have blocking work correctly.
  848.  
  849. * Menu:
  850.  
  851. * Format Variations::
  852. * Blocking Factor::
  853.  
  854. 
  855. File: tar.info,  Node: Format Variations,  Next: Blocking Factor,  Prev: Blocking,  Up: Blocking
  856.  
  857. Format Variations
  858. -----------------
  859.  
  860.      *(This message will disappear, once this node revised.)*
  861.  
  862.    Format parameters specify how an archive is written on the archive
  863. media.  The best choice of format parameters will vary depending on the
  864. type and number of files being archived, and on the media used to store
  865. the archive.
  866.  
  867.    To specify format parameters when accessing or creating an archive,
  868. you can use the options described in the following sections.  If you do
  869. not specify any format parameters, `tar' uses default parameters.  You
  870. cannot modify a compressed archive.  If you create an archive with the
  871. `--block-size=512-SIZE' (`-b 512-SIZE') option specified (
  872. FIXME: pxref Blocking
  873. Factor
  874.    ), you must specify that block-size when operating on the archive.
  875. FIXME: xref Matching Format Parameters
  876.    , for other examples of format parameter considerations.
  877.  
  878. 
  879. File: tar.info,  Node: Blocking Factor,  Prev: Format Variations,  Up: Blocking
  880.  
  881. The Blocking Factor of an Archive
  882. ---------------------------------
  883.  
  884.      *(This message will disappear, once this node revised.)*
  885.  
  886.    The data in an archive is grouped into records, which are 512 bytes.
  887. Records are read and written in whole number multiples called "blocks".
  888. The number of records in a block (ie. the size of a block in units of
  889. 512 bytes) is called the "blocking factor".  The
  890. `--block-size=512-SIZE' (`-b 512-SIZE') option specifies the blocking
  891. factor of an archive.  The default blocking factor is typically 20 (ie.
  892. 10240 bytes), but can be specified at installation.  To find out the
  893. blocking factor of an existing archive, use `tar --list
  894. --file=ARCHIVE-NAME'.  This may not work on some devices.
  895.  
  896.    Blocks are seperated by gaps, which waste space on the archive media.
  897. If you are archiving on magnetic tape, using a larger blocking factor
  898. (and therefore larger blocks) provides faster throughput and allows you
  899. to fit more data on a tape (because there are fewer gaps). If you are
  900. archiving on cartridge, a very large blocking factor (say 126 or more)
  901. greatly increases performance. A smaller blocking factor, on the other
  902. hand, may be usefull when archiving small files, to avoid archiving
  903. lots of nulls as `tar' fills out the archive to the end of the block.
  904. In general, the ideal block size depends on the size of the inter-block
  905. gaps on the tape you are using, and the average size of the files you
  906. are archiving.
  907. FIXME: xref Creating
  908. Archives
  909.    , for information on writing archives.
  910. FIXME: need example of using a cartridge with blocksize=126 or more
  911.  
  912.    Archives with blocking factors larger than 20 cannot be read by very
  913. old versions of `tar', or by some newer versions of `tar' running on
  914. old machines with small address spaces.  With GNU `tar', the blocking
  915. factor of an archive is limited only by the maximum block size of the
  916. device containing the archive, or by the amount of available virtual
  917. memory.
  918.  
  919.    If you use a non-default blocking factor when you create an archive,
  920. you must specify the same blocking factor when you modify that archive.
  921. Some archive devices will also require you to specify the blocking
  922. factor when reading that archive, however this is not typically the
  923. case.  Usually, you can use `--list' (`-t') without specifying a
  924. blocking factor--`tar' reports a non-default block size and then lists
  925. the archive members as it would normally.  To extract files from an
  926. archive with a non-standard blocking factor (particularly if you're not
  927. sure what the blocking factor is), you can usually use the
  928. `--read-full-blocks' (`-B') option while specifying a blocking factor
  929. larger then the blocking factor of the archive (ie. `tar --extract
  930. --read-full-blocks --block-size=300'.
  931. FIXME: xref Listing Contents
  932.  
  933.    for more information on the `--list' (`-t') operation.
  934.  
  935. FIXME: xref read-full-blocks
  936.    for a more detailed explanation of that option.
  937.  
  938. `--block-size=NUMBER'
  939. `-b NUMBER'
  940.      Specifies the blocking factor of an archive.  Can be used with any
  941.      operation, but is usually not necessary with `--list' (`-t').
  942.  
  943.    Device blocking
  944.  
  945. `-b BLOCKS'
  946. `--block-size=BLOCKS'
  947.      Set block size to BLOCKS * 512 bytes.
  948.  
  949.      This option is used to specify a "blocking factor" for the archive.
  950.      When reading or writing the archive, `tar', will do reads and
  951.      writes of the archive in blocks of BLOCK*512 bytes.
  952.  
  953.      The default blocking factor is set when `tar' is compiled, and is
  954.      typically 20.
  955.  
  956.      Blocking factors larger than 20 cannot be read by very old versions
  957.      of `tar', or by some newer versions of `tar' running on old
  958.      machines with small address spaces.
  959.  
  960.      With a magnetic tape, larger blocks give faster throughput and fit
  961.      more data on a tape (because there are fewer inter-record gaps).
  962.      If the archive is in a disk file or a pipe, you may want to specify
  963.      a smaller blocking factor, since a large one will result in a large
  964.      number of null bytes at the end of the archive.
  965.  
  966.      When writing cartridge or other streaming tapes, a much larger
  967.      blocking factor (say 126 or more) will greatly increase
  968.      performance.  However, you must specify the same blocking factor
  969.      when reading or updating the archive.
  970.  
  971.      With GNU `tar' the blocking factor is limited only by the maximum
  972.      block size of the device containing the archive, or by the amount
  973.      of available virtual memory.
  974.  
  975. `--block-compress'
  976.      Block the output of compression for tapes.
  977.  
  978. `-i'
  979. `--ignore-zeros'
  980.      Ignore blocks of zeros in archive (means EOF).
  981.  
  982.      The `--ignore-zeros' (`-i') option causes `tar' to ignore blocks
  983.      of zeros in the archive.  Normally a block of zeros indicates the
  984.      end of the archive, but when reading a damaged archive, or one
  985.      which was created by `cat'-ing several archives together, this
  986.      option allows `tar' to read the entire archive.  This option is
  987.      not on by default because many versions of `tar' write garbage
  988.      after the zeroed blocks.
  989.  
  990.      Note that this option causes `tar' to read to the end of the
  991.      archive file, which may sometimes avoid problems when multiple
  992.      files are stored on a single physical tape.
  993.  
  994. `-B'
  995. `--read-full-blocks'
  996.      Reblock as we read (for reading 4.2BSD pipes).
  997.  
  998.      If `--read-full-blocks' (`-B') is used, `tar' will not panic if an
  999.      attempt to read a block from the archive does not return a full
  1000.      block.  Instead, `tar' will keep reading until it has obtained a
  1001.      full block.
  1002.  
  1003.      This option is turned on by default when `tar' is reading an
  1004.      archive from standard input, or from a remote machine.  This is
  1005.      because on BSD Unix systems, a read of a pipe will return however
  1006.      much happens to be in the pipe, even if it is less than `tar'
  1007.      requested.  If this option was not used, `tar' would fail as soon
  1008.      as it read an incomplete block from the pipe.
  1009.  
  1010.      This option is also useful with the commands for updating an
  1011.      archive.
  1012.  
  1013.    Tape blocking
  1014.  
  1015. FIXME: Appropriate options should be moved here from elsewhere.
  1016.  
  1017.    When handling various tapes or cartridges, you have to take care of
  1018. selecting a proper blocking, that is, the number of disk blocks you put
  1019. together as a single tape block on the tape, without intervening tape
  1020. gaps.  A "tape gap" is a small landing area on the tape with no
  1021. information on it, used for decelerating the tape to a full stop, and
  1022. for later regaining the reading or writing speed.  When the driver
  1023. starts reading a tape block, the tape block has to be read whole
  1024. without stopping, as a tape gap is needed to stop the tape motion
  1025. without loosing information.
  1026.  
  1027.    Using higher blocking (putting more disk blocks per tape block) will
  1028. use the tape more efficiently as there will be less tape gaps.  But
  1029. reading such tapes may be more difficult for the system, as more memory
  1030. will be required to receive at once the whole block.  Further, if there
  1031. is a reading error on a huge tape block, this is less likely that the
  1032. system will succeed in recovering the information.  So, blocking should
  1033. not be too low, nor it should be too high.  `tar' uses by default a
  1034. blocking of 20 for historical reasons, and it does not really matter
  1035. when reading or writing to disk.  Current tape technology would easily
  1036. accomodate higher blockings.  Sun recommends a blocking of 126 for
  1037. Exabytes and 96 for DATs.  Other manufacturers may use different
  1038. recommendations for the same tapes.  This might also depends of the
  1039. buffering techniques used inside modern tape controllers.  Some imposes
  1040. a minimum blocking, or a maximum blocking.  Others request blocking to
  1041. be some exponent of two.
  1042.  
  1043.    So, there is no fixed rule for blocking.  But blocking at read time
  1044. should ideally be the same as blocking used at write time.  At one place
  1045. I know, with a wide variety of equipment, they found it best to use a
  1046. blocking of 32 to guarantee that their tapes are fully interchangeable.
  1047.  
  1048.    I was also told that, for recycled tapes, prior erasure (by the same
  1049. drive unit that will be used to create the archives) sometimes lowers
  1050. the error rates observed at rewriting time.
  1051.  
  1052. 
  1053. File: tar.info,  Node: Many,  Next: Using Multiple Tapes,  Prev: Blocking,  Up: Media
  1054.  
  1055. Many archives on one tape
  1056. =========================
  1057.  
  1058. FIXME: Appropriate options should be moved here from elsewhere.
  1059.  
  1060.    Most tape devices have two entries in the `/dev' directory, or
  1061. entries that come in pairs, which differ only in the minor number for
  1062. this device.  Let's take for example `/dev/tape', which often points to
  1063. the only or usual tape device of a given system.  There might be a
  1064. corresponding `/dev/nrtape' or `/dev/ntape'.  The simpler name is the
  1065. *rewinding* version of the device, while the name having `nr' in it is
  1066. the *no rewinding* version of the same device.
  1067.  
  1068.    A rewinding tape device will bring back the tape to its beginning
  1069. point automatically when this device is opened or closed.  Since `tar'
  1070. opens the archive file before using it and closes it afterwards, this
  1071. means that a simple:
  1072.  
  1073.      tar cf /dev/tape DIRECTORY
  1074.  
  1075. will reposition the tape to its beginning both prior and after saving
  1076. DIRECTORY contents to it, thus erasing prior tape contents and making
  1077. it so that any subsequent write operation will destroy what has just
  1078. been saved.
  1079.  
  1080.    So, a rewinding device is normally meant to hold one and only one
  1081. file.  If you want to put more than one `tar' archive on a given tape,
  1082. you will need to avoid using the rewinding version of the tape device.
  1083. You will also have to pay special attention to tape positioning.
  1084. Errors in positionning may overwrite the valuable data already on your
  1085. tape.  Many people, burnt by past experiences, will only use rewinding
  1086. devices and limit themselves to one file per tape, precisely to avoid
  1087. the risk of such errors.  Be fully aware that writing at the wrong
  1088. position on a tape loses all information past this point and most
  1089. probably until the end of the tape, and this destroyed information
  1090. *cannot* be recovered.
  1091.  
  1092.    To save DIRECTORY-1 as a first archive at the beginning of a tape,
  1093. and leave that tape ready for a second archive, you should use:
  1094.  
  1095.      mt -f /dev/nrtape rewind
  1096.      tar cf /dev/nrtape DIRECTORY-1
  1097.  
  1098.    "Tape marks" are special magnetic patterns written on the tape
  1099. media, which are later recognizable by the reading hardware.  These
  1100. marks are used after each file, when there are many on a single tape.
  1101. An empty file (that is to say, two tape marks in a row) signal the
  1102. logical end of the tape, after which no file exist.  Usually,
  1103. non-rewinding tape device drivers will react to the close request issued
  1104. by `tar' by first writing two tape marks after your archive, and by
  1105. backspacing over one of these.  So, if you remove the tape at that time
  1106. from the tape drive, it is properly terminated.  But if you write
  1107. another file at the current position, the second tape mark will be
  1108. erased by the new information, leaving only one tape mark between files.
  1109.  
  1110.    So, you may now save DIRECTORY-2 as a second archive after the first
  1111. on the same tape by issuing the command:
  1112.  
  1113.      tar cf /dev/nrtape DIRECTORY-2
  1114.  
  1115. and so on for all the archives you want to put on the same tape.
  1116.  
  1117.    Another usual case is that you do not write all the archives the same
  1118. day, and you need to remove and store the tape between two archive
  1119. sessions.  In general, you must remember how many files are already
  1120. saved on your tape.  Suppose your tape already has 16 files on it, and
  1121. that you are ready to write the 17th.  You have to take care of skipping
  1122. the first 16 tape marks before saving DIRECTORY-17, say, by using these
  1123. commands:
  1124.  
  1125.      mt -f /dev/nrtape rewind
  1126.      mt -f /dev/nrtape fsf 16
  1127.      tar cf /dev/nrtape DIRECTORY-17
  1128.  
  1129.    In all the previous examples, we put aside blocking considerations,
  1130. but you should do the proper things for that as well.
  1131. FIXME: xref Blocking
  1132.    .
  1133.  
  1134. * Menu:
  1135.  
  1136. * Tape Positioning::
  1137. * mt::
  1138.  
  1139. 
  1140. File: tar.info,  Node: Tape Positioning,  Next: mt,  Prev: Many,  Up: Many
  1141.  
  1142. Tape Positions and Tape Marks
  1143. -----------------------------
  1144.  
  1145.      *(This message will disappear, once this node revised.)*
  1146.  
  1147.    Just as archives can store more than one file from the file system,
  1148. tapes can store more than one archive file.  To keep track of where
  1149. archive files (or any other type of file stored on tape) begin and end,
  1150. tape archive devices write magnetic "tape marks" on the archive media.
  1151. Tape drives write one tape mark between files, two at the end of all
  1152. the file entries.
  1153.  
  1154.    If you think of data as a series of "0000"'s, and tape marks as
  1155. "x"'s, a tape might look like the following:
  1156.  
  1157.      0000x000000x00000x00x00000xx-------------------------
  1158.  
  1159.    Tape devices read and write tapes using a read/write "tape head"--a
  1160. physical part of the device which can only access one point on the tape
  1161. at a time.  When you use `tar' to read or write archive data from a
  1162. tape device, the device will begin reading or writing from wherever on
  1163. the tape the tape head happens to be, regardless of which archive or
  1164. what part of the archive the tape head is on.  Before writing an
  1165. archive, you should make sure that no data on the tape will be
  1166. overwritten (unless it is no longer needed).  Before reading an
  1167. archive, you should make sure the tape head is at the beginning of the
  1168. archive you want to read.  (The `restore' script will find the archive
  1169. automatically.
  1170. FIXME: xref Scripted
  1171. Restoration
  1172.    ).
  1173. FIXME: xref mt
  1174.    , for an explanation of the tape moving utility.
  1175.  
  1176.    If you want to add new archive file entries to a tape, you should
  1177. advance the tape to the end of the existing file entries, backspace
  1178. over the last tape mark, and write the new archive file.  If you were
  1179. to add two archives to the example above, the tape might look like the
  1180. following:
  1181.  
  1182.      0000x000000x00000x00x00000x000x0000xx----------------
  1183.  
  1184.