SUMMARY: unable to read tar

From: John Tan <>
Date: Thu Nov 29 2001 - 19:34:14 EST
Thank you, all, for the many replies received.

Most pointed out that I had not noted that I had rewound the tape device
before trying to read from it, so my problem could have been because I was
not reading from the right point on the tape.  Good point (thanks,
everyone), but I had rewound the tape device so this was not the problem.

All the other suggestions clued me to the fact that I had misused my
blocking factors.

Some suggested that I used
	tar tbf 64 /dev/rmt/3cn
in order to match the "dd obs" factor of 32k.  Good suggestions, but
unfortunately, this did not work, because it does not match with the
blocking factor used when the tar was created.  The "b" flag of tar was
something I learnt through these suggestions, so the suggestions were
greatly appreciated.

A few suggested that I should use "dd if" and pipe that to tar in order to
reverse what I did to write the tar, but again, this did not work, possibly
because of my blocking factor mismatch when I created my tape.

Jay Lasser and Daniel Zhuang's suggestions were the most useful, pointing
out that I created the tar with a consistent blocking factor in order to
read it it.  Jay's was the more comprehensive of these replies, so copying
his relevant points below.  (Thanks, heaps, Jay.)

One thing (at least) is that you need to match the block sizes.
If we leave the dd as is (just to pick one):

    ssh <remote_host> tar cbvf 64 - /directory/on/remote/host |dd obs=32k


    tar tbf 64 /dev/rmt/3cn

64x512 = 32k.

Arguably optimum (biggest block size likely to work across a broad
range of driver/drive/controller variants):

    ssh <remote_host> tar cbvf 126 - /directory/on/remote/host |dd obs=63k
    tar tbf 126 /dev/rmt/3cn

The default block size for tar is 20 (10k).

>  -----Original Message-----
> From: 	John Tan  
> Sent:	Friday, November 30, 2001 9:15 AM
> To:
> Subject:	unable to read tar
> G'morning, Sun-Managers
> I wrote a tape using
> 	ssh <remote_host> tar cvf - /directory/on/remote/host |dd obs=32k
> of=/dev/rmt/3cn
> I could see the light on the tape drive flickering every so often and I
> could see the files listed as they were written to tape.  
> When the job finished I did a 
> 	tar tf /dev/rmt/3cn
> to get the error that
> 	tar: tape read error
> Thinking that it could be a faulty tape (even though I had used a new
> one), I tried again on another new tape, and got the same results.
> Am I doing something wrong?  Any thoughts, anyone?
> Thanks.
Received on Fri Nov 30 00:34:14 2001

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:32:36 EDT