STINIT(8) | System Manager's Manual | STINIT(8) |
stinit - initialize SCSI magnetic tape drives
stinit [-f conf-file] [-h] [-p] [-r] [-v] [devices...]
This manual page documents the tape control program stinit can used to initialize SCSI tape drive modes at system startup, after loading the tape driver as module, or after introduction of new device to the SCSI subsystem at run-time. The initialization is performed by sending ioctl commands to the drive. The commands are defined in a text file that is indexed using the inquiry data the drive returns (manufacturer, device, revision). Values for all of the general and mode-specific SCSI tape parameters up to Linux version 2.6.0 can be initialized.
If the program is started without arguments, it tries to find all accessible SCSI tape devices and the device files for the different modes of the devices. The tape drives are searched in the scanning order of the kernel and searching is stopped at the first non-existing tape. All of the found devices are initialized if a matching description is found from the parameter file. Note that a mode for a device is not initialized if the corresponding device file is not found even if a matching description for the mode exists. The non-rewind device is preferred over the auto-rewind device for each mode. If the directory /dev/tapes is found, the devfs filesystem is assumed to be mounted on /dev. Otherwise, the directories /dev/scsi and /dev are scanned for device files.
SCSI tape drives can be initialized selectively using program arguments. A numeric argument specifies the number of the tape drive in the scanning order of the kernel. A file name specifies that the device corresponding to this name is to be initialized. If the file name is given without the directory specification, the program searches for the name in the device directories /dev/scsi and /dev. Only full path names are supported with devfs.
The configuration file is a simple text file that contains descriptions of tape drives and the corresponding initialization parameters. The parameter definition blocks are delimited by {}. Specification of the drive description is restarted after each parameter definition block.
The drive descriptions and the parameter definitions consist of pairs name = value. The value is either a numeric parameter, a string not containing blanks, or a quoted string. In case of a numeric parameter, the postfix k or M can be used to give the value in units of 1024 or 1024 * 1024, respectively. If the =value -part is omitted, the value "1" is used. If the character # is found from an input line, the rest of the line is discarded. This allows use of comments in the definition file. The following example contains definitions for one type of tape drives:
# The XY dat manufacturer=XY-COMPANY model = "UVW DRIVE" { scsi2logical=1 # Common definitions for all modes can-bsr can-partitions auto-lock # Definition of modes mode1 blocksize=0 compression=1 mode2 blocksize=1024 compression=1 mode3 blocksize=0 compression=0 mode4 blocksize = 1k compression=0 }
The devices are identified using zero or more of the following keywords corresponding to the data returned by the tape device as response to the SCSI INQUIRY command. The matches are case-sensitive and performed up to the length defined in the configuration file (permitting use of partial matches).
All of the matching initializations are collected in the order they are defined in the file. This means that common parameters can be defined for all devices using zero keywords for a definition block. Another consequence is that, for instance, some parameters can be easily given different values for a specific firmware revision without repeating the parameters common to all revisions.
The tape parameters are defined using the following keywords. More thorough description of the parameters can be found from the st(4) man page (not up to date when this is written) or from the file drivers/scsi/README.st in the Linux kernel source tree. The keywords are matched using only the first characters. The part of the keywords not used in matching is enclosed by []. The numeric values may be specified either in decimal notation or hexadecimal notation (using the prefix 0x).
The program exits with value one if the command line is incorrect, the definition file is not found, or option -p is given and parsing the definition file fails. In all other cases the return value is zero (i.e., failing of initialization is not currently signaled by the return value).
With the exception of the -p option, the program can be used only by the superuser. This is because the program uses ioctls allowed only for the superuser.
The program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>, and is currently maintained by Iustin Pop <iustin@k1024.org>.
The program and the manual page are copyrighted by Kai Makisara, 1998-2008. They can be distributed according to the GNU Copyleft.
Please report bugs to <https://github.com/iustin/mt-st>.
April 2008 |