Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sbin / atacontrol / atacontrol.8
1 .\"
2 .\" Copyright (c) 2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD: src/sbin/atacontrol/atacontrol.8,v 1.13.2.7 2003/01/26 03:01:09 keramida Exp $
27 .\"
28 .Dd May 17, 2001
29 .Dt ATACONTROL 8
30 .Os
31 .Sh NAME
32 .Nm atacontrol
33 .Nd ATA device driver control program
34 .Sh SYNOPSIS
35 .Nm
36 .Aq Ar command
37 .Ar args
38 .Pp
39 .Nm
40 .Ic attach
41 .Ar channel
42 .Nm
43 .Ic detach
44 .Ar channel
45 .Nm
46 .Ic reinit
47 .Ar channel
48 .Nm
49 .Ic create
50 .Ar type Oo Ar interleave Oc Ar disk0 ... diskN
51 .Nm
52 .Ic delete
53 .Ar raid
54 .Nm
55 .Ic rebuild
56 .Ar raid
57 .Nm
58 .Ic status
59 .Ar raid
60 .Nm
61 .Ic mode
62 .Ar channel
63 .Op Ar mastermode slavemode
64 .Nm
65 .Ic info
66 .Ar channel
67 .Nm
68 .Ic cap
69 .Ar channel device
70 .Nm
71 .Ic enclosure
72 .Ar channel device
73 .Nm
74 .Ic list
75 .Sh DESCRIPTION
76 The
77 .Nm
78 utility is a control program that provides the user access and control to the
79 .Fx
80 .Xr ata 4
81 subsystem.
82 .Pp
83 The
84 .Nm
85 utility
86 can cause severe system crashes and loss of data if used improperly.
87 Please
88 exercise caution when using this command!
89 .Pp
90 The
91 .Ar channel
92 argument is the number of the ATA channel on which to operate.
93 The following commands are supported:
94 .Bl -tag -width "rebuild"
95 .It Ic attach
96 Attach an ATA
97 .Ar channel .
98 Devices on the channel are probed and attached as
99 is done on boot.
100 .It Ic detach
101 Detach an ATA
102 .Ar channel .
103 Devices on the channel are removed from the kernel,
104 and all outstanding transfers etc. are returned back to the system marked
105 as failed.
106 .It Ic reinit
107 Reinitialize an ATA
108 .Ar channel .
109 Both devices on the channel are reset and
110 initialized to the parameters the ATA driver has stored internally.
111 Devices that have gone bad and no longer respond to the probe, or devices
112 that have physically been removed, are removed from the kernel.
113 Likewise are devices that show up during a reset, probed and attached.
114 .It Ic create
115 Create a
116 .Ar type
117 ATA RAID.
118 The type can be
119 .Cm RAID0
120 (stripe),
121 .Cm RAID1
122 (mirror),
123 .Cm RAID0+1
124 or
125 .Cm SPAN
126 (JBOD).
127 In case the RAID has a
128 .Cm RAID0
129 component,
130 the
131 .Ar interleave
132 must be specified in number of sectors.
133 The RAID will be created
134 of the individual disks named
135 .Bk -words
136 .Ar disk0 ... diskN .
137 .Ek
138 .Pp
139 Although the ATA driver allows for creating an ATA RAID on disks with any
140 controller, there are restrictions.
141 It is only possible to boot on
142 an array if it is either located on a
143 .Dq real
144 ATA RAID controller like
145 the Promise or Highpoint controllers, or if the RAID declared is of
146 .Cm RAID1
147 or
148 .Cm SPAN
149 type; in case of a
150 .Cm SPAN ,
151 the partition to boot must
152 reside on the first disk in the SPAN.
153 .It Ic delete
154 Delete a RAID array on a RAID capable ATA controller.
155 .It Ic rebuild
156 Rebuild a RAID1 array on a RAID capable ATA controller.
157 .It Ic status
158 Get the status of an ATA RAID.
159 .It Ic mode
160 Without the two mode arguments, the current transfer modes of both
161 devices are printed.
162 If the mode arguments are given, the ATA driver
163 is asked to change the transfer modes to those given.
164 The ATA driver
165 will reject modes that are not supported by the hardware.
166 Modes are given like
167 .Dq Li PIO3 ,
168 .Dq Li udma2 ,
169 .Dq Li udma100 ,
170 case does not matter.
171 If one of the devices mode should not be changed, use a nonexisting mode
172 as argument (i.e.\&
173 .Dq Li XXX ) ,
174 and the mode will remain unchanged.
175 .Pp
176 Currently supported modes are:
177 .Cm BIOSDMA ,
178 .Cm PIO0
179 (alias
180 .Cm BIOSPIO ) ,
181 .Cm PIO1 , PIO2 , PIO3 , PIO4 ,
182 .Cm WDMA2 ,
183 .Cm UDMA2
184 (alias
185 .Cm UDMA33 ) ,
186 .Cm UDMA4
187 (alias
188 .Cm UDMA66 ) ,
189 .Cm UDMA5
190 (alias
191 .Cm UDMA100 )
192 and
193 .Cm UDMA6
194 (alias
195 .Cm UDMA133 ) .
196 .It Ic info
197 Show info about the attached devices on the
198 .Ar channel .
199 The device name and manufacture/version strings are shown.
200 .It Ic cap
201 Show detailed info about the device on
202 .Ar channel device
203 where device is 0 for master and 1 for slave.
204 .It Ic enclosure
205 Show detailed info about the enclosure on
206 .Ar channel device
207 where device is 0 for master and 1 for slave.
208 Fan RPM speed, enclosure temperature, 5V and 12V levels are shown.
209 .It Ic list
210 Show info about all attached devices on all active controllers.
211 .El
212 .Sh EXAMPLES
213 To see the devices' current access modes, use the command line:
214 .Pp
215 .Dl "atacontrol mode 0"
216 .Pp
217 which results in the modes of the devices being displayed as a string
218 like this:
219 .Bd -literal -offset indent
220 Master = WDMA2
221 Slave  = PIO4
222 .Ed
223 .Pp
224 This means that ata0-master is in DMA mode,
225 ata0-slave is in PIO mode,
226 and so forth.
227 You can set the mode with
228 .Nm
229 and a string like the above,
230 for example:
231 .Pp
232 .Dl "atacontrol mode 0 PIO4 PIO4"
233 .Pp
234 The new modes are set as soon as the
235 .Nm
236 command returns.
237 .Sh SEE ALSO
238 .Xr ata 4
239 .Sh HISTORY
240 The
241 .Nm
242 utility first appeared in
243 .Fx 4.6 .
244 .Sh AUTHORS
245 .An -nosplit
246 The
247 .Nm
248 utility was written by
249 .An S\(/oren Schmidt
250 .Aq sos@FreeBSD.org .
251 .Pp
252 This manual page was written by
253 .An S\(/oren Schmidt
254 .Aq sos@FreeBSD.org .