Operating System - HP-UX
1838225 Members
3761 Online
110125 Solutions
New Discussion

blocking factor on tape drives

 
Jeff Hagstrom
Regular Advisor

blocking factor on tape drives

i have 2 hpk460/9000 running hp-ux 11i and i'm getting application errors about blocking factors being different from the 2 machines. What does blocking factor mean and what and where do I check for the differences and how do make them the same to stop those errors?
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: blocking factor on tape drives

Essentially it means the number of fixed size records per tape block.

For example a common tape block size is 512 bytes but this would be a rather slow integral i/o size so you might write with a blocking factor of 128 which would write 64KiB at a time.

The blocking factor is really specific to an application although dd can be used to reblock i/o by specifying different ibs= and obs= values to indicate the input block size and the output block size respectively.

For example, a cpio archive specified with the default 512-byte block could be speeded up tremendously by piping throgh dd.

dd if=/dev/rmt/0m ibs=64k obs=512 | cpio -icvdum

which would read in 128 512-byte blocks at a time and then reblock them to 512 byte chunks that cpio expects.

If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: blocking factor on tape drives

For example, a cpio archive specified with the default 512-byte block could be sped up tremendously by piping through dd.
dd if=/dev/rmt/0m ibs=64k obs=512 | cpio -icvdum
>which would read in 128 512-byte blocks at a time and then reblock them to 512 byte chunks that cpio expects.

While a good example this is meaningless if you use a pipe. Anything sent to a pipe is unblocked and assumed to be a byte stream.

Of course you may be right in that you can't write more than 8 Kb to a pipe. You may want to reblock to 5120 so you can use the cpio -B option.
See comments in this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1163073