2007-01-23 23:34:17 +03:00
|
|
|
.\" $NetBSD: scsictl.8,v 1.24 2007/01/23 20:34:17 wiz Exp $
|
1998-10-16 01:44:39 +04:00
|
|
|
.\"
|
2002-09-03 20:56:05 +04:00
|
|
|
.\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
|
1998-10-16 01:44:39 +04:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
|
|
|
|
.\" NASA Ames Research Center.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2007-01-23 23:34:17 +03:00
|
|
|
.Dd January 22, 2007
|
1998-10-16 01:44:39 +04:00
|
|
|
.Dt SCSICTL 8
|
2001-06-05 15:22:41 +04:00
|
|
|
.Os
|
1998-10-16 01:44:39 +04:00
|
|
|
.Sh NAME
|
|
|
|
.Nm scsictl
|
|
|
|
.Nd a program to manipulate SCSI devices and busses
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Ar device
|
|
|
|
.Ar command
|
|
|
|
.Oo
|
|
|
|
.Ar arg Oo ...
|
|
|
|
.Oc
|
|
|
|
.Oc
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
allows a user or system administrator to issue commands to and otherwise
|
2002-10-03 19:41:44 +04:00
|
|
|
control SCSI devices and busses.
|
|
|
|
It is used by specifying a device or bus to manipulate,
|
|
|
|
the command to perform, and any arguments the command may require.
|
1998-10-16 01:44:39 +04:00
|
|
|
.Nm
|
|
|
|
determines if the specified device is an actual device or a SCSI bus
|
|
|
|
automatically, and selects the appropriate command set.
|
|
|
|
.Pp
|
|
|
|
For commands which
|
|
|
|
.Nm
|
|
|
|
issues a SCSI command to the device directly, any returned sense information
|
|
|
|
will be decoded by
|
|
|
|
.Nm
|
|
|
|
and displayed to the standard output.
|
|
|
|
.Sh DEVICE COMMANDS
|
|
|
|
The following commands are supported for SCSI devices:
|
|
|
|
.Pp
|
2005-01-07 05:08:34 +03:00
|
|
|
.Nm defects
|
2005-01-07 05:13:13 +03:00
|
|
|
.Op primary
|
|
|
|
.Op grown
|
|
|
|
.Op block|byte|physical
|
2005-01-07 05:08:34 +03:00
|
|
|
.Pp
|
2005-01-07 05:13:13 +03:00
|
|
|
Read the primary and/or grown defect lists from the specified device
|
|
|
|
in block, byte from index, or physical sector format.
|
|
|
|
The default is to return both the primary and grown defect lists
|
|
|
|
in physical sector format.
|
|
|
|
This command is only supported on direct access devices.
|
2005-01-07 05:08:34 +03:00
|
|
|
.Pp
|
1999-07-30 06:29:04 +04:00
|
|
|
.Nm format
|
2002-06-26 20:04:11 +04:00
|
|
|
.Oo blocksize
|
|
|
|
.Oo immediate
|
|
|
|
.Oc
|
|
|
|
.Oc
|
|
|
|
.Pp
|
2002-10-03 19:41:44 +04:00
|
|
|
(Low level) format the named device.
|
|
|
|
If the optional
|
2002-06-26 20:04:11 +04:00
|
|
|
.Li blocksize
|
|
|
|
parameter is provided, the device geometry will be modified to
|
|
|
|
use the specified
|
2002-06-26 22:07:21 +04:00
|
|
|
.Li blocksize .
|
2002-06-26 20:04:11 +04:00
|
|
|
If this parameter is different form the Current or Default Mode Page 3
|
|
|
|
parameters, the device will update Mode Page 3 at the successful
|
2002-10-03 19:41:44 +04:00
|
|
|
completion of the Format.
|
|
|
|
Device geometry may change as a result of using a new device
|
2002-06-26 22:07:21 +04:00
|
|
|
.Li blocksize .
|
2002-06-26 20:04:11 +04:00
|
|
|
When the optional
|
|
|
|
.Li blocksize
|
|
|
|
parameter is specified, the Defect List on the drive will revert to
|
|
|
|
the original primary defect list created at the time of manufacture
|
2002-10-03 19:41:44 +04:00
|
|
|
if available.
|
|
|
|
The drive will usually recertify itself during the Format
|
|
|
|
and add any other defective blocks to the new Defect List.
|
|
|
|
Some disks may not support the ability to change the blocksize and
|
|
|
|
may enter a Degraded Mode when fed a Format command of this type.
|
|
|
|
If this happens the standard recovery for the drive requires issuing
|
|
|
|
a correct Format command, i.e. one without the blocksize parameter.
|
1999-07-30 06:29:04 +04:00
|
|
|
.Pp
|
2002-06-26 20:04:11 +04:00
|
|
|
When the
|
|
|
|
.Li immediate
|
|
|
|
parameter is also specified, the disk is instructed to return from the
|
2002-10-03 19:41:44 +04:00
|
|
|
format command right away.
|
|
|
|
It continues to format, and every ten seconds
|
2002-06-26 20:04:11 +04:00
|
|
|
.Nm
|
2002-10-03 19:41:44 +04:00
|
|
|
issues a TEST UNIT READY command to check the associated sense data.
|
|
|
|
This associated sense data has a progress indicator which indicates
|
|
|
|
how far the format is progressing.
|
|
|
|
Note well that most SCSI disk drives prior to
|
2002-06-26 20:04:11 +04:00
|
|
|
a few years ago do not support this option.
|
1999-07-30 06:29:04 +04:00
|
|
|
.Pp
|
1998-10-16 01:44:39 +04:00
|
|
|
.Nm identify
|
|
|
|
.Pp
|
|
|
|
Identify the specified device, displaying the device's SCSI
|
|
|
|
bus, target, and lun, as well as the device's vendor, product,
|
|
|
|
and revision strings.
|
|
|
|
.Pp
|
|
|
|
.Nm reassign
|
|
|
|
.Ar blkno
|
|
|
|
.Oo blkno Oo ...
|
|
|
|
.Oc
|
|
|
|
.Oc
|
|
|
|
.Pp
|
|
|
|
Issues a
|
|
|
|
.Li REASSIGN BLOCKS
|
|
|
|
command to the device, adding the specified blocks to the
|
2002-10-03 19:41:44 +04:00
|
|
|
grown defect list.
|
|
|
|
This command is only supported on direct access devices.
|
1998-10-16 01:44:39 +04:00
|
|
|
.Pp
|
2002-06-26 20:04:11 +04:00
|
|
|
.Nm release
|
|
|
|
.Pp
|
2002-06-26 22:07:21 +04:00
|
|
|
Send a
|
|
|
|
.Dq RELEASE
|
|
|
|
command to the device to release a reservation on it.
|
2002-06-26 20:04:11 +04:00
|
|
|
.Pp
|
|
|
|
.Nm reserve
|
|
|
|
.Pp
|
2002-06-26 22:07:21 +04:00
|
|
|
Send a
|
|
|
|
.Dq RESERVE
|
|
|
|
command to the device to place a reservation on it.
|
2002-06-26 20:04:11 +04:00
|
|
|
.Pp
|
1998-10-16 01:44:39 +04:00
|
|
|
.Nm reset
|
|
|
|
.Pp
|
2002-10-03 19:41:44 +04:00
|
|
|
Reset the device.
|
|
|
|
This command is only supported for devices which support the
|
1998-10-16 01:44:39 +04:00
|
|
|
.Li SCIOCRESET
|
|
|
|
ioctl.
|
2002-06-26 20:04:11 +04:00
|
|
|
.Pp
|
|
|
|
.Nm start
|
|
|
|
.Pp
|
2002-06-26 22:07:21 +04:00
|
|
|
Send a
|
|
|
|
.Dq START
|
2002-10-03 19:41:44 +04:00
|
|
|
command to the device.
|
|
|
|
This is useful typically only for disk devices.
|
2002-06-26 20:04:11 +04:00
|
|
|
.Pp
|
|
|
|
.Nm stop
|
|
|
|
.Pp
|
2002-06-26 22:07:21 +04:00
|
|
|
Send a
|
|
|
|
.Dq STOP
|
2002-10-03 19:41:44 +04:00
|
|
|
command to the device.
|
|
|
|
This is useful typically only for disk devices.
|
2002-06-26 20:04:11 +04:00
|
|
|
.Pp
|
|
|
|
.Nm tur
|
|
|
|
.Pp
|
2002-06-26 22:07:21 +04:00
|
|
|
Send a
|
|
|
|
.Dq TEST UNIT READY
|
2002-10-03 19:41:44 +04:00
|
|
|
command to the device.
|
|
|
|
This is useful for generating current device status.
|
2002-09-03 20:56:05 +04:00
|
|
|
.Pp
|
|
|
|
.Nm getcache
|
|
|
|
.Pp
|
|
|
|
Returns basic cache parameters for the device.
|
|
|
|
.Pp
|
|
|
|
.Nm setcache
|
|
|
|
.Ar none|r|w|rw
|
|
|
|
.Op Ar save
|
|
|
|
.Pp
|
2002-10-03 19:41:44 +04:00
|
|
|
Set basic cache parameters for the device.
|
|
|
|
The cache may be disabled
|
2002-09-03 20:56:05 +04:00
|
|
|
.Pq none ,
|
|
|
|
the read cache enabled
|
|
|
|
.Pq r ,
|
|
|
|
the write cache enabled
|
|
|
|
.Pq w ,
|
|
|
|
or both read and write cache enabled
|
|
|
|
.Pq rw .
|
|
|
|
If the drive's cache parameters are savable, specifying
|
|
|
|
.Ar save
|
|
|
|
after the cache enable state will cause the parameters to be saved in
|
|
|
|
non-volatile storage.
|
2003-09-01 08:24:55 +04:00
|
|
|
.Pp
|
|
|
|
.Nm flushcache
|
|
|
|
.Pp
|
|
|
|
Explicitly flushes the write cache.
|
2007-01-22 23:56:46 +03:00
|
|
|
.Pp
|
|
|
|
.Nm setspeed
|
|
|
|
.Ar speed
|
|
|
|
.Pp
|
|
|
|
Set the highest speed that the optical drive should use for reading
|
|
|
|
data.
|
|
|
|
The units are multiples of a single speed CDROM (150 KB/s).
|
|
|
|
Specify 0 to use the drive's fastest speed.
|
1998-10-16 01:44:39 +04:00
|
|
|
.Sh BUS COMMANDS
|
|
|
|
The following commands are supported for SCSI busses:
|
|
|
|
.Pp
|
|
|
|
.Nm reset
|
|
|
|
.Pp
|
2002-10-03 19:41:44 +04:00
|
|
|
Reset the SCSI bus.
|
|
|
|
This command is only supported if the host adapter supports the
|
1998-10-16 01:44:39 +04:00
|
|
|
.Li SCBUSIORESET
|
|
|
|
ioctl.
|
|
|
|
.Pp
|
|
|
|
.Nm scan
|
1998-10-16 01:51:23 +04:00
|
|
|
.Ar target
|
|
|
|
.Ar lun
|
1998-10-16 01:44:39 +04:00
|
|
|
.Pp
|
2002-10-03 19:41:44 +04:00
|
|
|
Scan the SCSI bus for devices.
|
|
|
|
This is useful if a device was not connected or powered
|
|
|
|
on when the system was booted.
|
|
|
|
The
|
1998-10-16 01:51:23 +04:00
|
|
|
.Ar target
|
|
|
|
and
|
|
|
|
.Ar lun
|
|
|
|
arguments specify which SCSI target and lun on the bus is to be scanned.
|
1999-09-29 03:32:04 +04:00
|
|
|
Either may be wildcarded by specifying the keyword
|
|
|
|
.Dq any
|
|
|
|
or
|
|
|
|
.Dq all .
|
2001-07-19 00:36:36 +04:00
|
|
|
.Pp
|
|
|
|
.Nm detach
|
|
|
|
.Ar target
|
|
|
|
.Ar lun
|
|
|
|
.Pp
|
2002-10-03 19:41:44 +04:00
|
|
|
Detach the specified device from the bus.
|
|
|
|
Useful if a device is powered down after use.
|
|
|
|
The
|
2001-07-19 00:36:36 +04:00
|
|
|
.Ar target
|
|
|
|
and
|
|
|
|
.Ar lun
|
|
|
|
arguments have the same meaning as for the
|
|
|
|
.Nm scan
|
|
|
|
command, and may also be wildcarded.
|
2000-03-07 22:27:11 +03:00
|
|
|
.Sh NOTES
|
2001-07-19 03:16:20 +04:00
|
|
|
When scanning the SCSI bus, information about newly recognized devices
|
2002-10-03 19:41:44 +04:00
|
|
|
is printed to console.
|
|
|
|
No information is printed for already probed devices.
|
1999-07-30 06:29:04 +04:00
|
|
|
.Sh FILES
|
2000-07-08 14:28:17 +04:00
|
|
|
.Pa /dev/scsibus*
|
|
|
|
- for commands operating on SCSI busses
|
1998-10-16 01:44:39 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ioctl 2 ,
|
|
|
|
.Xr cd 4 ,
|
|
|
|
.Xr ch 4 ,
|
|
|
|
.Xr sd 4 ,
|
2001-04-03 15:51:33 +04:00
|
|
|
.Xr se 4 ,
|
1998-10-16 01:44:39 +04:00
|
|
|
.Xr ss 4 ,
|
|
|
|
.Xr st 4 ,
|
2004-09-16 22:02:27 +04:00
|
|
|
.Xr uk 4 ,
|
|
|
|
.Xr atactl 8 ,
|
|
|
|
.Xr dkctl 8
|
1998-10-16 01:44:39 +04:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command first appeared in
|
|
|
|
.Nx 1.4 .
|
2001-11-16 14:26:53 +03:00
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command was written by Jason R. Thorpe of the Numerical Aerospace Simulation
|
|
|
|
Facility, NASA Ames Research Center.
|