scsi_tape(7) UNIX System V(SCSI Drivers) scsi_tape(7)
NAME
scsitape - st01 SCSI tape driver
DESCRIPTION
The st01 tape driver receives command requests from the kernel via the
read, write, and ioctl system calls [see read(2) write(2)and ioctl(2) in
the Programmer's Reference Manual. The st01 driver generates the
appropriate SCSI commands and passes them through the host adapter driver
to the tape device. When command execution is complete, the host adapter
driver notifies st01 through interrupt. After this notification, st01
performs any required error recovery and indicates to the kernel that the
Input/Output (I/O) request is complete. The st01 driver operates
independently of the hardware used to talk to the SCSI bus.
The special file names used to access SCSI cartridge tape devices have
the following form:
/dev/rmt/tape rewind
/dev/rmt/tapen no rewind
/dev/rmt/c0s0 rewind (same as tape)
/dev/rmt/c0s0n no rewind (same as tapen)
/dev/rmt/c0s0r retension on open
/dev/rmt/c0s0nr retension on open, no rewind
/dev/rmt/c0s1 rewind
/dev/rmt/c0s1n no rewind
/dev/rmt/c0s1r retension on open
/dev/rmt/c0s1nr retension on open, no rewind
Only raw character interface files are provided. When opened, the tape
is assumed to be positioned as desired. If a retension-on-open special
file is opened, the tape is retensioned before any I/O is performed.
When a TRWD, TRETENSION, TLOAD, or TUNLOAD ioctl is requested and the
tape has been written, two file marks are written before the ioctl is
executed.
The following table lists the actions that occur on close [see close(2)
in the Programmer's Reference Manual], depending on if the file is
designated as rewind or no-rewind, and if the tape was written or read:
Rewind Tape Tape Action
on Close? Read? Written? on Close
Yes Yes N/A Rewind tape.
Yes N/A Yes Write two file
marks and rewind
tape.
Yes No No Rewind tape.
No No No No tape movement.
No Yes N/A Position tape
after next file
mark.
10/89 Page 1
scsi_tape(7) UNIX System V(SCSI Drivers) scsi_tape(7)
No N/A Yes Write one file
mark and position
tape after this
file mark.
A read occurring when the tape is positioned immediately before a file
mark returns zero(0) bytes and the tape is positioned after the file
mark. As with other raw devices, seeks are ignored. Some tape devices
allow both reads and writes to occur between rewinds; the st01 driver
supports these devices.
The following ioctl commands are used by the st01 driver to control tape
positioning.
TSFF/TSFB Used to position the tape forward/backward arg [see
ioctl(2)] number of file marks from the current tape head
position toward the End-of-Tape (EOT) / Beginning-of-Tape
(BOT). Forward movement of the tape leaves the tape
positioned on the EOT side of a file mark or at EOT and
backwards movement leaves the tape positioned on the BOT
side of a file mark or at BOT. A backward positioning
operation causes the next read to return 0 bytes unless
arg is greater than the number of file marks between the
current position and BOT. The value of arg must be a
positive integer. A value of 0 is not considered an
error, but does not cause any tape movement.
TSBF/TSBB Used to position the tape forward/backward arg number of
blocks from the current tape head position toward the
EOT/BOT. Upon command completion, the tape head is
positioned in the gap between tape blocks. Thus, skipping
a block forward/backward advances/retreats one to the
next/last block. The value of arg must be a positive
integer. On any attempt to space over a file mark, the
tape is positioned on the EOT/BOT side of the file mark
for forward/backward movement, and the positioning
operation ceases. A value of 0 is not considered an
error, but does not cause any tape movement.
TRWD Rewinds the tape from the current tape position to the
BOT. Two file marks are written prior to the rewind if
the tape has been written. This command does not unload
the tape.
TWRFILEM Used to write file marks to the tape. The arg defines the
number of consecutive file marks that are to be written.
If an error occurs while writing file marks, the number of
file marks that have been successfully written is
indeterminate.
Page 2 10/89
scsi_tape(7) UNIX System V(SCSI Drivers) scsi_tape(7)
TPREVMV Used to physically lock the tape in the drive. This
prevention may be in the form of a mechanical lock or an
LED to indicate the device is in use. TPREVMV is
supported only on devices that implement this feature.
TALLOMV Used to physically unlock the tape in the drive. This
command is used to undo the lock created by TPREVMV.
TALLOMV is supported only on devices that implement this
feature.
TLOAD Used to load the tape media and position the tape BOT.
TUNLOAD Used unload the tape. Most devices rewind the tape before
unloading. Devices capable of ejecting the tape will do
so in response to this command.
TERASE Used to erase the tape. The entire tape from BOT to EOT
is erased. If the tape is not positioned at BOT, the tape
is positioned at BOT prior to performing the erase
function.
TRDBLKLEN Returns the minimum and maximum block lengths supported by
the tape device. arg must be a struct blklen. See the
file /usr/include/sys/st01.h.
TWRBLKLEN Set the current block length for the tape device. arg
must be a struct blklen with both max_blen and min_blen
set to the desired block length. See the file
/usr/include/sys/st01.h.
TRETENSION Retensions the medium in the drive. The retension
operation leaves the tape positioned at BOT.
The following ioctl commands are used to identify a target driver and get
a pass-through major and minor number for a target device [see, for
example, scsiadaptec(7)].
BGETTYPE Used to get the bus name (e.g., scsi) and device driver
name (e.g., st01) of a specific device.
BGETDEV Used to get the pass-through major and minor number to the
calling utility to allow creation of a pass-through
special device file.
FILES
/dev/rmt/tape
/dev/rmt/tapen
/dev/rmt/c0s0
/dev/rmt/c0s0n
/dev/rmt/c0s0r
/dev/rmt/c0s0nr
/dev/rmt/c0s1
10/89 Page 3
scsi_tape(7) UNIX System V(SCSI Drivers) scsi_tape(7)
/dev/rmt/c0s1n
/dev/rmt/c0s1r
/dev/rmt/c0s1nr
/usr/include/sys/st01ioctl.h
/usr/include/sys/st01.h
/usr/include/sys/sdiedt.h
WARNINGS
Once any drive error is encountered, the driver refuses to do anything
more until the file is closed.
The tape driver does not support the use of the sar command.
SEE ALSO
scsiadaptec(7), scsicdrom(7), scsidisk(7), scsidpt(7),
scsiwd7000(7), scsiworm(7)
ioctl(2), close(2), read(2), write(2) in the Programmer's Reference
Manual
Page 4 10/89