The
utility is used to command a magnetic tape drive for operations
other than reading or writing data.
The
-f
option's
tapename
overrides the
TAPE
environment variable described below.
The available commands are listed below.
Only as many
characters as are required to uniquely identify a command
need be specified.
The following commands optionally take a
count
which defaults to 1.
weof
Write
count
end-of-file (EOF) marks at the current position.
smk
Write
count
setmarks at the current position.
fsf
Forward space
count
files.
fsr
Forward space
count
records.
fss
Forward space
count
setmarks.
bsf
Backward space
count
files.
bsr
Backward space
count
records.
bss
Backward space
count
setmarks.
erase
Erase the tape using a long (often very long) method.
With a
count
of 0, it will erase the tape using a quick method.
Operation is not guaranteed if the tape is not at its beginning.
The tape will be at its beginning upon completion.
The following commands ignore
count
rdhpos
Read the hardware block position.
The block
number reported is specific for that hardware only.
With drive data compression especially,
this position may have more to do with the amount of data
sent to the drive than the amount of data written to tape.
Some drives do not support this.
rdspos
Read the SCSI logical block position.
This typically is greater than the hardware position
by the number of end-of-file marks.
Some drives do not support this.
rewind
Rewind the tape.
offline , rewoffl
Rewind the tape and place the drive off line.
Some drives are never off line.
retension
Re-tension the tape.
This winds the tape from the current position to the end
and then to the beginning.
This sometimes improves subsequent reading and writing,
particularly for streaming drives.
Some drives do not support this.
status
Output status information about the drive.
For SCSI magnetic tape devices,
the current operating modes of density, blocksize, and whether compression
is enabled is reported.
The current state of the driver (what it thinks that
it is doing with the device) is reported.
If the driver knows the relative
position from BOT (in terms of filemarks and records), it outputs that.
Note
that this information is not definitive (only BOT, End of Recorded Media, and
hardware or SCSI logical block position (if the drive supports such) are
considered definitive tape positions).
errstat
Output (and clear) error status information about this device.
For every normal
operation (e.g., a read or a write) and every control operation (e.g,, a
rewind), the driver stores up the last command executed and it is associated
status and any residual counts (if any).
This command retrieves and outputs this
information.
If possible, this also clears any latched error information.
geteotmodel
Output the current EOT filemark model.
The model states how
many filemarks will be written at close if a tape was being written.
eod , eom
Wind the tape to the end of the recorded data,
typically after an EOF mark where another file may be written.
The following commands require an
argument
sethpos
Set the hardware block position.
The
argument
is a hardware block number to which to position the tape.
Some drives do not support this.
setspos
Set the SCSI logical block position.
The
argument
is a SCSI logical block number to which to position the tape.
Some drives do not support this.
blocksize
Set the block size for the drive.
The
argument
is the number of bytes per block,
except 0 commands the drive to use variable-length blocks.
seteotmodel
Set the EOT filemark model to
argument
and output the old and new models.
Typically this will be 2
filemarks, but some devices (typically QIC cartridge drives) can
only write 1 filemark.
You may only choose a value of
1
or
2
comp
Set the drive's compression mode.
The non-numeric values of
argument
are:
off
Turn compression off.
on
Turn compression on.
none
Same as
off
enable
Same as
on
IDRC
IBM Improved Data Recording Capability compression (0x10).
DCLZ
DCLZ compression algorithm (0x20).
In addition to the above recognized compression keywords, the user can
supply a numeric compression algorithm for the drive to use.
#include <most>
cases, simply turning the compression
`on'
will have the desired effect of enabling the default compression algorithm
supported by the drive.
If this is not the case (see the
status
display to see which compression algorithm is currently in use), the user
can manually specify one of the supported compression keywords (above), or
supply a numeric compression value from the drive's specifications.
density
Set the density for the drive.
For the density codes, see below.
The density value could be given either numerically, or as a string,
corresponding to the
``Reference''
field.
If the string is abbreviated, it will be resolved in the order
shown in the table, and the first matching entry will be used.
If the
given string and the resulting canonical density name do not match
exactly, an informational message is output about what the given
string has been taken for.
The following density table was taken from the
`Historical sequential access density codes'
table (A-1) in Revision 11 of the SCSI-3 Stream Device Commands (SSC)
working draft, dated November 11, 1997.
Code Description Type Description
---- -------------------------------------- ---- -----------
NRZI Non return to zero, change on ones R Reel-to-reel
GCR Group code recording C Cartridge
PE Phase encoded CS Cassette
IMFM Inverted modified frequency modulation
MFM Modified frequency modulation
DDS DAT data storage
RLL Run length limited
PRML Partial Response Maximum Likelihood
NOTES
1. Serial recorded.
2. Parallel recorded.
3. Old format known as QIC-11.
5. Helical scan.
6. This is not an American National Standard. The reference is based on
an industry standard definition of the media format.
7. DLT recording: serially recorded track pairs (DLTapeIII and
DLTapeIV(20)), or track quads (DLTapeIV(35) and DLTapeIV(40)).
8. Super DLT (SDLT) recording: 56 serially recorded logical tracks with
8 physical tracks each.
ENVIRONMENT
TAPE
This is the pathname of the tape drive.
The default (if the variable is unset, but not if it is null) is
/dev/nsa0
It may be overridden with the
-f
option.
FILES
/dev/*wt*
QIC-02/QIC-36 magnetic tape interface
/dev/*sa[0-9]*
SCSI magnetic tape interface
DIAGNOSTICS
The exit status will be 0 when the drive operations were successful,
2 when the drive operations were unsuccessful, and 1 for other
problems like an unrecognized command or a missing drive device.
Extensions regarding the
st(4)
driver appeared in
BSD 386 0.1
as a separate
st
command, and have been merged into the
command in
Fx 2.1 .
The former
eof
command that used to be a synonym for
weof
has been abandoned in
Fx 2.1
since it was often confused with
eom
which is fairly dangerous.
BUGS
The utility cannot be interrupted or killed during a long erase
(which can be longer than an hour), and it is easy to forget
that the default erase is long.
Hardware block numbers do not always correspond to blocks on the tape
when the drive uses internal compression.
Erasure is not guaranteed if the tape is not at its beginning.
Tape-related documentation is poor, here and elsewhere.