Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ st(4S) — SunOS 4.0.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mt(1)

tar(1)

mtio(4)

dump(8)

restore(8)

ST(4S)  —  DEVICES AND NETWORK INTERFACES

NAME

st − driver for SCSI tape devices

CONFIG — SUN-3, SUN-3x, SUN-4 SYSTEMS

controller si0 at vme24d16 ? csr 0x200000 priority 2 vector siintr 0x40
controller si1 at vme24d16 ? csr 0x204000 priority 2 vector siintr 0x41
controller si0 at obio ? csr 0x140000 priority 2
tape st0 at si0 drive 32 flags 1
tape st1 at si0 drive 40 flags 1
tape st2 at si1 drive 32 flags 1
tape st3 at si1 drive 40 flags 1
 controller sc0 at vme24d16 ? csr 0x200000 priority 2 vector scintr 0x40
tape st0 at sc0 drive 32 flags 1
tape st1 at sc0 drive 40 flags 1

The first two controller lines above specify the first and second SCSI host adapters for Sun-3, Sun-3x, and Sun-4 VME systems.  The third controller line specifies the first and only SCSI host adapter on Sun-3/50 and Sun-3/60 systems. 

Following the controller specification lines are four lines which define the available tape devices, st0−st3.  The first two tape devices, st0 and st1, are on the first controller, si0.  The next two tape devices, st2 and st3, are on the second controller, si1. 

The flags field is used to specify the SCSI device type to the host adapter.  The flags field must be set to 1 to identify tape devices. 

The drive value is calculated using the formula:

8∗target + lun

where target is the SCSI target, and lun is the SCSI logical unit number. 

The next configuration block, following si0 and si1 above, describes the older sc0 host adapter configuration. It follows the same configuration description as the si0 host adapter. 

CONFIG — SPARCsystem 330, SUN−3/80 SYSTEMS

controller sm0 at obio ? csr 0xfa000000 priority 2
tape st0 at sm0 drive 32 flags 1
tape st1 at sm0 drive 40 flags 1

The SPARCsystem 330 and Sun-3/80 use an on-board SCSI host adapter, sm0, which follows the rules described above in the Sun-3, Sun-3x, Sun-4 section. 

CONFIG — SUN−4/110 SYSTEM

controller sw0 at obio 2 csr 0xa000000 priority 2
tape st0 at sw0 drive 32 flags 1
tape st1 at sw0 drive 40 flags 1

The Sun-4/110 uses an on-board SCSI host adapter, sw0, which follows the rules described above in the Sun-3, Sun-3x, Sun-4 section. 

CONFIG — SUN−3/E SYSTEM

controller se0 at vme24d16 ? csr 0x300000 priority 2 vector se_intr 0x40
tape st0 at se0 drive 32 flags 1
tape st1 at se0 drive 40 flags 1

The Sun-3/E uses a VME-based SCSI host adapter, se0, which follows the rules described above for Sun-3, Sun-3x, Sun-4 systems. 

CONFIG — Sun386i

controller wds0 at obmem ? csr 0xFB000000 dmachan 7 irq 16 priority 2
tape st0 at wds0 drive 32 flags 1

The Sun386i configuration follows the rules described above in the Sun-3, Sun-3x, Sun-4 configuration section. 

CONFIG — SUN−2 SYSTEM

controller sc0 at mbmem ? csr 0x80000 priority 2
controller sc1 at mbmem ? csr 0x84000 priority 2
controller sc0 at vme24 ? csr 0x200000 priority 2 vector scintr 0x40
tape st0 at sc0 drive 32 flags 1
tape st1 at sc0 drive 40 flags 1
tape st0 at sc1 drive 32 flags 1
tape st1 at sc1 drive 40 flags 1

The controller lines above specify the first and second SCSI host adapters, sc0 and sc1, on Sun-2/120 and Sun-2/170 systems.  The third controller line specifies the only host adapter on a Sun-2/160.  It follows the rules described in the Sun-3, Sun-3x, Sun-4 configuration section above. 

