home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12461 < prev    next >
Encoding:
Text File  |  1992-08-15  |  3.1 KB  |  85 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!wupost!darwin.sura.net!mips!odin!fido!zola!zuni!anchor!olson
  3. From: olson@anchor.esd.sgi.com (Dave Olson)
  4. Subject: Re: help in understanding tape blocks: dd, bstream, tar
  5. Message-ID: <ok5q824@zuni.esd.sgi.com>
  6. Sender: news@zuni.esd.sgi.com (Net News)
  7. Organization:  Silicon Graphics, Inc.  Mountain View, CA
  8. References: <16hugoINNr9s@agate.berkeley.edu>
  9. Distribution: na
  10. Date: Sat, 15 Aug 92 20:24:47 GMT
  11. Lines: 72
  12.  
  13. In <16hugoINNr9s@agate.berkeley.edu> bartlett@violet.berkeley.edu (Paul Bartlett/Gary Shea;Lat 841;;;MV86) writes:
  14.  
  15. | Situation: Machines: Indigo, 4D70/GT  Running 4.0.5
  16. |            Tape drive (4D70/GT, from SGI): ARCHIVE: VIPER 150  21247-005 VP1
  17. |        Tape drive (ditto, from ANDATATO): EXABYTE: EXB-8200        2618
  18. |            Tape drive (Indigo, from SUN): ARCHIVE: VIPER 150  21531-004
  19. | The following happens on all three combinations.
  20. | What I'm trying to do:
  21. | use tar with bstream as per the bstream man page to make backups
  22. | and distribution tapes for customers to use.
  23.  
  24. The problem is that bstream defaults to 64Kbyte blocks if -b isn't
  25. used, and for non-tape devices, tar defaults to 20.  The net result
  26. is that bstream sees a 0 returned before tar quits having seen
  27. its internal end of archive record, so bstream prompts for an
  28. additional tape.  Specify the same blocking factor to tar and
  29. bstream, or at least make tar's blocksize a multiple of bstream's,
  30. and the problem will go away.
  31.  
  32. I.e., it isn't a bug, but a (subtle) user error.
  33.  
  34. By the way, I seldom see much advantage in using bstream with SCSI tape.
  35. SCSI tape does readahead typically when reading, and does double
  36. buffering in the tape drive with our driver.  Using bstream also
  37. makes error recovery more problematical.  In some cases, bstream
  38. will actually slow things down with SCSI, since there is more
  39. data movement going on.
  40.  
  41. Finally, you can see similar problems under 4.0 using just tar,
  42. if you specify a different blocking factor when reading than
  43. when writing, for similar reasons.  (tar gets a 0 read back from
  44. the tape driver before seeing the end-of-archive record, because
  45. of the way the buffering works.  I've thought of trying to special
  46. case this, but the way the buffering code is done in tar makes
  47. this less than clean, and may introduce some subtle bugs.)
  48.  
  49. | (1) tar cf - Mail | bstream -o/dev/tape
  50. | and then, I do
  51. | (2) bstream -i/dev/tape | tar tf -
  52. | and get a listing of most of my directory, then a message:
  53. | </dev/tape> Change tape and type RETURN or "quit":
  54. | and if I hit return, I get the rest of my directory, and the
  55. | message again.
  56. | If I try 
  57. | (3) tar t
  58. | directly, I get some of my directory (less than before), then 
  59. | a message
  60. | Change tape and press the Enter key:
  61. | and if I hit return, I get the rest of my directory.
  62. | If I do
  63. | (4) dd if=/dev/tape | tar tf -
  64. | *then* I get the whole directory. This also works if I put a 
  65. | bstream into the pipe.
  66. --
  67. Let no one tell me that silence gives consent,  |   Dave Olson
  68. because whoever is silent dissents.             |   Silicon Graphics, Inc.
  69.     Maria Isabel Barreno                        |   olson@sgi.com
  70.