ST(4) — NEWS-OS Programmer’s Manual
NAME
st − SCSI tape device driver interface
STNOPSIS
/dev/{r|nr|anr}st∗
DESCRIPTION
st is the device driver for the Small Computer System Interface (SCSI) tape drive. st can handle up to 4 tape drives at the same time. There are two types of SCSI tape drivers: one can handle the variable length record as well as the fixed length, and the other can only handle the fixed length record. st supports both these types.
st supports four standard drives: 5099EN24(NWP−531), 5125, 2150S(NWP−546), and SDT−1000(NWP−542). You can check which drive type was used for probing by the configuration message displayed during the OS boot-up.
stc0 at iop addr 5 intr 5
st0 at stc0 slave 0 (bus=0, chan=5, lun=0)
st0: 5099EN24 (512 BYTES REC)/∗ 512−byte fixed length record ∗/
stc1 at iop addr 6 intr 6
st1 at stc1 slave 0 (bus=0, chan=6, lun=0)
st1: SDT−1000 (FLEX REC, 131072 MAX)/∗ variable length record ∗/
MAX values displayed by the drives that can handle the variable length records indicate the maximum block sizes that those drive types can handle.
Device Name and Record Format
The format of st driver device (file) name is as follows:
/dev/{r|nr|anr}st[#]
Specify 2 decimal numbers in #.
The value in # is specified as follows:
drive# + format#
Here, drive# is a drive’s unit number, ranging from 0 to 3, and format# is a record format number which takes one of the followings : 0 / 8 / 16 / 24 / 32 / 40 / 48. Relationships between record format number and format type (record density) are shown below:
| 5099EN24(NWP−531) | ||
| format# | Write | Read |
| 00 | QIC−24 | Only QIC−24 is available. |
| 08 | QIC−11 (9 track) | Only QIC−11 (9 track) is available. |
| 16 | Not available. | Only QIC−11 (4 track) is available. |
| 24 | QIC−24 | Only QIC−24 is available. |
| 5125 | ||
| format# | Write | Read |
| 00 | QIC−120 | Automatically identify QIC−24 and QIC−120. |
| 32 | QIC−120 | Automatically identify QIC−24 and QIC−120. |
| 2150S(NWP−546) | ||
| format# | Write | Read |
| 00 | When medium is QD−600A, written in QIC−120 format. When medium is QD−6150 or QD−600XTD or QD−6250, written in QIC−150 format. | Automatically identify QIC−24, QIC−120 and QIC−150. |
| 24 | Not available. | Only QIC−24 is available. |
| 32 | QIC−120 | Only QIC−120 is available. |
| 40 | QIC−150 | Only QIC−150 is available. |
| SDT−1000(NWP−542) | ||
| format# | Write | Read |
| 00 | DDS format | DDS format |
For example, use /dev/rst33 as a device name when using 2150S drive attached as drive 1, with the QIC−120 format type.
Moreover, the driver operates differently depending on the prefix indicated at the beginning of the device name.
| Device Name | Auto Rewind Mode | Auto Space Mode |
| /dev/rst∗ | ○ | × |
| /dev/nrst∗ | × | × |
| /dev/anrst∗ | × | ○ |
In the auto rewind mode, when the device is closed (i.e. dd(1), tar(1) and other commands are finished), the medium is rewound up to BOM (Begining Of Medium) position.
In the auto space mode, when the device is closed, the file mark is skipped automatically, and the head position is reset to the beginning of the next file. This is useful when reading files on tapes continuously using commands that finish its execution before encountering a file mark, such as tar(1). This action is performed as long as one or more bytes of data are actually read from the media from the time the device is opened until it is closed. Therefore, this function does not apply when you access the media with mt(1) command.
Changing Record Format
It is impossible to change record format on middle of medium. Changing record format is availabel only on the BOM position.
For example, reading medium written in QIC−120 format with 2150S drive, no auto rewind mode, record format number 24, will cause error.
# dd if=/dev/nrst24 of=file
st0: SCSI error on block #0, sense key 8.
After error occured, medium has been moved few inches from BOM position. To retry reading, you have to rewind up to BOM once, and to read with record format number 32. And note that the rewinding has to be done with record format number 24, not a 32, because of medium is not on BOM. Rewinding with record format number 32 causes error as follows:
# mt -f /dev/rst32 rewind
st0: Driver error 2.
The right operations are:
# mt -f /dev/rst24 rewind
# dd if=/dev/nrst32 of=file
Non Standard Support Drives
st driver can handle non-standard support drives in addition to four standard types. In such a case, relationships between record format number and format type (record density) is as follows:
| Fixed Record Length Drive | ||
| format# | Write | Read |
| 00 | Drive’s default format | Drive’s default format |
| 08 | QIC−11 (9 track) | QIC−11 (9 track) |
| 16 | QIC−11 (4 track) | QIC−11 (4 track) |
| 24 | QIC−24 | QIC−24 |
| 32 | QIC−120 | QIC−120 |
| 40 | QIC−150 | QIC−150 |
| 48 | QIC−525 | QIC−525 |
| Variable Record Length Drive | ||
| format# | Write | Read |
| 00 | Drive’s default format | Drive’s default format |
| 08 | 800 bpi | 800 bpi |
| 16 | 1600 bpi | 1600 bpi |
| 24 | 3200 bpi | 3200 bpi |
| 32 | 6250 bpi | 6250 bpi |
IOCTL
In addition to standard drive interface described in mtio(4), the st driver provides ioctl only for SCSI commands which are included in header file /sys/newsiodev/streg.h.
FILES
/dev/{r|nr|ar|anr}st∗device special file
/dev/MAKEDEVdevice file creation shell script
/sys/newsiodev/streg.hioctl command definition
/sys/newsiodev/stdefs.cdevice configuration file
SEE ALSO
mt(1), tar(1), mtio(4), dump(8), restore(8), stinfo(8)
DIAGNOSTICS
st∗: Driver error 1.
An attempt is made to write to the write protected media.
st∗: Driver error 2.
The specified record format is invalid. The record format cannot be changed in the middle of the tape.
st∗: Driver error 3.
The request or argument of the ioctl command is invalid.
st∗: Driver error 4.
It encountered to the EOM during data I/O or record search.
st∗: Driver error 5.
Specified record size and actual record size do not match at read.
st∗: Driver error 6.
Driver is busy.
The st device driver also displays the error status returned by the controller as in the example given below:
st∗: SCSI error on block #0: sense key n.
Here, n indicates the value of the sense key returned by the REQUEST SENSE command of SCSI. The meanings of the values are as follows:
| Sense Key # | Errors |
| 2 | No media in the drive |
| 3 | media error (scratches on tape etc.) |
| 4 | hardware error (damaged device) |
| 5 | unauthorized operation |
| 8 | read an empty media |
| 11 | the command exited forcefully (the media is removed during I/O) |
BUGS
st command does not support the block for a device.
The cartridge tape will not run reverse direction. ioctl for the BSR and BSF are not supported. Therefore, the commands that uses these functions, such as tar(1) with a −r option, are not supported.
BSF n forwards the file header to the front of the n-th file mark. If you start reading from this position, you also reads the file mark, so perform as follows when rewinding the tape to the front of n files:
BSF n + 1
FSF 1
In principle, any SCSI tape drive can be operated using st. However, this is not guaranteed.
NEWS-OS Release 4.1C