Showing results for 
Search instead for 
Did you mean: 


Super Advisor


Hi All,
How to check the block size of tape drive??
Super Advisor

Re: blocksize

I want to restore a DB backup of an AIX system to HP-UX system.While trying for a restore,it is giving an error like blocksize not matching,unable to to proceed??
James R. Ferguson
Acclaimed Contributor

Re: blocksize


In the absence of knowing exactly what command (including its options) that you used to create the backup, it is virtually impossible to provide a useful answer.


Bill Hassell
Honored Contributor

Re: blocksize

Tapes are serial devices so there is no fixed block size. Instead, I believe you are asking about the block size used by some program that wrote records on the tape. If you used a DB program to create the tape, then you would use the same program to restore the data. Read the documentation about the program used to backup the data.

Bill Hassell, sysadmin
Raj D.
Honored Contributor

Re: blocksize


If you are using tar to backup to the tape you can specify the block size you want write the data chunk into it ,

# tar with b option:
b : blocking factor of the archive record::
Use the next arg argument as the blocking factor for archive records. The default is 20; the maximum is at least 20. However, if the f - modifier is used to specify standard input, the default blocking factor is 1.

The blocking factor is determined automatically when reading nine-track tapes (key letters x and t). On nine-track tapes, the physical tape record length is the same as the block size. The block size is defined as the logical record size times the blocking factor (number of logical records per block).

The blocking factor must be specified when reading flexible disks and cartridge tapes if they were written with a blocking factor other than the default.

If a tar file is read using a blocking factor not equal to the one used when the file was written, an error may occur at the end of the file but there may or may not be an actual error in the read. To prevent this problem, a blocking factor of 1 can be used, although performance may be reduced somewhat.

tar writes logical records of 512 bytes, independent of how logical records may be defined elsewhere by other programs (such as variable-length records (lines) within an ASCII text file).

You can also use dd to write to the tape device, and you can specify a block size: 1024k means 1MB block size.
# dd if=/dev/vgSAPdir/rsaparch of=/dev/rmt/0mn bs=1024k


" If u think u can , If u think u cannot , - You are always Right . "

Re: blocksize

>How to check the block size of tape drive?

You check the blocksize of a tape record, not the tape drive.

You can get the recordsize by reading a large buffer and checking the return value of read(2), especially if smaller than your buffer size.

>Raj: The blocking factor must be specified when reading flexible disks and cartridge tapes

If you use pax(1), it will automatically figure this out.
Super Advisor

Re: blocksize

thanxx 2 alll,,,