shithub: riscv

ref: ffb48be969338833a69e576e7d62353bbd831226
dir: /sys/man/8/scuzz/

View raw version
.TH SCUZZ 8
.SH NAME
scuzz \- SCSI target control
.SH SYNOPSIS
.B scuzz
[
.B -6eq
] [
.B -m
.I max-xfer
] [
[
.B -r
]
.I sddev
]
.SH DESCRIPTION
.I Scuzz
is an interactive program for exercising
raw SCSI devices.
Its intended purpose is to investigate and manipulate
odd devices without the effort of writing a special driver,
such as shuffling the media around on an optical jukebox.
It reads commands from standard input and applies them to a SCSI target
(other devices accessed through the
.IR sd (3)
interface,
such as ATA(PI) devices,
may also work).
If
.I sddev
is given on the command line, an
.B open
(see below)
is immediately applied to the target.
On successful completion of a command,
.BI ok " n
is printed, where
.I n
is the number of bytes transferred to/from the target;
the
.B -q
command line option suppresses the
.B ok
message.
.LP
The
.B -6
forces the use of 6-byte SCSI commands rather than 10-byte ones.
Some older devices require this, though
.I scuzz
attempts to adapt automatically.
The
.B -e
makes
.I scuzz
more willing to retry I/O errors but less tolerant of other errors
and implies
.BR -6 .
This option is often needed to read Exabyte 8mm tapes.
The
.B -m
option sets the maximum I/O transfer size to
.IR max-xfer .
Exabyte drives often require this to be 1024 or the exact tape block size
and some 4mm drives require this to be the exact tape block size or larger.
.SS Commands
.TF "inquiry"
.PD
.TP
.BI help " command
.B Help
is rudimentary and prints a one line synopsis for the named
.IR command ,
or for all commands if no argument is given.
.TP
.B probe
.B Probe
attempts an
.B inquiry
command on all SCSI units,
and prints the result preceded by the name of those
targets which respond.
.LP
The
.B help
and
.B probe
commands may be given at any time.
.TF "inquiry"
.PD
.TP
.BI open\ [ -r ] sddev
.B Open
must be given before any of the remaining commands will be accepted.
Internally,
unless the
.B -r
option is given,
.B open
issues
.B ready
then
.BR inquiry ,
followed by a device class-specific command to determine the
logical block size of the target.
.I Sddev
is an
.IR sd (3)
device directory like
.IR /dev/sdC0 .
.TP
.B close
.B Close
need only be given if another target is to be opened in the current
session.
.LP
The remaining commands are in rough groups,
intended for specific classes of device.
With the exception of the
.BR read ,
.BR write ,
and
.B space
commands,
all arguments are in the style of ANSI-C integer constants.
.TF "inquiry"
.PD
.TP
.B ready
Test Unit Ready
checks if the unit is powered up and ready to do
.B read
and
.B write
commands.
.TP
.B rezero
Rezero
Unit requests that a disk be brought to a known state,
usually by seeking to track zero.
.TP
.B rewind
.B Rewind
positions a tape at the beginning of current partition
(there is usually only one partition, the beginning of tape).
.TP
.B reqsense
Request Sense retrieves Sense Data concerning an error or
other condition and is usually issued following the completion of a command
that had check-condition status.
.I Scuzz
automatically issues a
.B reqsense
in response to a check-condition status and prints the result.
.TP
.B format
Format
Unit performs a ``low level'' format of a disk.
.TP
.B rblimits
Read Block Limits
reports the possible block lengths for the logical unit. Tapes only.
.TP
.BI read " file nbytes
.B Read
transfers data from the target to the host.
A missing
.I nbytes
causes the entire device to be read.
.TP
.BI write " file nbytes
.B Write
transfers data from the host to the target.
A missing
.I nbytes
causes the entire input file to be transferred.
.IP
The first argument to the
.BR read
and
.BR write
commands specifies a source
.RB ( write )
or destination
.RB ( read )
for the I/O.
The argument is either a plain file name or
.B |
followed by a command to be executed by
.IR rc (1).
The argument may be quoted in the style of
.IR rc (1).
.TP
.BI seek " offset whence
.B Seek
requests the target to seek to a position on a disk,
arguments being in the style of
.IR seek (2);
.I whence
is 0 by default.
.IP
.I Scuzz
maintains an internal notion of where the current target
is positioned.
The
.BR seek ,
.BR read ,
.BR write ,
.BR rewind ,
.BR rezero ,
and
.B wtrack
commands all manipulate the internal offset.
.TP
.BI filemark " howmany
Write Filemarks
writes one (default) or more filemarks on a tape.
.TP
.BI space\ [ -b ]\ [ -f ]\ [[ "--\fP]\fIhowmany\fP]"
.B Space
positions a tape forwards or backwards.
The arguments
specify logical block
.RB ( -b )
or
filemark
.RB ( -f )
spacing;
default is
.BR -b .
If
.I howmany
is negative
it specifies spacing backwards,
and should be preceded by
.B --
to turn off any further
option processing.
Default is 1.
.TP
.B inquiry
.B Inquiry
is issued to determine the device type of a particular target,
and to determine some basic information about the implemented options and
the product name.
.TP
.BI modeselect bytes...
.TP
.BI modeselect6 bytes...
Mode
Select
is issued to set variable parameters in the target.
.I Bytes
given as arguments comprise all the data for the target;
see an appropriate manual for the format.
The default is the 10-byte form of the command;
modeselect6 is the 6-byte version.
.TP
.BI modesense\ [ page [ nbytes ]]
.TP
.BI modesense6\ [ page [ nbytes ]]
Mode
Sense
reports variable and fixed parameters from the target.
If no
.I page
is given,
all pages are returned.
.I Nbytes
specifies how many bytes should be returned.
The default is the 10-byte form of the command;
modesense6 is the 6-byte version.
.TP
.BI start\ [ code ]
.TP
.BI stop\ [ code ]
.TP
.BI eject\ [ code ]
.TP
.BI ingest\ [ code ]
.BR Start ,
.BR stop ,
.BR eject ,
and
.B ingest
are synonyms for Start/Stop Unit with different default values of
.IR code .
Start/Stop Unit is typically used to spin up and spin down a rotating
disk drive.
.I Code
is 0 to stop,
1 to start and
3 to eject (if the device supports ejection of the medium).
.TP
.B capacity
Read Capacity reports the number of blocks and the block
size of a disk.
.LP
The following commands are specific to CD and CD-R/RW devices.
A brief description of each is given; see the SCSI-3
Multimedia Commands (MMC) Specification for details of arguments
and interpretation of the results.
.TF "inquiry"
.PD
.TP
.BI blank\ [ track/LBA [ type ]]
Erase a CD-RW disk.
Type identifies the method and coverage of the blanking.
.TP
.BI rtoc\ [ track/session-number [ ses ]]
The Read TOC/PMA command transfers data from one of the tables of contents
(TOC or PMA) on the CD medium.
.TP
.B rdiscinfo
(Note the spelling.)
Provides information about disks, including incomplete CD-R/RW.
.TP
.BI rtrackinfo\ [ track ]
Provides information about a track, regardless of its status.
.TP
.B cdpause
.TP
.B cdresume
Pause/resume playback.
.TP
.B cdstop
Stop playback.
.TP
.BI cdplay\ [ track-number ]\ or\ [ -r [ "LBA\fP[\fIlength\fP]]]"
Play audio.
With no arguments, starts at the beginning of the medium.
If a track number is given, the table of contents is read
to find the playback start point.
If the
.B -r
option is given, block addressing is used to find the
playback start point.
.TP
.BI cdload\ [ slot ]
.TP
.BI cdunload\ [ slot ]
Load/unload a disk from a changer.
.TP
.B cdstatus
Read the mechanism status.
.LP
The following commands are specific to Media Changer devices.
A brief description of each is given; see the SCSI-3
Medium Changer Commands (SMC) Specification for details of arguments.
.TF "inquiry"
.PD
.TP
.B einit
Initialize element status.
.TP
.BI "estatus " "type " [ length ]
Report the status of the internal elements.
Type 0 reports all element types.
.TP
.BI "mmove " transport\ source\ destination [ invert ]
Move medium.
.SH FILES
.TF /dev/sdXX/raw
.TP
.B /dev/\fIsdXX\fP/raw
raw SCSI interface for command, I/O, and status.
.SH SOURCE
.B /sys/src/cmd/scuzz
.SH "SEE ALSO"
.IR sd (3)
.br
.IR "Small Computer System Interface - 2 (X3T9.2/86-109)" ,
Global Engineering Documents
.br
.IR "SCSI Bench Reference" ,
ENDL Publications
.br
.IR "SCSI-3 Multimedia Commands (MMC) Specification" ,
www.t10.org
.br
.IR "SCSI-3 Medium Changer Commands (SMC) Specification" ,
www.t10.org
.SH BUGS
Only a limited subset of SCSI commands has been implemented (as needed).
.LP
Only one target can be open at a time.
.LP
LUNs other than 0 are not supported.
.LP
No way to force 10-byte commands, though they are the default.
.LP
Should be recoded to use
.IR scsi (2)
in order to get more complete sense code descriptions.
.LP
.I Scuzz
betrays its origins by spelling
.B rdiscinfo
with a
.B c
even though the devices it manipulates are spelled with a
.BR k .
.LP
The
.I max-xfer
value is currently limited to 245760
to limit kernel memory consumption.
.LP
It may be necessary to set
.I max-xfer
to exactly the block size used to write a tape
in order to read it on some drives.