1STINIT(8) System Manager's Manual STINIT(8)
2
3
4
6 stinit - initialize SCSI magnetic tape drives
7
9 stinit [-f conf-file] [-h] [-p] [-r] [-v] [devices...]
10
12 This manual page documents the tape control program stinit can used to
13 initialize SCSI tape drive modes at system startup, after loading the
14 tape driver as module, or after introduction of new device to the SCSI
15 subsystem at run-time. The initialization is performed by sending ioctl
16 commands to the drive. The commands are defined in a text file that is
17 indexed using the inquiry data the drive returns (manufacturer, device,
18 revision). Values for all of the general and mode-specific SCSI tape
19 parameters up to Linux version 2.6.0 can be initialized.
20
22 -f conf-file
23 Specifies the name of the text file containing the definitions
24 for different tape drive types. By default stinit tries to find
25 the definition file stinit.def or /etc/stinit.def (in this
26 order).
27
28 -h Print the usage information.
29
30 -p The definition file is parsed but no tape drive initialization
31 is attempted. This option can be used for testing the integrity
32 of a definition file after changes have been made.
33
34 -r Rewind every device being initialized.
35
36 -v The more -v options (currently up to two), the more verbose out‐
37 put.
38
39 --version
40 Print the program version.
41
43 If the program is started without arguments, it tries to find all
44 accessible SCSI tape devices and the device files for the different
45 modes of the devices. The tape drives are searched in the scanning
46 order of the kernel and searching is stopped at the first non-existing
47 tape. All of the found devices are initialized if a matching descrip‐
48 tion is found from the parameter file. Note that a mode for a device is
49 not initialized if the corresponding device file is not found even if a
50 matching description for the mode exists. The non-rewind device is pre‐
51 ferred over the auto-rewind device for each mode. If the directory
52 /dev/tapes is found, the devfs filesystem is assumed to be mounted on
53 /dev. Otherwise, the directories /dev/scsi and /dev are scanned for
54 device files.
55
56 SCSI tape drives can be initialized selectively using program argu‐
57 ments. A numeric argument specifies the number of the tape drive in the
58 scanning order of the kernel. A file name specifies that the device
59 corresponding to this name is to be initialized. If the file name is
60 given without the directory specification, the program searches for the
61 name in the device directories /dev/scsi and /dev. Only full path
62 names are supported with devfs.
63
65 The configuration file is a simple text file that contains descriptions
66 of tape drives and the corresponding initialization parameters. The
67 parameter definition blocks are delimited by {}. Specification of the
68 drive description is restarted after each parameter definition block.
69
70 The drive descriptions and the parameter definitions consist of pairs
71 name = value. The value is either a numeric parameter, a string not
72 containing blanks, or a quoted string. In case of a numeric parameter,
73 the postfix k or M can be used to give the value in units of 1024 or
74 1024 * 1024, respectively. If the =value -part is omitted, the value
75 "1" is used. If the character # is found from an input line, the rest
76 of the line is discarded. This allows use of comments in the definition
77 file. The following example contains definitions for one type of tape
78 drives:
79
80 # The XY dat
81 manufacturer=XY-COMPANY model = "UVW DRIVE" {
82 scsi2logical=1 # Common definitions for all modes
83 can-bsr can-partitions auto-lock
84 # Definition of modes
85 mode1 blocksize=0 compression=1
86 mode2 blocksize=1024 compression=1
87 mode3 blocksize=0 compression=0
88 mode4 blocksize = 1k compression=0 }
89
90 The devices are identified using zero or more of the following keywords
91 corresponding to the data returned by the tape device as response to
92 the SCSI INQUIRY command. The matches are case-sensitive and performed
93 up to the length defined in the configuration file (permitting use of
94 partial matches).
95
96 manufacturer=
97 This keyword specifies the string that must match the vendor
98 identification returned by the device.
99
100 model= This keyword defines the string that must match the product
101 identification returned by the device.
102
103 revision=
104 This keyword matched the string that must match the product
105 revision level returned by the device.
106
107 All of the matching initializations are collected in the order they are
108 defined in the file. This means that common parameters can be defined
109 for all devices using zero keywords for a definition block. Another
110 consequence is that, for instance, some parameters can be easily given
111 different values for a specific firmware revision without repeating the
112 parameters common to all revisions.
113
114 The tape parameters are defined using the following keywords. More
115 thorough description of the parameters can be found from the st(4) man
116 page (not up to date when this is written) or from the file driv‐
117 ers/scsi/README.st in the Linux kernel source tree. The keywords are
118 matched using only the first characters. The part of the keywords not
119 used in matching is enclosed by []. The numeric values may be specified
120 either in decimal notation or hexadecimal notation (using the prefix
121 0x).
122
123 drive-[buffering]=value
124 The drive's buffering parameter is set to value. This parameter
125 if common for all modes.
126
127 cleaning
128 The cleaning request notifying parameter is set to value
129
130 no-w[ait]
131 The immediate mode is used with commands like rewind if value is
132 non-zero (i.e., the driver does not wait for the command to fin‐
133 ish).
134
135 mode=value
136 This keyword starts definition of tape mode value. The number
137 of the mode must be between 1 and 4.
138
139 disab[led]=value
140 This mode is disabled for this device if value is non-zero. Can
141 be used if some mode defined in a more general definition should
142 be disabled by a more specific definition for some device (for
143 example, for a device with buggy firmware level).
144
145 block[size]=value
146 The default tape block size is set to value. bytes. The block
147 size zero means variable block mode.
148
149 dens[ity]=value
150 The tape density code is set to value.
151
152 buff[ering]=value
153 The buffered writes by the driver in fixed block mode are
154 enabled if value is non-zero.
155
156 async[-writes]=value
157 Asynchronous writes by the driver are enabled if value is non-
158 zero.
159
160 read[-ahead]=value
161 Read-ahead by the driver in fixed block mode is allowed if value
162 is non-zero.
163
164 two[-fms]=value
165 Two filemarks are written when a file being written to is closed
166 if value is non-zero. By default, one filemark is written.
167
168 comp[ression]=value
169 Compression of the data by the drive is enabled if value is non-
170 zero. Note that the tape driver can't enable compression for all
171 drives that can compress data. Note also that some drives define
172 compression using density codes.
173
174 auto[-lock]=value
175 The tape drive door is locked automatically when the device file
176 is opened if value is non-zero.
177
178 fast[-eom]=value
179 The MTEOM command is performed using the SCSI command that spa‐
180 ces directly to the end of medium if value is non-zero. The
181 drawback is that the file number in the status becomes invalid.
182 By default, spacing to end of medium is performed by spacing
183 over filemarks until end of medium is detected and the file num‐
184 ber remains valid.
185
186 can-b[sr]=value
187 Backspacing over records is used by the driver when reposition‐
188 ing the tape when read-ahead is enabled if value is non-zero.
189
190 noblk[limits]=value
191 The tape driver does not use the READ BLOCK LIMITS SCSI command
192 when the device is being opened if value is non-zero. This is
193 for the drives that do not support this SCSI command.
194
195 can-p[artitions]=value
196 The support for tape partitions is enabled if value is non-zero.
197
198 scsi2[logical]=value
199 Logical block addresses are used in the MTSEEK and MTIOCPOS com‐
200 mands if value is non-zero. The default is to use the device-
201 specific addresses.
202
203 sili=value
204 If value is non-zero, the SILI bit is set when reading in vari‐
205 able block mode. This may speed up reading blocks shorter than
206 the read byte count. Set this only if you know that the drive
207 supports SILI and the HBA reliably returns transfer residual
208 byte counts. Requires kernel version >= 2.6.26.
209
210 defs-for-w[rites]=value
211 The parameters defining the tape format (density, block size,
212 etc.) are forced when writing starts at the beginning of a tape
213 if value is non-zero. The default is to change there parameters
214 each time the device is opened at the beginning of a tape (or
215 the mode is changed in the middle of a tape).
216
217 sysv=value
218 The System V tape semantics are used if value is non-zero. Oth‐
219 erwise the BSD semantics are used.
220
221 timeout=value
222 The normal timeout for the device is set to value seconds.
223
224 long-time[out]=value
225 The long timeout for the device is set to value seconds.
226
228 The program exits with value one if the command line is incorrect, the
229 definition file is not found, or option -p is given and parsing the
230 definition file fails. In all other cases the return value is zero
231 (i.e., failing of initialization is not currently signaled by the
232 return value).
233
235 With the exception of the -p option, the program can be used only by
236 the superuser. This is because the program uses ioctls allowed only for
237 the superuser.
238
240 The program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>.
241
243 The program and the manual page are copyrighted by Kai Makisara,
244 1998-2008. They can be distributed according to the GNU Copyleft.
245
247 st(4) mt(1)
248
249
250
251 April 2008 STINIT(8)