xref: /netbsd/sbin/scsictl/scsictl.8 (revision c4a72b64)
1.\"	$NetBSD: scsictl.8,v 1.17 2002/10/03 15:41:47 wiz Exp $
2.\"
3.\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
8.\" NASA Ames Research Center.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\" 3. All advertising materials mentioning features or use of this software
19.\"    must display the following acknowledgement:
20.\"        This product includes software developed by the NetBSD
21.\"        Foundation, Inc. and its contributors.
22.\" 4. Neither the name of The NetBSD Foundation nor the names of its
23.\"    contributors may be used to endorse or promote products derived
24.\"    from this software without specific prior written permission.
25.\"
26.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36.\" POSSIBILITY OF SUCH DAMAGE.
37.\"
38.Dd September 3, 2002
39.Dt SCSICTL 8
40.Os
41.Sh NAME
42.Nm scsictl
43.Nd a program to manipulate SCSI devices and busses
44.Sh SYNOPSIS
45.Nm
46.Ar device
47.Ar command
48.Oo
49.Ar arg Oo ...
50.Oc
51.Oc
52.Sh DESCRIPTION
53.Nm
54allows a user or system administrator to issue commands to and otherwise
55control SCSI devices and busses.
56It is used by specifying a device or bus to manipulate,
57the command to perform, and any arguments the command may require.
58.Nm
59determines if the specified device is an actual device or a SCSI bus
60automatically, and selects the appropriate command set.
61.Pp
62For commands which
63.Nm
64issues a SCSI command to the device directly, any returned sense information
65will be decoded by
66.Nm
67and displayed to the standard output.
68.Sh DEVICE COMMANDS
69The following commands are supported for SCSI devices:
70.Pp
71.Nm format
72.Oo blocksize
73.Oo immediate
74.Oc
75.Oc
76.Pp
77(Low level) format the named device.
78If the optional
79.Li blocksize
80parameter is provided, the device geometry will be modified to
81use the specified
82.Li blocksize .
83If this parameter is different form the Current or Default Mode Page 3
84parameters, the device will update Mode Page 3 at the successful
85completion of the Format.
86Device geometry may change as a result of using a new device
87.Li blocksize .
88When the optional
89.Li blocksize
90parameter is specified, the Defect List on the drive will revert to
91the original primary defect list created at the time of manufacture
92if available.
93The drive will usually recertify itself during the Format
94and add any other defective blocks to the new Defect List.
95Some disks may not support the ability to change the blocksize and
96may enter a Degraded Mode when fed a Format command of this type.
97If this happens the standard recovery for the drive requires issuing
98a correct Format command, i.e. one without the blocksize parameter.
99.Pp
100When the
101.Li immediate
102parameter is also specified, the disk is instructed to return from the
103format command right away.
104It continues to format, and every ten seconds
105.Nm
106issues a TEST UNIT READY command to check the associated sense data.
107This associated sense data has a progress indicator which indicates
108how far the format is progressing.
109Note well that most SCSI disk drives prior to
110a few years ago do not support this option.
111.Pp
112.Nm identify
113.Pp
114Identify the specified device, displaying the device's SCSI
115bus, target, and lun, as well as the device's vendor, product,
116and revision strings.
117.Pp
118.Nm reassign
119.Ar blkno
120.Oo blkno Oo ...
121.Oc
122.Oc
123.Pp
124Issues a
125.Li REASSIGN BLOCKS
126command to the device, adding the specified blocks to the
127grown defect list.
128This command is only supported on direct access devices.
129.Pp
130.Nm release
131.Pp
132Send a
133.Dq RELEASE
134command to the device to release a reservation on it.
135.Pp
136.Nm reserve
137.Pp
138Send a
139.Dq RESERVE
140command to the device to place a reservation on it.
141.Pp
142.Nm reset
143.Pp
144Reset the device.
145This command is only supported for devices which support the
146.Li SCIOCRESET
147ioctl.
148.Pp
149.Nm start
150.Pp
151Send a
152.Dq START
153command to the device.
154This is useful typically only for disk devices.
155.Pp
156.Nm stop
157.Pp
158Send a
159.Dq STOP
160command to the device.
161This is useful typically only for disk devices.
162.Pp
163.Nm tur
164.Pp
165Send a
166.Dq TEST UNIT READY
167command to the device.
168This is useful for generating current device status.
169.Pp
170.Nm getcache
171.Pp
172Returns basic cache parameters for the device.
173.Pp
174.Nm setcache
175.Ar none|r|w|rw
176.Op Ar save
177.Pp
178Set basic cache parameters for the device.
179The cache may be disabled
180.Pq none ,
181the read cache enabled
182.Pq r ,
183the write cache enabled
184.Pq w ,
185or both read and write cache enabled
186.Pq rw .
187If the drive's cache parameters are savable, specifying
188.Ar save
189after the cache enable state will cause the parameters to be saved in
190non-volatile storage.
191.Sh BUS COMMANDS
192The following commands are supported for SCSI busses:
193.Pp
194.Nm reset
195.Pp
196Reset the SCSI bus.
197This command is only supported if the host adapter supports the
198.Li SCBUSIORESET
199ioctl.
200.Pp
201.Nm scan
202.Ar target
203.Ar lun
204.Pp
205Scan the SCSI bus for devices.
206This is useful if a device was not connected or powered
207on when the system was booted.
208The
209.Ar target
210and
211.Ar lun
212arguments specify which SCSI target and lun on the bus is to be scanned.
213Either may be wildcarded by specifying the keyword
214.Dq any
215or
216.Dq all .
217.Pp
218.Nm detach
219.Ar target
220.Ar lun
221.Pp
222Detach the specified device from the bus.
223Useful if a device is powered down after use.
224The
225.Ar target
226and
227.Ar lun
228arguments have the same meaning as for the
229.Nm scan
230command, and may also be wildcarded.
231.Sh NOTES
232When scanning the SCSI bus, information about newly recognized devices
233is printed to console.
234No information is printed for already probed devices.
235.Sh FILES
236.Pa /dev/scsibus*
237- for commands operating on SCSI busses
238.Sh SEE ALSO
239.Xr ioctl 2 ,
240.Xr cd 4 ,
241.Xr ch 4 ,
242.Xr sd 4 ,
243.Xr se 4 ,
244.Xr ss 4 ,
245.Xr st 4 ,
246.Xr uk 4
247.Sh HISTORY
248The
249.Nm
250command first appeared in
251.Nx 1.4 .
252.Sh AUTHORS
253The
254.Nm
255command was written by Jason R. Thorpe of the Numerical Aerospace Simulation
256Facility, NASA Ames Research Center.
257