1751695 Members
5170 Online
108781 Solutions
New Discussion юеВ

blocksize

 
kunjuttan
Super Advisor

blocksize

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

Re: blocksize

Hi,
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 restore.how to proceed??
James R. Ferguson
Acclaimed Contributor

Re: blocksize

Hi:

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.

Regards!

...JRF...
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

kunjuttan,

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.
Example:
# dd if=/dev/vgSAPdir/rsaparch of=/dev/rmt/0mn bs=1024k



Cheers,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Dennis Handly
Acclaimed Contributor

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.
kunjuttan
Super Advisor

Re: blocksize

thanxx 2 alll,,,