Linux operating systems

Preventing tape labels from being overwritten

The Tivoli® Storage Manager Passthru device driver uses the Linux SCSI generic device driver (sg) to control and operate tape devices attached on the system. If the Linux generic SCSI tape device driver (st) is loaded to the kernel and configures attached tape devices, conflicts can arise over how a device is managed because the generic sg driver and the st driver can both control the same device.

About this task

If the st driver controls devices that are used by Tivoli Storage Manager, Tivoli Storage Manager internal tape labels can be overwritten and data can be lost. If an application uses the st driver to control devices and the non-rewind option is not specified, tapes are automatically rewound following completion of an operation. The auto-rewind operation relocates the tape header position to the beginning of the tape. If the tape remains loaded in the drive, the next non-Tivoli Storage Manager write operation overwrites the Tivoli Storage Manager tape label because the label is at the beginning of the tape.

To prevent Tivoli Storage Manager labels from being overwritten, which can result in data loss, ensure that only the Tivoli Storage Manager Passthru driver controls devices that are used by Tivoli Storage Manager. Remove the st driver from the kernel or, if the driver is used by some applications on the system, delete the special files that correspond to Tivoli Storage Manager devices so that the st driver can no longer control them.

If you are using the IBMtape device driver to control devices on your system, you might encounter the same issues with device driver control conflicts. Review your IBMtape documentation to determine how to resolve this issue and prevent data loss.

Remove the st driver
If no other applications on the system use st devices, remove the st driver from the kernel. Issue the following command to unload the st driver:
rmmod st
Delete device special files that correspond to Tivoli Storage Manager devices
If there are applications that require use of the st driver, delete the special files that correspond to Tivoli Storage Manager devices. These special files are generated by the st driver, so when they are eliminated, the st driver can no longer control the corresponding Tivoli Storage Manager devices. Device special file names for tape drives appear in the /dev/ directory. Their names have the form /dev/[n]st[0-1024][l][m][a].

List the st drive special file names and Tivoli Storage Manager device special file names using the ls command. Based on the output of the device sequences, you can find devices in the st devices list matching those in the Tivoli Storage Manager devices list. The rm command can then be used to delete st devices.

Issue the following commands to list the st and Tivoli Storage Manager devices:
ls -l /dev/*st*
ls -l /dev/tsmscsi/mt*
Delete the st devices with the rm command:
rm /dev/*st*