The Ftape Installation Guide - File System Interface
The first changes I made to ftape were to implement an emulation of tape
blocks of a fixed length to allow support for the block seek commands
MTFSR
, MTBSR
and MTSEEK
(see MTIOCTOP). These
commands allow for skipping of damaged tape sections and for fast (well,
still slow enough) skipping inside a backup volume and are important for
skipping bad spots on defective tape cartridges. The floppy tape
segments are not suitable for this purpose because they have varying
length due to bad sectors.
I regard a fixed block-size as a feature, but on the other hand there are some thing to take into account:
write()
or
read()
with other buffer sizes result in an -EINVAL error.
Thus one cannot simply do a `cat > /dev/qft0
' and then type some
blurb on the console.
MTSETBLK
command (see MTSETBLK). If one
really wants one can put the driver into variable block size mode
using the mt
program using a block size of 0:
mt -f /dev/qft0 setblk 0
Note that this leads to a maybe wrong behavior of the MTSEEK
,
MTFSR
and MTBSR
operations: they no longer skip tape
records but interpret their argument as a byte count. The same holds
for the MTIOCPOS
command: it reports the tape position (relative
to the start of the current volume) in bytes.
Note that compression is NOT supported when the driver emulates variable block size mode. zftape always compresses one block at a time (see Compression) and it is much easier to implement this with a fixed than with a variable block size. And further, fast seeking inside a compressed volume would be more difficult when using a variable block size and this would lead too much more insecure error recovery with defective tape cartridges.
Another point is that a fixed block size provides redundancy for the compressed data: if the de-compressor expands a tape block to something that has not the correct size then one immediately knows that something is wrong. And it is on the other hand pretty unlikely that defect data input to the de-compressor leads to a correct sized tape block.
For this reasons it is currently not possible to use the builtin compression in variable block size mode.
MTIOCVOLINFO
, which returns the
block size of the volume the driver is currently located at together with
some other maybe useful information. See MTIOCVOLINFO.
Use these buttons to jump to the top menu