Operating System - HP-UX
1754415 Members
2875 Online
108813 Solutions
New Discussion юеВ

Newbi needs help. Tar commands replies error 'blocksize error'

 

Newbi needs help. Tar commands replies error 'blocksize error'

hi,
I'm using HP-UX 11, (hp 9000, L1000).
Tape drive DDS4. I can read bakup tape
that i've created on my machine, however,
I'm getting 'Tar: tape blocksize error'
whenever trying to read tapes from other
machines. the tape is readable in other
machine (Unisys A series mainframe).
I'm using Tar command:
#tar -tvf /dev/rmt/0mn
9 REPLIES 9
steven Burgess_2
Honored Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

Hi

Looks like you need to rewind your tape first

mt -t /dev/rmt/0m rew

Then

tar -tvf /dev/rmt/0m

The 0mn means you are using the no rewind option with your tar command

HTH

Steve
take your time and think things through
Heiner E. Lennackers
Respected Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

The HP-UX tar command can only handle tar tape with max 64k bocksize (10k ist default). Other platforms (eg SGI) like to write other blocksizes.
Maybe you can try it with:
dd if=/dev/rmt/0m ibs=256k | tar tvf -

Maybe you can get ride of the ibs=256k at all, or you have to change it with the correct block size.

Heiner
P.S. SGI also likes to write byteswapped. If this is here the case to you have to add the dd option 'conv=swab'
if this makes any sense to you, you have a BIG problem
Peter Kloetgen
Esteemed Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

Hi,

you told us, that you have problems with tar- tapes from "other" machines. Does that mean other platforms, like solaris or aix? Then use a different command, which will solve your problem easily: pax

The command pax is able to read every tar- or cpio- format. And it's available on every UNIX platform. For more information:

man pax

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
V. V. Ravi Kumar_1
Respected Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

hi,
as already suggested just rewind the tape and issue
tar tvf /dev/rmt/0m

regds
Never Say No

Re: Newbi needs help. Tar commands replies error 'blocksize error'

Thanx all for the advice, but.....

1. Steven, it's still giving blocksize error
even after rewinding the tape.
2. Peter, I used pax -cdnv & pax -dv, but it
that there is no output, just an empty line.
did I give the correct command?
3. Heiner, I've tried the dd command with a
few combinations of the ibs= ???k , even
removing the ibs, but it's give a new error:
'directory checksum error'
My collegue is still at it, trying a few
combos with ibs=???k.
Frank Slootweg
Honored Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

For a tape "from other machine" do:

dd if=/dev/rmt/0mn of=/tmp/record1 bs=64k count=1
dd if=/dev/rmt/0mn of=/tmp/record2 bs=64k count=1
ll /tmp/record1 /tmp/record2
file /tmp/record1

and report the result (i.e. output) here.

What this will show is:
- The record size of the first and second record.
- Whether HP-UX recognizes this as a tar archive (i.e. byte order correct).

Other question: Does "tar -tvf /dev/rmt/0mn" report *anything else* (besides "tar: tape blocksize error" , i.e. (part of) the *listing*? If so, then please post the beginning of that listing, i.e. 10 or so lines.


MANOJ SRIVASTAVA
Honored Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

Hi

It is possible that the tapes are not in tar format . I would suggest that you do a simple dd to check whter the data is wriiten or not like


dd if=/dev/rmt/0m of=/tmp/test

and check after that whether there is some data in that file or not , in case you see some data then the tapes are not in tar format .


I dont hink it is a media issue as you can write and read sucessfully.


Manoj Srivastava
Sanjay_6
Honored Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

Hi,

First check if there was any block size used while taking the backup or what is the default block size when using tar on the system where the backup was taken.

Then use the -b option with the tar command to specify the block size,

tar -tvfb /dev/rmt/0m block_size

Hope this helps.

Regds
Matthew McNally
Occasional Contributor

Re: Newbi needs help. Tar commands replies error 'blocksize error'

I've had this problem on a Sun machine not HP, try a large block size value until it lets you read the tape i.e. tar -tvfb /dev/rmt/0mn 1000
good luck
arrgh help its all gone wrong