drm/linux/timer.h: No need to protect a callout struct from MP accesses
[dragonfly.git] / sbin / ccdconfig / ccdconfig.8
bloba1fb413b360d5bf0cbc3d2adbc8dc7118833a32f
1 .\"     $NetBSD: ccdconfig.8,v 1.1.2.1 1995/11/11 02:43:33 thorpej Exp $
2 .\"
3 .\" Copyright (c) 1995 Jason R. Thorpe.
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgment:
16 .\"     This product includes software developed for the NetBSD Project
17 .\"     by Jason R. Thorpe.
18 .\" 4. The name of the author may not be used to endorse or promote products
19 .\"    derived from this software without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\" $FreeBSD: src/sbin/ccdconfig/ccdconfig.8,v 1.9.2.10 2003/01/26 03:38:39 keramida Exp $
34 .\"
35 .Dd September 29, 2016
36 .Dt CCDCONFIG 8
37 .Os
38 .Sh NAME
39 .Nm ccdconfig
40 .Nd configuration utility for the concatenated disk driver
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl cv
44 .Ar ccd
45 .Ar ileave
46 .Op Ar flags
47 .Ar dev ...
48 .Nm
49 .Fl C
50 .Op Fl v
51 .Op Fl f Ar config_file
52 .Nm
53 .Fl u
54 .Op Fl v
55 .Ar ccd ...
56 .Nm
57 .Fl U
58 .Op Fl v
59 .Op Fl f Ar config_file
60 .Nm
61 .Fl g
62 .Op Fl M Ar core
63 .Op Fl N Ar system
64 .Op Ar ccd ...
65 .Sh DESCRIPTION
66 The
67 .Nm
68 utility is used to dynamically configure and unconfigure concatenated disk
69 devices, or ccds.
70 For more information about the ccd, see
71 .Xr ccd 4 .
72 .Pp
73 The options are as follows:
74 .Bl -tag -width indent
75 .It Fl c
76 Configure a ccd.
77 This is the default behavior of
78 .Nm .
79 .It Fl C
80 Configure all ccd devices listed in the ccd configuration file.
81 .It Fl f Ar config_file
82 When configuring or unconfiguring all devices, read the file
83 .Pa config_file
84 instead of the default
85 .Pa /etc/ccd.conf .
86 .It Fl g
87 Dump the current ccd configuration in a format suitable for use as the
88 ccd configuration file.
89 If no arguments are specified, every configured ccd is dumped.
90 Otherwise, the configuration of each listed ccd is dumped.
91 .It Fl M Ar core
92 Extract values associated with the name list from
93 .Pa core
94 instead of the default
95 .Pa /dev/mem .
96 .It Fl N Ar system
97 Use
98 .Ar system
99 as the kernel instead of the running kernel (as determined from
100 .Xr getbootfile 3 ) .
101 .It Fl u
102 Unconfigure a ccd.
103 .It Fl U
104 Unconfigure all ccd devices listed the ccd configuration file.
105 .It Fl v
106 Cause
108 to be verbose.
111 A ccd is described on the command line and in the ccd configuration
112 file by the name of the ccd, the interleave factor, the ccd configuration
113 flags, and a list of one or more devices.
114 The flags may be represented as a decimal number, a hexadecimal number,
115 a comma-separated list of strings, or the word
116 .Dq none .
117 The flags are as follows:
118 .Bd -literal -offset indent
119 CCDF_SWAP       0x01            Interleave should be dmmax
120 CCDF_UNIFORM    0x02            Use uniform interleave
121 CCDF_MIRROR     0x04            Support mirroring
122 CCDF_PARITY     0x08            Support parity (not implemented yet)
125 The format in the
126 configuration file appears exactly as if it were entered on the command line.
127 Note that on the command line and in the configuration file, the
128 .Pa flags
129 argument is optional.
130 .Bd -literal -offset indent
132 # /etc/ccd.conf
133 # Configuration file for concatenated disk devices
136 # ccd           ileave  flags   component devices
137 ccd0            16      none    /dev/da2s0e /dev/da3s0e
140 The component devices need to name partitions of type
141 .Li FS_CCD
143 .Dq ccd
144 as shown by
145 .Xr disklabel 8 ) .
146 .Sh RECOVERY
147 An error on a ccd disk is usually unrecoverable unless you are using the
148 mirroring option.
149 But mirroring has its own perils:
150 It assumes that both copies of the data at any given sector are the same.
151 This holds true
152 until a write error occurs or until you replace either side of the mirror.
153 This is a poor-man's mirroring implementation.
154 It works well enough that if
155 you begin to get disk errors you should be able to backup the ccd disk,
156 replace the broken hardware, and then regenerate the ccd disk.
157 If you need more than this you should look into external hardware RAID
158 SCSI boxes, RAID controllers such as the
159 .Xr dpt 4
160 controller, or software RAID systems such as
161 .Xr vinum 8 .
162 .Sh FILES
163 .Bl -tag -width /etc/ccd.conf -compact
164 .It Pa /etc/ccd.conf
165 default ccd configuration file
167 .Sh EXAMPLES
168 A number of
170 examples are shown below.
171 The arguments passed to
173 are exactly the same as you might place in the
174 .Pa /etc/ccd.conf
175 configuration file.
176 The first example creates a 4-disk stripe out of four SCSI disk partitions.
177 The stripe uses a 64 sector interleave.
178 The second example is an example of a complex stripe/mirror combination.
179 It reads as a two disk stripe of
180 .Pa da2s0e
182 .Pa da3s0e
183 which is mirrored to a two disk stripe of
184 .Pa da4s0e
186 .Pa da5s0e .
187 The last example is a simple mirror.
188 .Pa /dev/da2s0e
189 is mirrored with
190 .Pa /dev/da4s0e
191 and assigned to
192 .Pa ccd0 .
193 .Bd -literal -offset indent
194 # ccdconfig ccd0 64 none /dev/da2s0e /dev/da3s0e /dev/da4s0e \e
195         /dev/da5s0e
196 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da2s0e /dev/da3s0e \e
197         /dev/da4s0e /dev/da5s0e
198 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da2s0e /dev/da4s0e
201 When you create a new ccd disk you generally want to label it, using
202 .Xr disklabel 8
204 .Xr disklabel64 8 ,
205 before doing anything else.
206 Once you create the initial label you can edit it, adding additional partitions.
207 The label itself takes up the first 16 sectors of the ccd disk.
208 If all you are doing is creating file systems with
209 .Xr newfs 8 ,
210 you do not have to worry about this as
211 .Xr newfs 8
212 will skip the label area.
213 However, if you intend to
214 .Xr dd 1
215 to or from a ccd partition it is usually a good idea to construct the
216 partition such that it does not overlap the label area.
217 For example, if you have A ccd disk with 10000 sectors you might create a
218 .Ql d
219 partition with offset 16 and size 9984.
220 .Bd -literal -offset indent
221 # disklabel -r -w ccd0s0 auto
222 # disklabel -e ccd0s0
225 The disklabeling of a ccd disk is usually a one-time affair.
226 If you reboot the machine and reconfigure the ccd disk, the disklabel you
227 had created before will still be there and not require reinitialization.
228 Beware that changing any ccd parameters: interleave, flags, or the
229 device list making up the ccd disk, will usually destroy any prior
230 data on that ccd disk.
231 If this occurs it is usually a good idea to
232 reinitialize the label before [re]constructing your ccd disk.
233 .Sh SEE ALSO
234 .Xr dd 1 ,
235 .Xr ccd 4 ,
236 .Xr dpt 4 ,
237 .Xr disklabel 8 ,
238 .Xr disklabel64 8 ,
239 .Xr rc 8 ,
240 .Xr vinum 8
241 .Sh HISTORY
244 utility first appeared in
245 .Nx 1.1 .