C code
|
-
struct mtop op = { MTSETBLK, COUNT };
result = ioctl(tapefd, MTIOCTOP, &op);
|
Description
|
Set block length to COUNT bytes.
|
Notes
|
-
The default block size of ftape-3.04d (and later versions) is 10kb which matches the default
of the GNU
tar program.
-
The argument COUNT has to be a multiple of 1024 (including 0).
-
A maximum block size of 62kb is allowed.
-
An argument of `
0 ' means to switch to variable block size
mode. This is implemented in ftape-3.04d (and later versions) by setting the internal block
size variable zft_blk_sz to `1 ' and thus has some unexpected
side affects on the MTFSR , MTBSR and MTSEEK ioctls
which interpret their arguments in units of zft_blk_sz bytes,
i.e. they take their argument as a byte count when ftape-3.04d (and later versions) is in
variable block size mode.
-
When writing a volume, the block size used for the volume is stored in
the corresponding volume table entry, (see MTIOCVOLINFO), because
the ftape-3.04d driver needed to remember the block size of a tape
volume when it was using compression.
|
Caveats
|
When reading a volume one has to use the block size the volume was
created with. There is no need use the MTSETBLK ioctl again but
the read count has to be a multiple of the original block size.
|
Example
|
set the block size to the maximum allowed
-
mt -f /dev/nqft0 setblk 63488
switch to variable block size mode.
-
mt -f /dev/nqft0 setblk 0
|
References
|
|