1832759 Members
2973 Online
110045 Solutions
New Discussion

Re: Tar: tape error (5)

 
Jim Mallett
Honored Contributor

Tar: tape error (5)

Anytime I try to read from a DDS tape I recieve the "Tar: tape error (5)" error message.

I know the tape and drive are OK because I've read the tape in 3 other machines. I swapped the drive out with another of the same model that I know works and the same error occured.
I have another machine using the same model DDS and the same STAPE driver without issue. The only thing I can come up with is a possible card issue.

Here are some facts and output:
Server: L2000
DDS: C1537A

(A listing of the test files I'm using.)
root@ddfin01 [ /tmp ]
# ll A*
-rw-rw-r-- 1 root sys 9502720 Oct 24 12:17 AAAa15595.TMP
-rw-rw-r-- 1 root sys 169723 Oct 24 11:55 AAAa15949.TMP
-rw-rw-r-- 1 root sys 8340565 Oct 24 11:55 AAAa16909.TMP
-rw-rw-r-- 1 root sys 415146 Oct 24 11:55 AAAa17203.TMP
-rw-rw-r-- 1 root sys 157435 Oct 24 11:55 AAAa19393.TMP
-rw-rw-r-- 1 root sys 415146 Oct 24 11:55 AAAa21440.TMP

(Using TAR with the default block setting of 4.)
root@ddfin01 [ /tmp ]
# tar cvf /tmp/AAA*
a /tmp/AAAa15949.TMP 332 blocks
a /tmp/AAAa16909.TMP 16291 blocks
a /tmp/AAAa17203.TMP 811 blocks
a /tmp/AAAa19393.TMP 308 blocks
a /tmp/AAAa21440.TMP 811 blocks

(Tar: tape error (5) during read.)
root@ddfin01 [ /tmp ]
# tar t
Tar: blocksize = 4
/tmp/AAAa15595.TMP
/tmp/AAAa15949.TMP
Tar: tape error (5)

(Changing the block setting to 1.)
root@ddfin01 [ /tmp ]
# tar cvbf 1 /dev/rmt/0m /tmp/AA*
a /tmp/AAAa15595.TMP 2398 blocks
a /tmp/AAAa15949.TMP 332 blocks
a /tmp/AAAa16909.TMP 16291 blocks
a /tmp/AAAa17203.TMP 811 blocks
a /tmp/AAAa19393.TMP 308 blocks
a /tmp/AAAa21440.TMP 811 blocks

(Tape reads just fine with blocksize of 1.)
root@ddfin01 [ /tmp ]
# tar t
Tar: blocksize = 1
/tmp/AAAa15595.TMP
/tmp/AAAa15949.TMP
/tmp/AAAa16909.TMP
/tmp/AAAa17203.TMP
/tmp/AAAa19393.TMP
/tmp/AAAa21440.TMP

Thanks in advance for any help/direction anyone can provide.
Hindsight is 20/20
8 REPLIES 8
Jim Mallett
Honored Contributor

Re: Tar: tape error (5)

Forgot to mention, when I force a blocksize of 1 there is no error. It only happens w/ the default blocksize of 4.
Hindsight is 20/20
James Beamish-White
Trusted Contributor
harry d brown jr
Honored Contributor

Re: Tar: tape error (5)

Well first, this command:

tar cvf /tmp/AAA*


will write your tar to the first file in the directory. It is not writing to tape!

So when you do a "tar t " it is reading from your tape drive by default.

the correct syntax is


tar cvf /dev/rmt/0m /tmp/AAA*


live free or die

harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: Tar: tape error (5)

SAMPLE:

[root]pbctst: ls -l /tmp/va*
-rw-rw-r-- 1 root sys 0 Oct 24 12:53 /tmp/va0
-rw-rw-r-- 1 root sys 5422 Aug 29 11:56 /tmp/va2_ioscan
-rw-rw-r-- 1 root sys 5728 Aug 29 12:54 /tmp/va3_ioscan
-rw-rw-r-- 1 root sys 5908 Aug 29 15:06 /tmp/va4_ioscan
-rw-rw-r-- 1 root sys 5203 Aug 29 10:51 /tmp/va_ioscan
-rw-rw-r-- 1 root sys 0 Oct 24 12:53 /tmp/vaa
[root]pbctst: tar cvf /tmp/va*
a /tmp/va2_ioscan 11 blocks
a /tmp/va3_ioscan 12 blocks
a /tmp/va4_ioscan 12 blocks
a /tmp/va_ioscan 11 blocks
a /tmp/vaa 0 blocks
[root]pbctst: ls -l /tmp/va*
-rw-rw-r-- 1 root sys 30720 Oct 24 12:54 /tmp/va0
-rw-rw-r-- 1 root sys 5422 Aug 29 11:56 /tmp/va2_ioscan
-rw-rw-r-- 1 root sys 5728 Aug 29 12:54 /tmp/va3_ioscan
-rw-rw-r-- 1 root sys 5908 Aug 29 15:06 /tmp/va4_ioscan
-rw-rw-r-- 1 root sys 5203 Aug 29 10:51 /tmp/va_ioscan
-rw-rw-r-- 1 root sys 0 Oct 24 12:53 /tmp/vaa
[root]pbctst:
Live Free or Die
Jim Mallett
Honored Contributor

Re: Tar: tape error (5)

Got me there Harry. I actually typed the command right on the system, somehow in my copy/paste I omitted it. I am using TAR properly (as far as I know)
tar cvf /dev/rmt/0m /path

I have also tried without the "f" and with the 0mn device.
Hindsight is 20/20
Roger Baptiste
Honored Contributor

Re: Tar: tape error (5)

Jim,

Remove the tape device
files and recreate it again.
using rmsf/insf. This is just
to make sure they were
created correctly.

do an ioscan -nfCtape
to see they are recognised.

-raj

Take it easy.
Frank Slootweg
Honored Contributor

Re: Tar: tape error (5)

Jim wrote:
"Forgot to mention, when I force a blocksize of 1 there is no error. It only happens w/ the default blocksize of 4."

The default block size is 20, not 4. See the description of the "b" option.

I advise to check which block size tar actually used, i.e.

dd if=/dev/rmt/0m of=/tmp/record bs=64k count=1 ; ll /tmp/record

The size of /tmp/record will be the record size in bytes. Divide by 512 to get blocks. If it is 20, then leave things as they are, i.e. do not use the "b" option, not on write and not on read.

Also check the dmesg(1M) output and syslog file at the time of the error. In UNIX, a driver can only return limited information to the 'application', i.e. in this case tar. Because of this UNIX (standard) design limitation, HP-UX drivers often report additional information in the system message buffer (which is read by dmesg).