scsi - program to assist with SCSI devices
scsi -f device -d debug_level
scsi -f device [-v] -z seconds
scsi -f device -m page [-P pc] [-e]
scsi -f device -p [-b bus] [-l lun]
scsi -f device -r [-b bus] [-t targ] [-l lun]
scsi -f device [-v] [-s seconds] -c cmd_fmt [arg ...] -o
[arg ...] -i count in_fmt
The scsi program is used to send commands to a SCSI device.
It is also a
sample usage of the user-level SCSI commands. out_fmt can
be `-' to read
output data from stdin; in_fmt can be `-' to write input data to stdout.
The options are as follows:
Specifies the device that should be opened, i.e.,
Sets the SCSI kernel debug level. The kernel must
have been compiled
with the SCSIDEBUG option. See
figure out what to set the kernel debug level to.
Freezes all activity on all SCSI busses for a given
seconds. If -v is also specified, a BEL character
is sent to the
standard output at the start and finish of the bus
requires that the kernel be built with the SCSI_FREEZE kernel option.
This kernel code is not committed yet.
Read a device mode page. The file
read to discover how to interpret the mode data.
variable SCSI_MODES can specify a different file to
-P pc Specify a page control field. The page control
0 Current Values
1 Changeable Values
2 Default Values
3 Saved Values
-e Permits you to edit the fields. It will use the editor specified
by your EDITOR environment variable. To store
edit page control 3 using the -P flag.
-p Can be used against the "super scsi" device
probe all devices with a given SCSI lun on a given
SCSI bus. The
bus can be selected with the -b option and the default is 0. The
lun can be selected with the -l option and the default is 0. See
scsi(4) for a description of the "super scsi" device.
-r Can be used in FreeBSD 1.1 to reprobe a specific SCSI device at a
given Bus, Target and Lun. This is not needed in
since opening a fixed SCSI device has the side effect of reprobing
it, and probing with the bus with the -p option
on line any newly found devices. See scsi(4) for a
of fixed SCSI devices.
-c Permits you to send user-level SCSI commands specified on the
command line to a device. The command is sent using
SCIOCCOMMAND ioctl, so the device you are accessing
this ioctl. See scsi(4) for full details of which
permit the ioctl, and scsi(3) for the full details
on how to
build up the commands and data phases using the format arguments.
-v Turns on more verbose information.
Sets the command timeout to seconds. The default is
Specifies the command as described in scsi(3). The
arguments provide values for any variables specified
in the command
-o count out_fmt arg ...
Indicates that this is a data out command (i.e., data will be
sent from the system to the device) with count bytes
The data out is built up using the facilities described in
scsi(3) using the provided arguments to fill in any
out_fmt can be specified as a hyphen (`-')
that count bytes of data should be read from the
-i count in_fmt arg ...
Indicates that this is a data in command (i.e., data
will be read
from the device into the system) with count bytes of
in. The information is extracted according to
in_fmt using the
facilities described in scsi(3) and displayed on the
output. in_fmt can be specified as a hyphen (`-')
that count bytes of data input should be written to
The SU_DEBUG_OUTPUT variable can be set to a file to send
to that file.
The SU_DEBUG_LEVEL variable can be set to a non-zero integer
the level of debugging. Currently this is an on or off
thing; it should
perhaps use the ioctl to set the debug level in the kernel
and then set
it back to zero at program exit.
The SU_DEBUG_TRUNCATE variable can be set to an integer to
amount of data phase output sent to the debugging file.
The EDITOR variable determines the editor to use for the
To verify that the device type for the disk /dev/rsd0c is 0
# scsi -f /dev/rsd0c -c "12 0 0 0 64 0" -i 64 "*b3 b5"
To do an inquiry to /dev/rsd2c:
# scsi -f /dev/rsd2c -c "12 0 0 0 64 0" -i 64 "s8 z8 z16 z4"
FUJITSU M2654S-512 010P
To edit mode page 1 on /dev/rsd2c and store it permanently
on the drive
(set AWRE and ARRE to 1 to enable bad block remapping):
# scsi -f /dev/rsd2c -m 1 -e -P 3
The scsi command appeared in 386BSD 0.1.2.4/FreeBSD to support the new
reprobe and user SCSI commands.
Some devices respond to an inquiry for all LUNS. This will
cause them to
come on line to 8 times during reprobe to different logical
-f /dev/rsd0c -c "4 0 0 0 0 0" permits anyone who can write
to format the disk drive.
OpenBSD 3.6 October 11, 1993
[ Back ]