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