Deleted Added
full compact
ccdconfig.8 (140415) ccdconfig.8 (141611)
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.\" 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.
16.\"
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
27.\" SUCH DAMAGE.
28.\"
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.\" 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.
16.\"
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
27.\" SUCH DAMAGE.
28.\"
29.\" $FreeBSD: head/sbin/ccdconfig/ccdconfig.8 140415 2005-01-18 10:09:38Z ru $
29.\" $FreeBSD: head/sbin/ccdconfig/ccdconfig.8 141611 2005-02-10 09:19:34Z ru $
30.\"
31.Dd July 17, 1995
32.Dt CCDCONFIG 8
33.Os
34.Sh NAME
35.Nm ccdconfig
36.Nd configuration utility for the concatenated disk driver
37.Sh SYNOPSIS
38.Nm
39.Op Fl cv
40.Ar ccd
41.Ar ileave
42.Op Ar flags
30.\"
31.Dd July 17, 1995
32.Dt CCDCONFIG 8
33.Os
34.Sh NAME
35.Nm ccdconfig
36.Nd configuration utility for the concatenated disk driver
37.Sh SYNOPSIS
38.Nm
39.Op Fl cv
40.Ar ccd
41.Ar ileave
42.Op Ar flags
43.Ar dev
44.Op Ar
43.Ar dev ...
45.Nm
46.Fl C
47.Op Fl v
48.Op Fl f Ar config_file
49.Nm
50.Fl u
51.Op Fl v
44.Nm
45.Fl C
46.Op Fl v
47.Op Fl f Ar config_file
48.Nm
49.Fl u
50.Op Fl v
52.Ar ccd
53.Op Ar
51.Ar ccd ...
54.Nm
55.Fl U
56.Op Fl v
57.Op Fl f Ar config_file
58.Nm
59.Fl g
52.Nm
53.Fl U
54.Op Fl v
55.Op Fl f Ar config_file
56.Nm
57.Fl g
60.Op Ar ccd Op Ar ...
58.Op Ar ccd ...
61.Sh DESCRIPTION
62The
63.Nm
64utility is used to dynamically configure and unconfigure concatenated disk
65devices, or ccds.
66For more information about the ccd, see
67.Xr ccd 4 .
68.Pp
69The options are as follows:
70.Bl -tag -width indent
71.It Fl c
72Configure a ccd.
73This is the default behavior of
74.Nm .
75.It Fl C
76Configure all ccd devices listed in the ccd configuration file.
77.It Fl f Ar config_file
78When configuring or unconfiguring all devices, read the file
79.Pa config_file
80instead of the default
81.Pa /etc/ccd.conf .
82.It Fl g
83Dump the current ccd configuration in a format suitable for use as the
84ccd configuration file.
85If no arguments are specified, every configured
86ccd is dumped.
87Otherwise, the configuration of each listed ccd is dumped.
88.It Fl u
89Unconfigure a ccd.
90.It Fl U
91Unconfigure all ccd devices listed the ccd configuration file.
92.It Fl v
93Cause
94.Nm
95to be verbose.
96.El
97.Pp
98A ccd is described on the command line and in the ccd configuration
99file by the name of the ccd, the interleave factor, the ccd configuration
100flags, and a list of one or more devices.
101The flags may be represented
102as a decimal number, a hexadecimal number, a comma-separated list
103of strings, or the word
104.Dq none .
105The flags are as follows:
106.Bd -literal -offset indent
107CCDF_UNIFORM 0x02 Use uniform interleave
108CCDF_MIRROR 0x04 Support mirroring
109.Ed
110.Pp
111The format in the
112configuration file appears exactly as if it were entered on the command line.
113Note that on the command line and in the configuration file, the
114.Pa flags
115argument is optional.
116.Bd -literal -offset indent
117#
118# /etc/ccd.conf
119# Configuration file for concatenated disk devices
120#
121
122# ccd ileave flags component devices
123ccd0 16 none /dev/da2s1 /dev/da3s1
124.Ed
125.Pp
126The component devices need to name partitions of type
127.Li FS_BSDFFS
128(or
129.Dq 4.2BSD
130as shown by
131.Xr disklabel 8 ) .
132.Sh FILES
133.Bl -tag -width /etc/ccd.conf -compact
134.It Pa /etc/ccd.conf
135default ccd configuration file
136.El
137.Sh EXAMPLES
138A number of
139.Nm
140examples are shown below.
141The arguments passed
142to
143.Nm
144are exactly the same as you might place in the
145.Pa /etc/ccd.conf
146configuration file.
147The first example creates a 4-disk stripe out of
148four scsi disk partitions.
149The stripe uses a 64 sector interleave.
150The second example is an example of a complex stripe/mirror combination.
151It reads as a two disk stripe of da4 and da5 which is mirrored
152to a two disk stripe of da6 and da7.
153The last example is a simple
154mirror.
155The 2nd slice of /dev/da8 is mirrored with the 3rd slice of /dev/da9
156and assigned to ccd0.
157.Pp
158.Bd -literal
159# ccdconfig ccd0 64 none /dev/da0s1 /dev/da1s1 /dev/da2s1 /dev/da3s1
160# ccdconfig ccd0 128 CCDF_MIRROR /dev/da4 /dev/da5 /dev/da6 /dev/da7
161# ccdconfig ccd0 128 CCDF_MIRROR /dev/da8s2 /dev/da9s3
162.Ed
163.Pp
164When you create a new ccd disk you generally want to
165.Xr fdisk 8
166and
167.Xr disklabel 8
168it before doing anything else.
169Once you create the initial label you can
170edit it, adding additional partitions.
171The label itself takes up the first
17216 sectors of the ccd disk.
173If all you are doing is creating file systems
174with newfs, you do not have to worry about this as newfs will skip the
175label area.
176However, if you intend to
177.Xr dd 1
178to or from a ccd partition it is usually a good idea to construct the
179partition such that it does not overlap the label area.
180For example, if
181you have A ccd disk with 10000 sectors you might create a 'd' partition
182with offset 16 and size 9984.
183.Pp
184.Bd -literal
185# disklabel ccd0 > /tmp/disklabel.ccd0
186# disklabel -Rr ccd0 /tmp/disklabel.ccd0
187# disklabel -e ccd0
188.Ed
189.Pp
190The disklabeling of a ccd disk is usually a one-time affair.
191If you reboot the machine and reconfigure the ccd disk,
192the disklabel you
193had created before will still be there and not require reinitialization.
194Beware that changing any ccd parameters: interleave, flags, or the
195device list making up the ccd disk, will usually destroy any prior
196data on that ccd disk.
197If this occurs it is usually a good idea to
198reinitialize the label before [re]constructing your ccd disk.
199.Sh RECOVERY
200An error on a ccd disk is usually unrecoverable unless you are using the
201mirroring option.
202But mirroring has its own perils: It assumes that
203both copies of the data at any given sector are the same.
204This holds true
205until a write error occurs or until you replace either side of the mirror.
206This is a poor-man's mirroring implementation.
207It works well enough that if
208you begin to get disk errors you should be able to backup the ccd disk,
209replace the broken hardware, and then regenerate the ccd disk.
210If you need
211more than this you should look into external hardware RAID SCSI boxes,
212RAID controllers (see GENERIC),
213or software RAID systems such as
214.Xr geom 8
215and
216.Xr vinum 8 .
217.Sh SEE ALSO
218.Xr dd 1 ,
219.Xr ccd 4 ,
220.Xr raid 4 ,
221.Xr disklabel 8 ,
222.Xr fdisk 8 ,
223.Xr rc 8 ,
224.Xr vinum 8
225.Sh HISTORY
226The
227.Nm
228utility first appeared in
229.Nx 1.0a .
230.Sh BUGS
231The initial disklabel returned by
232.Xr ccd 4
233specifies only 3 partitions.
234One needs to change the number of paritions to 8 using
235.Dq Nm disklabel Fl e
236to get the usual
237.Bx
238expectations.
59.Sh DESCRIPTION
60The
61.Nm
62utility is used to dynamically configure and unconfigure concatenated disk
63devices, or ccds.
64For more information about the ccd, see
65.Xr ccd 4 .
66.Pp
67The options are as follows:
68.Bl -tag -width indent
69.It Fl c
70Configure a ccd.
71This is the default behavior of
72.Nm .
73.It Fl C
74Configure all ccd devices listed in the ccd configuration file.
75.It Fl f Ar config_file
76When configuring or unconfiguring all devices, read the file
77.Pa config_file
78instead of the default
79.Pa /etc/ccd.conf .
80.It Fl g
81Dump the current ccd configuration in a format suitable for use as the
82ccd configuration file.
83If no arguments are specified, every configured
84ccd is dumped.
85Otherwise, the configuration of each listed ccd is dumped.
86.It Fl u
87Unconfigure a ccd.
88.It Fl U
89Unconfigure all ccd devices listed the ccd configuration file.
90.It Fl v
91Cause
92.Nm
93to be verbose.
94.El
95.Pp
96A ccd is described on the command line and in the ccd configuration
97file by the name of the ccd, the interleave factor, the ccd configuration
98flags, and a list of one or more devices.
99The flags may be represented
100as a decimal number, a hexadecimal number, a comma-separated list
101of strings, or the word
102.Dq none .
103The flags are as follows:
104.Bd -literal -offset indent
105CCDF_UNIFORM 0x02 Use uniform interleave
106CCDF_MIRROR 0x04 Support mirroring
107.Ed
108.Pp
109The format in the
110configuration file appears exactly as if it were entered on the command line.
111Note that on the command line and in the configuration file, the
112.Pa flags
113argument is optional.
114.Bd -literal -offset indent
115#
116# /etc/ccd.conf
117# Configuration file for concatenated disk devices
118#
119
120# ccd ileave flags component devices
121ccd0 16 none /dev/da2s1 /dev/da3s1
122.Ed
123.Pp
124The component devices need to name partitions of type
125.Li FS_BSDFFS
126(or
127.Dq 4.2BSD
128as shown by
129.Xr disklabel 8 ) .
130.Sh FILES
131.Bl -tag -width /etc/ccd.conf -compact
132.It Pa /etc/ccd.conf
133default ccd configuration file
134.El
135.Sh EXAMPLES
136A number of
137.Nm
138examples are shown below.
139The arguments passed
140to
141.Nm
142are exactly the same as you might place in the
143.Pa /etc/ccd.conf
144configuration file.
145The first example creates a 4-disk stripe out of
146four scsi disk partitions.
147The stripe uses a 64 sector interleave.
148The second example is an example of a complex stripe/mirror combination.
149It reads as a two disk stripe of da4 and da5 which is mirrored
150to a two disk stripe of da6 and da7.
151The last example is a simple
152mirror.
153The 2nd slice of /dev/da8 is mirrored with the 3rd slice of /dev/da9
154and assigned to ccd0.
155.Pp
156.Bd -literal
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
160.Ed
161.Pp
162When you create a new ccd disk you generally want to
163.Xr fdisk 8
164and
165.Xr disklabel 8
166it before doing anything else.
167Once you create the initial label you can
168edit it, adding additional partitions.
169The label itself takes up the first
17016 sectors of the ccd disk.
171If all you are doing is creating file systems
172with newfs, you do not have to worry about this as newfs will skip the
173label area.
174However, if you intend to
175.Xr dd 1
176to or from a ccd partition it is usually a good idea to construct the
177partition such that it does not overlap the label area.
178For example, if
179you have A ccd disk with 10000 sectors you might create a 'd' partition
180with offset 16 and size 9984.
181.Pp
182.Bd -literal
183# disklabel ccd0 > /tmp/disklabel.ccd0
184# disklabel -Rr ccd0 /tmp/disklabel.ccd0
185# disklabel -e ccd0
186.Ed
187.Pp
188The disklabeling of a ccd disk is usually a one-time affair.
189If you reboot the machine and reconfigure the ccd disk,
190the disklabel you
191had created before will still be there and not require reinitialization.
192Beware that changing any ccd parameters: interleave, flags, or the
193device list making up the ccd disk, will usually destroy any prior
194data on that ccd disk.
195If this occurs it is usually a good idea to
196reinitialize the label before [re]constructing your ccd disk.
197.Sh RECOVERY
198An error on a ccd disk is usually unrecoverable unless you are using the
199mirroring option.
200But mirroring has its own perils: It assumes that
201both copies of the data at any given sector are the same.
202This holds true
203until a write error occurs or until you replace either side of the mirror.
204This is a poor-man's mirroring implementation.
205It works well enough that if
206you begin to get disk errors you should be able to backup the ccd disk,
207replace the broken hardware, and then regenerate the ccd disk.
208If you need
209more than this you should look into external hardware RAID SCSI boxes,
210RAID controllers (see GENERIC),
211or software RAID systems such as
212.Xr geom 8
213and
214.Xr vinum 8 .
215.Sh SEE ALSO
216.Xr dd 1 ,
217.Xr ccd 4 ,
218.Xr raid 4 ,
219.Xr disklabel 8 ,
220.Xr fdisk 8 ,
221.Xr rc 8 ,
222.Xr vinum 8
223.Sh HISTORY
224The
225.Nm
226utility first appeared in
227.Nx 1.0a .
228.Sh BUGS
229The initial disklabel returned by
230.Xr ccd 4
231specifies only 3 partitions.
232One needs to change the number of paritions to 8 using
233.Dq Nm disklabel Fl e
234to get the usual
235.Bx
236expectations.