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