Control SCSI and EIDE devices (QNX)
scsi_util [-n node] [[device] command]...
- -n node
- Specify node where the device to be controlled resides (not necessary
if a full path is supplied as the optional device argument).
- device
- The pathname (either full, or basename portion only) of the device
to be manipulated.
- command
- A command to perform on the selected device. For SCSI, and ATAPI or EIDE
devices controlled by Fsys.eide, the command may be:
- scan
- Scan for all devices in /dev (default)
- error
- Detail on last error logged by the driver for this device
- lock
- Lock the media in the device
- unlock
- Unlock the media in the device
- start
- Start unit (spin up device)
- stop
- Stop unit (spin down)
and in addition, the following commands are available for SCSI
devices only:
- 'defect [option]'
- Display defect list for the device. option may
be one of:
Option |
Description
|
g or G |
Display grown defect list
|
p or P |
Display primary defect list
|
Both lists are displayed if no option is specified.
Note that the defect command and its option
must be specified as a single command-line parameter to
scsi_util. This can be done by the use of quotes
on the command line (shown), or by putting a , or = character
between the command defect and the option e.g. defect=g or
defect,g.
- 'density [code]'
- Display or change density for a device. The density code is
unique for each device type. Refer to the mode parameters for
this device type in the SCSI spec. If no option is specified
the current density is displayed. Note that the density
command, like the defect command, must be specified
with its option as a single command-line parameter to
scsi_util, by the use of quotes on the command-line (shown)
or separating the command from the code with a , or =
character instead of a space.
- eject
- Eject the media from the device
- info
- Report basic SCSI information i.e.
host adapter ID, target ID, LUN ID, and device type.
- inquiry
- Issue the SCSI inquiry command to the device. For a
detailed description of the data returned, refer to the SCSI
specification.
- 'medium [type]'
- Display or change medium type for a device. The medium types
are unique for each device type. Refer to the mode parameters
for the particular device type in the SCSI spec. If no type
is specified the current type is displayed. The medium
command and the type must be specified as a single command-line
option to scsi_util, through use of command-line
quoting (shown) or by placing a , or = between the command and
the type.
- sense
- Issue a SCSI mode sense command asking for current
values of all mode pages. For a detailed description of the
data returned, see the SCSI specification.
The first command must be preceded by a device.
For subsequent commands the previous device will be
used, or a new device may optionally be specified.
The scsi_util utility is used to control SCSI devices
that require manipulation beyond what is afforded by the standard
file utilities. Such devices and read/write optical drives and
removable hard disks often must be locked, unlocked, started and
stopped by this utility.
|
Typically the permissions on the device will be such that
you will need to be root to run scsi_util. |
Scan /dev for SCSI devices:
scsi_util
Stop, unlock, and eject a removable SCSI device /dev/hd1:
scsi_util /dev/hd1 stop unlock eject
All output is written to the standard output, except when an
ioctl() fails, in which case a diagnostic
message is written to standard error.
The scsi_util utility always exits with a
status of 0.
Blkfsys,
Fsys,
Fsys.*