Can't cat tape- big blocks?

Boyd Roberts boyd at prl.dec.com
Fri Jun 14 19:48:22 AEST 1991


In article <803 at adpplz.UUCP>, martin at adpplz.UUCP (Martin Golding) writes:
> We got a 9 track tape in tar format, with 10k blocks. It's from a BSD type 
> system (at least, the tar headers match my sun manuals and tar from
> the Motorola doesn't work). The only tape drive we have is on one of
> the Motorola boxes, so what we figured was, we'd cat it to a file
> on the Motorola box and then rcp or rsh tar the puppy from the Sun.
> 
> When we cat it to a file (cat /dev/r50t >/dir/bigfile), it looks
> like we don't get all the data from the tape. We get the same effect
> if we rsh cat <the device>.

No, never do that.  With 9 track tapes you must do I/O that will
ensure that the _whole_ tape block will be read.  Odds on that cat(1)'s
blocksize is much less than 10k, and consequently each tape read
returns part of the tape block.  The tape will be positioned to
read the next _tape block_ and the stuff you didn't read is lost.

Now, from what I've seen, streamers don't behave like this.  But _all_
9 track UNIX tape drives do.  If you find one that doesn't -- it's broken.

So you want I/O's that are the same size as the tape block.  Use tar directly or:

   dd if=/dev/r50t bs=10k of=/dir/bigfile


Boyd Roberts			boyd at prl.dec.com

``When the going gets wierd, the weird turn pro...''
   



More information about the Comp.unix.questions mailing list