STINIT(8)
πΈ STINIT πΈ
okay so bestie, this is stinit from the System Manager's Manual section 8 β the tape-girlie helper that wakes up your SCSI magnetic tape drives and tells them how to behave. it's giving "system startup energy" but make it fashion. let's get into it π
β¨ NAME β¨
stinit β initialize SCSI magnetic tape drives π
π¦ SYNOPSIS π¦
stinit [-f conf-file] [-h] [-p] [-r] [-v] [devices...]
π DESCRIPTION π
so this manual page documents the tape control program stinit, which you can use to initialize SCSI tape drive modes at system startup, after loading the tape driver as a module, or after a new device shows up in the SCSI subsystem at run-time. slay. π
the initialization happens by sending ioctl commands to the drive. those commands are defined in a text file that gets indexed using the inquiry data the drive hands back (manufacturer, device, revision). and ngl, values for all of the general and mode-specific SCSI tape parameters up to Linux version 2.6.0 can be initialized. iconic. π
π OPTIONS π
-f conf-fileβ this one names the text file that holds the definitions for the different tape drive types. if you don't say anything,stinitgoes looking for the definition file/etc/stinit.defby default. π-hβ print the usage information. that's it, that's the whole thing. π-pβ the definition file gets parsed, but no tape drive initialization is attempted. so it's the vibe-check option, basically: use it to test that a definition file is still intact after you've been editing it. π-rβ rewind every device being initialized. yes ma'am, all of them. π«-vβ the more-voptions you stack, the more verbose the output gets (currently up to two of them). more-v, more yapping. π£οΈ--versionβ print the program version. simple, clean, main character. β
π§ THE DEVICES BEING INITIALIZED π§
if the program is started with no arguments, it tries to find all accessible SCSI tape devices, plus the device files for the different modes of those devices. the tape drives are searched in the scanning order of the kernel, and the searching stops at the first non-existing tape. every device it finds gets initialized, but only if a matching description turns up in the parameter file.
heads up: a mode for a device is not initialized if the corresponding device file isn't found β even if a matching description for that mode totally exists. and the non-rewind device is preferred over the auto-rewind device for each mode. no cap. π
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 also 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 that name is the one to initialize. if the file name is given without a directory specification, the program searches for the name in the device directories
/dev/scsiand/dev.
with devfs, only full path names are supported. periodt. π«Ά
π THE CONFIGURATION FILE π
the configuration file is a simple text file containing descriptions of tape drives and the matching initialization parameters. the parameter definition blocks are delimited by {}. after each parameter definition block, the specification of the drive description restarts. πΈ
the drive descriptions and the parameter definitions are made of pairs name = value. a value is either a numeric parameter, a string that doesn't contain blanks, or a quoted string. for a numeric parameter, the postfix k or M gives the value in units of 1024 or 1024 * 1024, respectively. if the =value part is omitted, the value "1" is used. and if the character # shows up in an input line, the rest of the line is discarded β which is how you get comments in the definition file. cute AND functional. π
here's an example with 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 }
π« identifying the devices π«
the devices are identified using zero or more of the following keywords, which correspond to the data the tape device returns in response to the SCSI INQUIRY command. the matches are case-sensitive and are performed up to the length defined in the configuration file β which is what lets you use partial matches. π₯
manufacturer=β specifies the string that must match the vendor identification returned by the device.model=β defines the string that must match the product identification returned by the device.revision=β matches the string that must match the product revision level returned by the device.
all of the matching initializations are collected in the order they're defined in the file. which means: common parameters can be defined for all devices by using zero keywords in a definition block. another consequence? for instance, some parameters can easily be given different values for a specific firmware revision without repeating the parameters that are common to all revisions. efficient queen. π
π¦ the tape parameters π¦
the tape parameters are defined using the keywords below. more thorough descriptions of these parameters live in the st(4) man page (which was not up to date when this was written, fyi) or in the file drivers/scsi/README.st in the Linux kernel source tree. the keywords are matched using only the first characters, and the part of the keyword not used in matching is enclosed in []. numeric values may be given either in decimal notation or in hexadecimal notation (using the prefix 0x). β¨
drive-[buffering]=valueβ the drive's buffering parameter is set to value. this parameter is common for all modes.cleaningβ the cleaning request notifying parameter is set to value.no-w[ait]β the immediate mode is used with commands like rewind if value is non-zero (i.e., the driver does not wait for the command to finish).weof-n[o-wait]β the immediate mode is used when writing filemarks if value is non-zero (i.e., the driver does not wait for the command to finish).mode=valueβ this keyword starts the definition of tape mode value. the number of the mode must be between1and4.disab[led]=valueβ this mode is disabled for this device if value is non-zero. useful when some mode defined in a more general definition should be disabled by a more specific definition for some device (for example, for a device with a buggy firmware level). πblock[size]=valueβ the default tape block size is set to value bytes. a block size of zero means variable block mode.dens[ity]=valueβ the tape density code is set to value.buff[ering]=valueβ the buffered writes by the driver in fixed block mode are enabled if value is non-zero.async[-writes]=valueβ asynchronous writes by the driver are enabled if value is non-zero.read[-ahead]=valueβ read-ahead by the driver in fixed block mode is allowed if value is non-zero.two[-fms]=valueβ two filemarks are written when a file being written to is closed if value is non-zero. by default, one filemark is written.comp[ression]=valueβ compression of the data by the drive is enabled if value is non-zero. note that the tape driver can't enable compression for all drives that can compress data. note also that some drives define compression using density codes. π€·auto[-lock]=valueβ the tape drive door is locked automatically when the device file is opened if value is non-zero. πfast[-eom]=valueβ the MTEOM command is performed using the SCSI command that spaces directly to the end of medium if value is non-zero. the drawback is that the file number in the status becomes invalid. by default, spacing to end of medium is performed by spacing over filemarks until end of medium is detected, and the file number remains valid. so like, trade-off city. βοΈcan-b[sr]=valueβ backspacing over records is used by the driver when repositioning the tape when read-ahead is enabled if value is non-zero.noblk[limits]=valueβ the tape driver does not use the READ BLOCK LIMITS SCSI command when the device is being opened if value is non-zero. this is for the drives that do not support this SCSI command.can-p[artitions]=valueβ the support for tape partitions is enabled if value is non-zero.scsi2[logical]=valueβ logical block addresses are used in the MTSEEK and MTIOCPOS commands if value is non-zero. the default is to use the device-specific addresses.sili=valueβ if value is non-zero, the SILI bit is set when reading in variable block mode. this may speed up reading blocks shorter than the read byte count. set this only if you know that the drive supports SILI and the HBA reliably returns transfer residual byte counts. requires kernel version>= 2.6.26.defs-for-w[rites]=valueβ the parameters defining the tape format (density, block size, etc.) are forced when writing starts at the beginning of a tape if value is non-zero. the default is to change those parameters each time the device is opened at the beginning of a tape (or the mode is changed in the middle of a tape).sysv=valueβ the System V tape semantics are used if value is non-zero. otherwise the BSD semantics are used.timeout=valueβ the normal timeout for the device is set to value seconds.long-time[out]=valueβ the long timeout for the device is set to value seconds.
π RETURN VALUE π
the program exits with value one if:
- the command line is incorrect, or
- the definition file is not found, or
- option
-pis given and parsing the definition file fails, or - defining one or more of the options fails when the tape number(s) are given on the command line.
π RESTRICTIONS π
with the exception of the -p option, the program can be used only by the superuser. this is because the program uses ioctls that are allowed only for the superuser. so no, bestie, you can't just run it as yourself. π
π«Ά AUTHOR π«Ά
the program is written by Kai Makisara <Kai.Makisara@kolumbus.fi>, and is currently maintained by Iustin Pop <iustin@k1024.org>. thank you for your service. π
π COPYRIGHT π
the program and the manual page are copyrighted by Kai Makisara, 1998-2008. they can be distributed according to the GNU Copyleft. β¨
π BUGS π
please report bugs to <https://github.com/iustin/mt-st>. do not suffer in silence, bestie. π
π SEE ALSO π
okay that's the whole thing! π this page is from the System Manager's Manual, it's the stinit(8) page, dated April 2008 β shoutout to the mt-st era for giving us this absolute classic. go initialize something, you got this. π¦β¨π
π¦ where this page comes from
- debian trixie: mt-st 1.8-2 Β· GPL-2.0-only
- fedora 43: mt-st 1.8-2.fc43 Β· GPL-1.0-or-later
- fedora 44: mt-st 1.8-3.fc44 Β· GPL-1.0-or-later
- nixos 26.05: mt-st 1.8
- nixpkgs unstable: mt-st 1.8
- ubuntu questing: mt-st 1.8-2
- ubuntu resolute: mt-st 1.8-2build1 Β· GPL-2.0-only
- ubuntu stonking: mt-st 1.8-2build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms