SCO 5 and Tape Drives

SCO 5 - Adding Tape Drives:
sconf -v may be useful in gathering parameters to use in mkdev tape. The ha (Host Adapter) number can also be seen (and is configurable) in SCU.
If you have mkdev tape problems, then clean out mkdev tape as much as possible (remove all the tape entries you can) and then check witht he following 5 SCO TA's at http://www.sco.com/ta:

TA #: 109266: Unable to remove the last tape drive in mkdev tape.
TA #: 105776: Unable to rebuild the kernel after all tape drives are removed.
TA #: 104978: idmkreg reports "error updating space.c for Stp" when the kernel is relinking.
TA #: 109447: Kernel relink fails with "too many array initializers" after adding a SCSI tape unit.
TA #: 110973: What files get out of sync after trying to unsuccessfully add a tape drive?

There is a chance under SCO 5.0.4 w/ rs504c installed for the system to Panic with a trap type 0x0E when running "sconf -v" and you have two SCSI host adapters. Here is the SCO TA as well as the fix:

TA #: 109675: The command "sconf -v" causes my system to panic with "trap type 0x0E".

When adding a tape drive in SCO 5, you use mkdev tape. You need to have 4 values to add a tape: Host Bus Adapter #, SCSI Bus (always 0), Target ID (SCSI ID), and LUN (All Compaq tape drives will have a LUN of 0 - LUN is for multiple devices on the same SCSI ID). So with SCSI Bus and LUN both being 0, the Target ID is the SCSI ID you assigned the drive, the only question left should be what is the Host Bus Adapter #. This value is determined by using sconf -v or by looking in SCU. This value is also configurable in SCU.

mkdvtp.txt: mkdev tape: adding a tape drive
mkdvtprm.txt: mkdev tape: removing a tape drive

Variable vs. Fixed Block Sizes during Backup / Restore:
For many many reasons, it is better to go with a fixed block size rather than a variable one when performing tape backups and restores. One should test various block sizes to see which one gives the best results (speed vs. tape use). Use your OSs tape setblock command to specify a fixed block size. Keep increasing the block size until the optimum value is found. The block size should match the average size of the files being backed up. The same block size is required for both the backup and restore. Most tape drives will default to variable block size. A variable block size during a tar or cpio backup will cause the backup/restore to take a very long time or even fail.

TA #: 102733: A DAT tape written on one DAT drive cannot be read on another.
TA #: 105433: I cannot restore my Open Server 3.0 tape backups on OpenServer Release 5.

The man page for tapecntl (UW7) states "Using variable-length block mode when writing to magnetic tapes is discouraged because it may not work correctly ... Magnetic tape should always be written in fixed-length block mode, even though you are free to change the default fixed-block length ...".

Setting and Getting Tape Block Sizes:
SCO 5 - set: tape -a 512 setblk
SCO 5 - get: tape getblk (a return of 0 means variable block size)
UW7 - set: tapecntl -f 512 /dev/rmt/ntape1
UW7 - get: n/a
Linux - set: mt -f /dev/tape defblksize
Linux - get: mt -f /dev/tape status

Tape Status:
SCO 5: tape -s status /dev/rct0
UW7: n/a
Linux: mt -f /dev/tape status

Resetting tape drives:
SCO 5 - tape reset: tape -s reset /dev/rct0
SCO 5 - SCSI bus reset: cpqsmu c -tcha -n0 -r (this resets the first SCSI channel, ha=0, because "n" is the host bus adapter number)
UW7: tapecntl -r /dev/rmt/ntape1
Linux: n/a

Simple Backups / Tests:
SCO 5 - Backup: tar -cvf /dev/rStp0 /etc
SCO 5 - Test: tar -tvf /dev/rStp0
UW7 - Backup: tar -cvf /dev/rmt/ntape1 ????
UW7 - Test: tar -tvf /dev/rmt/ntape1 ????
Linux - Backup: tar -cvf /dev/tape /etc
Linux - Test: tar -tvf /dev/tape
1