DESCRIPTION

The st device driver is an interface to various SCSI tape devices.  Supported 1/4−inch cartridge devices include the Archive Viper QIC−150 streaming tape drive, the Emulex MT−02 tape controller, and the Sysgen SC4000 tape controller.  st provides a standard interface to these various devices, see mtio(4) for details. 

The driver can be opened with either rewind on close (/dev/rst∗) or no rewind on close (/dev/nrst∗) options.  A maximum of four tape formats per device are supported (see FILES below).  The tape format is specified using the device name.  The four rewind on close formats for st0, for example, are /dev/rst0, /dev/rst8, /dev/rst16, and /dev/rst24. 

Read Operation

Fixed-length I/O tape devices require the number of bytes read or written to be a multiple of the physical record size.  For example, 1/4−inch cartridge tape devices only read or write multiples of 512 bytes. 

Fixed-length tape devices read or write multiple records if the blocking factor is greater than 64512 bytes (minphys limit).  These multiple writes are limited to 64512 bytes.  For example, if a write request is issued for 65536 bytes using a 1/4−inch cartridge tape, two writes are issued; the first for 64512 bytes and the second for 1024 bytes. 

Tape devices, which support variable-length I/O operations, such as 1/2−inch reel tape, may read or write a range of 1 to 65535 bytes.  If the record size exceeds 65535 bytes, the driver reads or writes multiple records to satisfy the request.  These multiple records are limited to 65534 bytes.  As an example, if a write request for 65540 bytes is issued using 1/2−inch reel tape, two records are written; one for 65534 bytes followed by one for 6 bytes. 

If the driver is opened for reading in a different format than the tape is written in, the driver overrides the user selected format.  For example, if a 1/4−inch cartridge tape is written in QIC-24 format and opened for reading in QIC−11, the driver will detect a read failure on the first read and automatically switch to QIC−24 to recover the data. 

Note: If the /dev/∗st[0−3] format is used, no indication is given that the driver has overridden the user selected format.  Other formats issue a warning message to inform the user of an overridden format selection.  Some devices automatically perform this function and do not require driver support (1/2−inch reel and QIC−150 tape drives for example). 

If a file mark is encountered during reading, no error is reported but the number of bytes transferred is zero.  The next read operation reads into the next file. 

End of media is indicated by two successive zero transfer counts.  No further reading should be performed past the end of recorded media. 

If the read request size is 2048 bytes, the tape driver behaves as a disk device and honors seek positioning requests (see lseek(2)).  If a file mark is crossed during a read operation, this function is disabled. 

Write Operation

Writing is allowed at either the beginning of tape or after the last written file on the tape.  Writing from the beginning of tape is performed in the user-specified format.  The original tape format is used for appending onto previously written tapes.  A warning message is issued if the driver has to override the user-specified format. 

Care should be used when appending files onto 1/2−inch reel tape devices, since an extra file mark is appended after the last file to mark the end of recorded media.  In other words, the last file on the tape ends with two file marks instead of one.  This extra file mark must be overwritten to prevent the creation of a null file.  To facilitate write append operations, a space to the end of recorded media ioctl is provided to eliminate this problem by having the driver perform the positioning operation. 

If the end of tape is encountered during writing, no error is reported but the number of bytes transferred is zero and no further writing is allowed.  Trailer records may be written by first writing a file mark followed by the trailer records.  It is important that these trailer records be kept as short as possible to prevent data loss. 

Close Operation

If data was written, a file mark is automatically written by the driver upon close.  If the rewinding device name is used, the tape will be rewound after the file mark is written.  If the user wrote a file mark prior to closing, then no file mark is written upon close.  If a file positioning ioctl, like rewind, is issued after writing, a file mark is written before repositioning the tape. 

Note:  For 1/2−inch reel tape devices, two file marks are written to mark the end of recorded media before rewinding or performing a file positioning ioctl.  If the user wrote a file mark before closing a 1/2−inch reel tape device, the driver will always write a file mark before closing to insure that the end of recorded media is marked properly. 

