1 .\" $NetBSD: ccdconfig.8,v 1.1.2.1 1995/11/11 02:43:33 thorpej Exp $
3 .\" Copyright (c) 1995 Jason R. Thorpe.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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
33 .\" $FreeBSD: src/sbin/ccdconfig/ccdconfig.8,v 1.9.2.10 2003/01/26 03:38:39 keramida Exp $
34 .\" $DragonFly: src/sbin/ccdconfig/ccdconfig.8,v 1.7 2008/05/02 02:05:05 swildner Exp $
41 .Nd configuration utility for the concatenated disk driver
52 .Op Fl f Ar config_file
60 .Op Fl f Ar config_file
69 utility is used to dynamically configure and unconfigure concatenated disk
71 For more information about the ccd, see
74 The options are as follows:
75 .Bl -tag -width indent
78 This is the default behavior of
81 Configure all ccd devices listed in the ccd configuration file.
82 .It Fl f Ar config_file
83 When configuring or unconfiguring all devices, read the file
85 instead of the default
88 Dump the current ccd configuration in a format suitable for use as the
89 ccd configuration file.
90 If no arguments are specified, every configured ccd is dumped.
91 Otherwise, the configuration of each listed ccd is dumped.
93 Extract values associated with the name list from
95 instead of the default
100 as the kernel instead of the running kernel (as determined from
101 .Xr getbootfile 3 ) .
105 Unconfigure all ccd devices listed the ccd configuration file.
112 A ccd is described on the command line and in the ccd configuration
113 file by the name of the ccd, the interleave factor, the ccd configuration
114 flags, and a list of one or more devices.
115 The flags may be represented as a decimal number, a hexadecimal number,
116 a comma-separated list of strings, or the word
118 The flags are as follows:
119 .Bd -literal -offset indent
120 CCDF_SWAP 0x01 Interleave should be dmmax
121 CCDF_UNIFORM 0x02 Use uniform interleave
122 CCDF_MIRROR 0x04 Support mirroring
123 CCDF_PARITY 0x08 Support parity (not implemented yet)
127 configuration file appears exactly as if it were entered on the command line.
128 Note that on the command line and in the configuration file, the
130 argument is optional.
131 .Bd -literal -offset indent
134 # Configuration file for concatenated disk devices
137 # ccd ileave flags component devices
138 ccd0 16 none /dev/da2s0e /dev/da3s0e
141 The component devices need to name partitions of type
148 An error on a ccd disk is usually unrecoverable unless you are using the
150 But mirroring has its own perils:
151 It assumes that both copies of the data at any given sector are the same.
153 until a write error occurs or until you replace either side of the mirror.
154 This is a poor-man's mirroring implementation.
155 It works well enough that if
156 you begin to get disk errors you should be able to backup the ccd disk,
157 replace the broken hardware, and then regenerate the ccd disk.
158 If you need more than this you should look into external hardware RAID
159 SCSI boxes, RAID controllers such as the
161 controller, or software RAID systems such as
164 .Bl -tag -width /etc/ccd.conf -compact
166 default ccd configuration file
171 examples are shown below.
172 The arguments passed to
174 are exactly the same as you might place in the
177 The first example creates a 4-disk stripe out of four SCSI disk partitions.
178 The stripe uses a 64 sector interleave.
179 The second example is an example of a complex stripe/mirror combination.
180 It reads as a two disk stripe of
184 which is mirrored to a two disk stripe of
188 The last example is a simple mirror.
194 .Bd -literal -offset indent
195 # ccdconfig ccd0 64 none /dev/da2s0e /dev/da3s0e /dev/da4s0e \e
197 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da2s0e /dev/da3s0e \e
198 /dev/da4s0e /dev/da5s0e
199 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da2s0e /dev/da4s0e
202 When you create a new ccd disk you generally want to label it, using
206 before doing anything else.
207 Once you create the initial label you can edit it, adding additional partitions.
208 The label itself takes up the first 16 sectors of the ccd disk.
209 If all you are doing is creating file systems with
211 you do not have to worry about this as
213 will skip the label area.
214 However, if you intend to
216 to or from a ccd partition it is usually a good idea to construct the
217 partition such that it does not overlap the label area.
218 For example, if you have A ccd disk with 10000 sectors you might create a
220 partition with offset 16 and size 9984.
221 .Bd -literal -offset indent
222 # disklabel -r -w ccd0s0 auto
223 # disklabel -e ccd0s0
226 The disklabeling of a ccd disk is usually a one-time affair.
227 If you reboot the machine and reconfigure the ccd disk, the disklabel you
228 had created before will still be there and not require reinitialization.
229 Beware that changing any ccd parameters: interleave, flags, or the
230 device list making up the ccd disk, will usually destroy any prior
231 data on that ccd disk.
232 If this occurs it is usually a good idea to
233 reinitialize the label before [re]constructing your ccd disk.
245 utility first appeared in