SpanTape can be used as a replacement for dd(1) to make backup using multiple SCSI tapes, giving the possibility to change tapes on the fly, even using only single tape drive (without tape changer).
spantape should be used exclusively with SCSI tape drives - it uses some st(4) ioctls to determine tape block mode and block size and checks for tape-specific EOF/EOD indicators.
The data structure of spantape backup typically looks like this:
TAPE1: [BACKUP <id> TAPE 1] [...|...|...] <EOD> TAPE2: [BACKUP <id> TAPE 2] [...|...|...] <EOD> TAPE3: [BACKUP <id> TAPE 3] [...|...] [BACKUP <id> EOD]
Each tape containing part of spantape backup begins with backup ID tag. Backup ID tag consists of backup ID (alphanumeric string) and successive tape number - using tags helps to keep tapes ordered while restoring.
Backup ID tag is followed by stored data blocks, terminated by either EOD (== two consecutive EOF marks), or EOF followed by End-Of-Backup indication block. End-Of-Backup block consist of the same backup ID that is placed in backup ID tag block, and "EOD" keyword instead of tape number.
If one disables the usage of backup ID and end-of-backup tags, spantape uses only EOF/EOD marks to check for end of tape/backup, but doesn't check if tapes restored are the tapes belonging to same backup, or even if they are restored in right order.
Note about tape block sizes:
tape drive can operate in either fixed or variable blocksize mode.
For fixed blocksize mode, the st driver must be configured
(e.g. using stinit(8)). spantape can then use set blocksize automatically.
op: \ mode: variable blocksize fixed blocksize
read must be >= than read(2) length should
longest block on be equal to multiple
the tape read. block size
read(2) with too
small blocksize
returns ENOMEM.
(spantape translates
this to more verbose
error message ;))
write can be of any size, write(2) size should be multiple
but better use bigger length of block size. Spantape
sizes (like 64k) pads the last block with zeros.
- interblock spaces
are quite large.
