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 .\" 4. The name of the author may not be used to endorse or promote products
15 .\" derived from this software without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .Nd configuration utility for the concatenated disk driver
47 .Op Fl f Ar config_file
55 .Op Fl f Ar config_file
62 utility is used to dynamically configure and unconfigure concatenated disk
64 For more information about the ccd, see
67 The options are as follows:
68 .Bl -tag -width indent
71 This is the default behavior of
74 Configure all ccd devices listed in the ccd configuration file.
75 .It Fl f Ar config_file
76 When configuring or unconfiguring all devices, read the file
78 instead of the default
81 Dump the current ccd configuration in a format suitable for use as the
82 ccd configuration file.
83 If no arguments are specified, every configured
85 Otherwise, the configuration of each listed ccd is dumped.
89 Unconfigure all ccd devices listed the ccd configuration file.
96 A ccd is described on the command line and in the ccd configuration
97 file by the name of the ccd, the interleave factor, the ccd configuration
98 flags, and a list of one or more devices.
99 The flags may be represented
100 as a decimal number, a hexadecimal number, a comma-separated list
101 of strings, or the word
103 The flags are as follows:
104 .Bd -literal -offset indent
105 CCDF_UNIFORM 0x02 Use uniform interleave
106 CCDF_MIRROR 0x04 Support mirroring
110 configuration file appears exactly as if it were entered on the command line.
111 Note that on the command line and in the configuration file, the
113 argument is optional.
114 .Bd -literal -offset indent
117 # Configuration file for concatenated disk devices
120 # ccd ileave flags component devices
121 ccd0 16 none /dev/da2s1 /dev/da3s1
124 The component devices need to name partitions of type
131 .Bl -tag -width /etc/ccd.conf -compact
133 default ccd configuration file
138 examples are shown below.
142 are exactly the same as you might place in the
145 The first example creates a 4-disk stripe out of
146 four scsi disk partitions.
147 The stripe uses a 64 sector interleave.
148 The second example is an example of a complex stripe/mirror combination.
149 It reads as a two disk stripe of da4 and da5 which is mirrored
150 to a two disk stripe of da6 and da7.
151 The last example is a simple
153 The 2nd slice of /dev/da8 is mirrored with the 3rd slice of /dev/da9
154 and assigned to ccd0.
157 # ccdconfig ccd0 64 none /dev/da0s1 /dev/da1s1 /dev/da2s1 /dev/da3s1
158 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da4 /dev/da5 /dev/da6 /dev/da7
159 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da8s2 /dev/da9s3
162 When you create a new ccd disk you generally want to
166 it before doing anything else.
167 Once you create the initial label you can
168 edit it, adding additional partitions.
169 The label itself takes up the first
170 16 sectors of the ccd disk.
171 If all you are doing is creating file systems
172 with newfs, you do not have to worry about this as newfs will skip the
174 However, if you intend to
176 to or from a ccd partition it is usually a good idea to construct the
177 partition such that it does not overlap the label area.
179 you have A ccd disk with 10000 sectors you might create a 'd' partition
180 with offset 16 and size 9984.
183 # disklabel ccd0 > /tmp/disklabel.ccd0
184 # disklabel -Rr ccd0 /tmp/disklabel.ccd0
188 The disklabeling of a ccd disk is usually a one-time affair.
189 If you reboot the machine and reconfigure the ccd disk,
191 had created before will still be there and not require reinitialization.
192 Beware that changing any ccd parameters: interleave, flags, or the
193 device list making up the ccd disk, will usually destroy any prior
194 data on that ccd disk.
195 If this occurs it is usually a good idea to
196 reinitialize the label before [re]constructing your ccd disk.
198 An error on a ccd disk is usually unrecoverable unless you are using the
200 But mirroring has its own perils: It assumes that
201 both copies of the data at any given sector are the same.
203 until a write error occurs or until you replace either side of the mirror.
204 This is a poor-man's mirroring implementation.
205 It works well enough that if
206 you begin to get disk errors you should be able to backup the ccd disk,
207 replace the broken hardware, and then regenerate the ccd disk.
209 more than this you should look into external hardware RAID SCSI boxes,
210 RAID controllers (see GENERIC),
211 or software RAID systems such as
225 utility first appeared in
228 The initial disklabel returned by
230 specifies only 3 partitions.
231 One needs to change the number of partitions to 8 using
232 .Dq Nm disklabel Fl e