This is a troubleshooting guide to verify the correct detection and operation of your tape library with your backup server in preparation for use with Amanda Enterprise.
Tape Library Hardware Detection and Verification
Please ensure that all cables are connected and the library and the tape drives are turned on.
Use the lsscsi command (command may need to be installed first) to show all SCSI devices:
# lsscsi -g [0:0:0:0] disk VMware Virtual Disk 1.0 /dev/sda /dev/sg0 [0:0:1:0] disk VMware Virtual Disk 1.0 /dev/sdb /dev/sg1 [1:0:0:0] mediumx ATL 1500 3.01 /dev/sch0 /dev/sg2 [1:0:0:1] tape HP Ultrium 1-SCSI E30W /dev/st0 /dev/sg3 [1:0:0:2] tape HP Ultrium 1-SCSI E30W /dev/st1 /dev/sg4
In the example above, one changer device (mediumx) and two tape drives (tape) are correctly seen.
If you do not see your changer or tape drives in the lsscsi output, please check your tape library documentation on how to set up the devices to be correctly recognized by your Linux or Solaris system.
Using the device name for the tape changer in the far right column above, the mtx command may be used to verify the changer device may be correctly queried:
# mtx -f /dev/sg2 status Storage Changer /dev/sg2:2 Drives, 19 Slots ( 3 Import/Export ) Data Transfer Element 0:Empty Data Transfer Element 1:Full (Storage Element 3 Loaded):VolumeTag = 00180002 Storage Element 1:Full :VolumeTag=00180000 Storage Element 2:Full :VolumeTag=00180001 Storage Element 3:Empty Storage Element 4:Full :VolumeTag=00180003 Storage Element 5:Full :VolumeTag=00180004 Storage Element 6:Full :VolumeTag=00180005 Storage Element 7:Full :VolumeTag=00180006 Storage Element 8:Full :VolumeTag=00180007 Storage Element 9:Full :VolumeTag=00180008 Storage Element 10:Full :VolumeTag=00180009 Storage Element 11:Empty Storage Element 12:Full :VolumeTag=0018000B Storage Element 13:Full :VolumeTag=0018000C Storage Element 14:Full :VolumeTag=0018000D Storage Element 15:Full :VolumeTag=0018000E Storage Element 16:Full :VolumeTag=0018000F Storage Element 17 IMPORT/EXPORT:Empty Storage Element 18 IMPORT/EXPORT:Empty Storage Element 19 IMPORT/EXPORT:Empty
If you are not seeing all the drives or slots known to be offered by the tape library, it is possible that the library is partitioned in a way that only certain drives and slots in the changer are seen by the system. Remaining drives and slots may be reserved for a system that is attached through another interface or SCSI address.
Red Hat and CentOS systems usually create a symbolic link with path /dev/changer that points to the changer device name. In this case, you can leave off the device name and simply run mtx status.
Please note that the mtx status command does not do any mechanical querying of the tape library, so it is not a indicator of whether the library is functioning properly. To ensure that it mechanically is sound, you may test loading a tape.
As seen in the mtx output above, our tape changer has two drives installed: Data Transfer Element 0 and Data Transfer Element 1. In the example below, we test loading a tape from slot 8 into Data Transfer Element 1.
$ mtx -f /dev/sg2 load 8 1 Loading media from Storage Element 8 into drive 1...done
If the mtx output indicates an error at any point, the issue must be diagnosed by checking the SCSI errors given in the output. A tape library usually also has its own interface and self diagnostic tests. These may be used to determine if there is a hardware issue with the library or its drives. As far as your tape drives, it is also possible to perform an independent write test using commands such as dd or tar. If the issue cannot be easily resolved, please contact your tape library vendor to resolve errors received when issue certain mtx commands. The library should be able to be operated successfully and reliably via the mtx command in order to be successfully operated by Amanda Enterprise.
Tape Library Device Name Permissions
Perform a long listing of the changer device name in order to check if permissions are set properly:
# ls -lL /dev/changer crw-rw---- 1 root tape 21, 2 Mar 22 12:46 /dev/sg2 # id amandabackup uid=500(amandabackup) gid=6(disk) groups=6(disk),501(mysql)
In the above case, the amandabackup user needs to be added to the tape group in order to use the tape changer:
# adduser --group tape amandabackup