81b385225d2046e6884943ddfc9d5ac7ee9291e1
[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 .\" $DragonFly: src/sbin/atacontrol/atacontrol.8,v 1.2 2003/06/17 04:27:32 dillon Exp $
28 .\"
29 .Dd May 17, 2001
30 .Dt ATACONTROL 8
31 .Os
32 .Sh NAME
33 .Nm atacontrol
34 .Nd ATA device driver control program
35 .Sh SYNOPSIS
36 .Nm
37 .Aq Ar command
38 .Ar args
39 .Pp
40 .Nm
41 .Ic attach
42 .Ar channel
43 .Nm
44 .Ic detach
45 .Ar channel
46 .Nm
47 .Ic reinit
48 .Ar channel
49 .Nm
50 .Ic create
51 .Ar type Oo Ar interleave Oc Ar disk0 ... diskN
52 .Nm
53 .Ic delete
54 .Ar raid
55 .Nm
56 .Ic rebuild
57 .Ar raid
58 .Nm
59 .Ic status
60 .Ar raid
61 .Nm
62 .Ic mode
63 .Ar channel
64 .Op Ar mastermode slavemode
65 .Nm
66 .Ic info
67 .Ar channel
68 .Nm
69 .Ic cap
70 .Ar channel device
71 .Nm
72 .Ic enclosure
73 .Ar channel device
74 .Nm
75 .Ic list
76 .Sh DESCRIPTION
77 The
78 .Nm
79 utility is a control program that provides the user access and control to the
80 .Fx
81 .Xr ata 4
82 subsystem.
83 .Pp
84 The
85 .Nm
86 utility
87 can cause severe system crashes and loss of data if used improperly.
88 Please
89 exercise caution when using this command!
90 .Pp
91 The
92 .Ar channel
93 argument is the number of the ATA channel on which to operate.
94 The following commands are supported:
95 .Bl -tag -width "rebuild"
96 .It Ic attach
97 Attach an ATA
98 .Ar channel .
99 Devices on the channel are probed and attached as
100 is done on boot.
101 .It Ic detach
102 Detach an ATA
103 .Ar channel .
104 Devices on the channel are removed from the kernel,
105 and all outstanding transfers etc. are returned back to the system marked
106 as failed.
107 .It Ic reinit
108 Reinitialize an ATA
109 .Ar channel .
110 Both devices on the channel are reset and
111 initialized to the parameters the ATA driver has stored internally.
112 Devices that have gone bad and no longer respond to the probe, or devices
113 that have physically been removed, are removed from the kernel.
114 Likewise are devices that show up during a reset, probed and attached.
115 .It Ic create
116 Create a
117 .Ar type
118 ATA RAID.
119 The type can be
120 .Cm RAID0
121 (stripe),
122 .Cm RAID1
123 (mirror),
124 .Cm RAID0+1
125 or
126 .Cm SPAN
127 (JBOD).
128 In case the RAID has a
129 .Cm RAID0
130 component,
131 the
132 .Ar interleave
133 must be specified in number of sectors.
134 The RAID will be created
135 of the individual disks named
136 .Bk -words
137 .Ar disk0 ... diskN .
138 .Ek
139 .Pp
140 Although the ATA driver allows for creating an ATA RAID on disks with any
141 controller, there are restrictions.
142 It is only possible to boot on
143 an array if it is either located on a
144 .Dq real
145 ATA RAID controller like
146 the Promise or Highpoint controllers, or if the RAID declared is of
147 .Cm RAID1
148 or
149 .Cm SPAN
150 type; in case of a
151 .Cm SPAN ,
152 the partition to boot must
153 reside on the first disk in the SPAN.
154 .It Ic delete
155 Delete a RAID array on a RAID capable ATA controller.
156 .It Ic rebuild
157 Rebuild a RAID1 array on a RAID capable ATA controller.
158 .It Ic status
159 Get the status of an ATA RAID.
160 .It Ic mode
161 Without the two mode arguments, the current transfer modes of both
162 devices are printed.
163 If the mode arguments are given, the ATA driver
164 is asked to change the transfer modes to those given.
165 The ATA driver
166 will reject modes that are not supported by the hardware.
167 Modes are given like
168 .Dq Li PIO3 ,
169 .Dq Li udma2 ,
170 .Dq Li udma100 ,
171 case does not matter.
172 If one of the devices mode should not be changed, use a nonexisting mode
173 as argument (i.e.\&
174 .Dq Li XXX ) ,
175 and the mode will remain unchanged.
176 .Pp
177 Currently supported modes are:
178 .Cm BIOSDMA ,
179 .Cm PIO0
180 (alias
181 .Cm BIOSPIO ) ,
182 .Cm PIO1 , PIO2 , PIO3 , PIO4 ,
183 .Cm WDMA2 ,
184 .Cm UDMA2
185 (alias
186 .Cm UDMA33 ) ,
187 .Cm UDMA4
188 (alias
189 .Cm UDMA66 ) ,
190 .Cm UDMA5
191 (alias
192 .Cm UDMA100 )
193 and
194 .Cm UDMA6
195 (alias
196 .Cm UDMA133 ) .
197 .It Ic info
198 Show info about the attached devices on the
199 .Ar channel .
200 The device name and manufacture/version strings are shown.
201 .It Ic cap
202 Show detailed info about the device on
203 .Ar channel device
204 where device is 0 for master and 1 for slave.
205 .It Ic enclosure
206 Show detailed info about the enclosure on
207 .Ar channel device
208 where device is 0 for master and 1 for slave.
209 Fan RPM speed, enclosure temperature, 5V and 12V levels are shown.
210 .It Ic list
211 Show info about all attached devices on all active controllers.
212 .El
213 .Sh EXAMPLES
214 To see the devices' current access modes, use the command line:
215 .Pp
216 .Dl "atacontrol mode 0"
217 .Pp
218 which results in the modes of the devices being displayed as a string
219 like this:
220 .Bd -literal -offset indent
221 Master = WDMA2
222 Slave  = PIO4
223 .Ed
224 .Pp
225 This means that ata0-master is in DMA mode,
226 ata0-slave is in PIO mode,
227 and so forth.
228 You can set the mode with
229 .Nm
230 and a string like the above,
231 for example:
232 .Pp
233 .Dl "atacontrol mode 0 PIO4 PIO4"
234 .Pp
235 The new modes are set as soon as the
236 .Nm
237 command returns.
238 .Sh SEE ALSO
239 .Xr ata 4
240 .Sh HISTORY
241 The
242 .Nm
243 utility first appeared in
244 .Fx 4.6 .
245 .Sh AUTHORS
246 .An -nosplit
247 The
248 .Nm
249 utility was written by
250 .An S\(/oren Schmidt
251 .Aq sos@FreeBSD.org .
252 .Pp
253 This manual page was written by
254 .An S\(/oren Schmidt
255 .Aq sos@FreeBSD.org .