If no data was written and the driver was opened for WRITE-ONLY access, a file mark is written thus creating a null file. 

IOCTLS

The following ioctls are supported: forwardspace record, forwardspace file, backspace record, backspace file, backspace file mark, rewind, write file mark, offline, erase, retension, space to EOM, and get status. 

The backspace file and forwardspace file tape operations are inverses. Thus, a forwardspace “−1” file is equivalent to a backspace “1” file.  A backspace “0” file is the same as forwardspace “0” file; both position the tape device to the beginning of the current file. 

Backspace file mark moves the tape backwards by file marks.  The tape position will end on the beginning of tape side of the desired file mark.  Devices which do not support this function, such as 1/4−inch cartridge tape, return an ENXIO error. 

Backspace record and forwardspace record operations perform much like space file operations, except that they move by records instead of files.  Variable-length I/O devices (1/2−inch reel, for example) space actual records; fixed-length I/O devices space physical records (blocks).  1/4−inch cartridge tape, for example, spaces 512 byte physical records.  The status ioctl residue count contains the number of files or records not skipped.  Record skipping does not go past a file mark; file skipping does not go past the end of recorded media. 

Spacing to the end of recorded media positions the tape at a location just after the last file written on the tape.  For 1/4−inch cartridge tape, this is after the last file mark on the tape.  For 1/2−inch reel tape, this is just after the first file mark but before the second (and last) file mark on the tape.  Additional files can then be appended onto the tape from that point. 

The offline ioctl rewinds and, if appropriate, takes the device offline by unloading the tape.  Tape must be inserted before the tape device can be used again. 

The erase ioctl rewinds the tape, erases it completely, and returns to the beginning of tape. 

The retension ioctl only applies to 1/4−inch cartridge tape devices.  It is used to restore tape tension improving the tape’s soft error rate after extensive start-stop operations or long-term storage.  Devices which do not support this function, such as 1/2−inch reel tape, return an ENXIO error. 

The get status ioctl call returns the drive id (mt_type), sense key error (mt_erreg), file number (mt_fileno), and record number (mt_blkno) of the last error.  The residue count (mt_resid) is set to the number of bytes not transferred or files/records not spaced. 

Note: The error status is reset by the get status ioctl call or the next read, write, or other ioctl operation.  If no error has occurred (sense key is zero), the current file and record position are returned. 

ERRORS

EACCES The driver is opened for write access and the tape is write protected, or an attempt is made to write on a write protected tape.  For writing with QIC−150 tape drives, this error is also reported if the wrong tape media is used for writing. 

EBUSY The tape device is already in use. 

EIO   During opening, the tape device is not ready because either no tape is in the drive, or the drive is not on-line.  Once open, this error is returned if the requested I/O transfer could not be completed. 

EINVAL The number of bytes read or written is not a multiple of the physical record size (fixed-length tape devices only). 

ENXIO During opening, the tape device does not exist.  On ioctl functions, this indicates that the tape device does not support the ioctl function. 

FILES

For QIC−150 tape devices (Archive Viper):
/dev/rst[0−3]  QIC−150 Format
/dev/rst[8−11] QIC−150 Format
/dev/rst[16−20] QIC−150 Format
/dev/rst[24−28] QIC−150 Format
/dev/nrst[0−3] non-rewinding QIC−150 Format
/dev/nrst[8−11] non-rewinding QIC−150 Format
/dev/nrst[16−19] non-rewinding QIC−150 Format
/dev/nrst[24−27] non-rewinding QIC−150 Format

For QIC−24 tape devices (Emulex MT−02 and Sysgen SC4000):
/dev/rst[0−3]  QIC−11 Format
/dev/rst[8−11] QIC−24 Format
/dev/rst[16−20] QIC−24 Format
/dev/rst[24−28] QIC−24 Format
/dev/nrst[0−3] non-rewinding QIC−11 Format
/dev/nrst[8−11] non-rewinding QIC−24 Format
/dev/nrst[16−19] non-rewinding QIC−24 Format
/dev/nrst[24−27] non-rewinding QIC−24 Format

Note:  The QIC−24 format is preferred over QIC−11 for Sun-3, Sun-3x, Sun-4, and Sun386i systems. 

SEE ALSO

mt(1), tar(1), mtio(4), dump(8), restore(8)

Archive Viper QIC−150 Tape Drive Product Specification
Emulex MT−02 Intelligent Tape Controller Product Specification
Sysgen SC4000 Intelligent Tape Controller Product Specification

DIAGNOSTICS

st?:  sttimer: I/O request timeout

A tape I/O operation has taken too long to complete.  A device or host adapter failure may have occurred. 

st?:  sttimer: can’t abort request

The driver is unable to find the request in the disconnect que to notify the device driver that it has failed.  A SCSI bus reset is issued to recover from this error. 

st?:  unknown SCSI device found

The SCSI device is not a tape device; it is some other type of SCSI device. 

st?:  warning, unknown tape drive found

The driver does not recognize the tape device.  Only the default tape density is used; block size is set to the value specified by the tape drive. 

st?:  tape is write protected

The tape is write protected. 

st?:  wrong tape media for writing

For QIC−150 tape drives, this indicates that the user is trying to write on a DC−300XL (or equivalent) tape.  Only DC−6150 (or equivalent) tapes can be used for writing. 
Note: DC−6150 was formerly known as DC−600XTD. 

st?:  warning, rewinding tape

The driver is rewinding tape in order to set the tape format. 

st?:  warning, using alternate tape format

The driver is overriding the user-selected tape format and using the previously used format. 

st?:  warning, tape rewound

For Sysgen tape controllers, the tape may be rewound as a result of getting sense data. 

st?:  format change failed

The tape drive rejected the mode select command to change the tape format. 

st?:  file mark write failed

The driver was unable to write a file mark. 

st?:  warning, The tape may be wearing out or the head may need cleaning.
st?:  read retries= %d, file= %d, block= %d
st?:  write  retries= %d, file= %d, block= %d

The number of allowable soft errors has been exceeded for this tape.  Either the tape heads need cleaning or the tape is wearing out.  If the tape is wearing out, continued usage of it is not recommended. 

st?:  illegal command

The SCSI command just issued was illegal.  This message can result from issuing an inappropriate command, such as trying to write over previously written files on the tape.  On foreign tape devices, this can also be caused by selecting the wrong tape format. 

st?:  error:  sense key(0x%x): %s, error code(0x%x): %s

An error has occurred.  The sense key message and error code are displayed for diagnostic purposes. 

st?:  stread: not modulo %d block size
st?:  stwrite: not modulo %d block size

The read or write request size must be a multiple of the %d physical block size. 

st?:  file positioning error
st?:  block positioning error

The driver was unable to position the tape to the desired file or block (record).  This is probably caused by a damaged tape. 

BUGS

Foreign tape devices which do not return a BUSY status during tape loading prevent user commands from being held until the device is ready.  The user must delay issuing any tape operations until the tape device is ready.  This is not a problem for Sun supplied tape devices. 

Foreign tape devices which do not report a blank check error at the end of recorded media cause file positioning operations to fail.  Some tape drives for example, mistakenly report media error instead of blank check error. 

“Cooked” mode for read and write operations is not supported. 

Systems using the older sc0 host adapter or the Sysgen SC4000 tape controller, prevent disk I/O over the SCSI bus while the tape is in use (during a rewind for example).  This problem is caused by the fact that they do not support disconnect/reconnect to free the SCSI bus.  Newer tape devices, like the the Emulex MT−02, and host adapters, like si0, eliminate this problem. 

Some older systems may not support the QIC−24 format, and may complain (or exhibit erratic behavior) when the user attempts to use this format. 

Sun Release 4.0  —  Last change: 24 March 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026