xref: /netbsd-src/share/man/man4/ccd.4 (revision a5a68ff5f29de57339ca14f6c671c0a87714f1f8)
1.\"	$NetBSD: ccd.4,v 1.10 1997/09/20 03:56:38 mikel Exp $
2.\"
3.\" Copyright (c) 1994 Jason Downs.
4.\" Copyright (c) 1994, 1995, 1996 Jason R. Thorpe.
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed for the NetBSD Project
18.\"	by Jason Downs and Jason R. Thorpe.
19.\" 4. Neither the name of the author nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.Dd August 9, 1995
36.Dt CCD 4
37.Os NetBSD
38.Sh NAME
39.Nm ccd
40.Nd Concatenated Disk Driver
41.Sh SYNOPSIS
42.Cd "pseudo-device ccd" Op Ar count
43.Sh DESCRIPTION
44The
45.Nm
46driver provides the capability of combining one or more disks/partitions
47into one virtual disk.
48.Pp
49This document assumes that you're familiar with how to generate kernels,
50how to properly configure disks and pseudo-devices in a kernel
51configuration file, and how to partition disks.
52.Pp
53Note that the
54.Sq raw
55partitions of the disks
56.Pa should not
57be combined.  Each component partition should be offset at least one
58cylinder from the beginning of the component disk.  This avoids potential
59conflicts between the component disk's disklabel and the
60.Nm ccd Ns 's
61disklabel.  The kernel will only allow component partitions of type
62.Dv FS_BSDFFS .
63.Pp
64In order to compile in support for the ccd, you must add a line similar
65to the following to your kernel configuration file:
66.Bd -unfilled -offset indent
67pseudo-device	ccd	4	# concatenated disk devices
68.Ed
69.Pp
70The count argument is how many
71.Nm ccd Ns s
72memory is allocated for at boot time.  In this example, no more than 4
73.Nm ccd Ns s
74may be configured.
75.Pp
76A
77.Nm ccd
78may be either serially concatenated or interleaved.  If a
79.Nm ccd
80is interleaved correctly, a
81.Dq striping
82effect is achieved, which can increase performance.  The optimum interleave
83factor is typically the size of a track.  Since the interleave factor
84is expressed in units of
85.Dv DEV_BSIZE ,
86one must account for sector sizes other than
87.Dv DEV_BSIZE
88in order to calculate the correct interleave.
89The kernel will not allow an interleave factor less than the size
90of the largest component sector divided by
91.Dv DEV_BSIZE .
92.Pp
93Note that best performance is achieved if all component disks have the same
94geometry and size.  Optimum striping cannot occur with different
95disk types.
96.Pp
97The
98.Nm ccd
99also supports primitive data mirroring.  To enable this mirroring support,
100the
101.Nm ccd
102must be configured with the
103.Dv CCDF_MIRROR
104flag set.  Note that the
105.Dv CCDF_MIRROR
106flag implies the
107.Dv CCDF_UNIFORM
108flag and requires an interleaved even number of components.
109.Pp
110Mirroring functions by making the second n/2 components exact duplicates
111of the first n/2.  For example, in a mirrored
112.Nm ccd
113with components sd0g, sd1g, sd2g, and sd3g, sd2g would mirror sd0g and
114sd3g would mirror sd1g.  Reads will come from the first n/2 components
115(in this example: sd0g and sd1g) while writes will go to all components.
116.Pp
117If a component of a mirrored
118.Nm ccd
119should fail, the
120.Nm ccd
121can be reconfigured as a non-mirrored
122.Nm ccd
123until the failed component can be replaced.  For example, using the
124hypothetical
125.Nm ccd
126above, the recovery process might look like this:
127.Bd -literal -offset indent
128* Component sd1g fails.  Reconfigure ccd without mirroring
129  using the same interleave factor with components sd0g and sd3g.
130  ccd can still be used until replacement drive arrives.
131* Replace failed component.  Using dd(1), copy the contents of
132  sd3g to the new sd1g.
133* Restore ccd configuration to that of before the component failure.
134.Ed
135.Pp
136There is a run-time utility that is used for configuring
137.Nm ccd Ns s.
138See
139.Xr ccdconfig 8
140for more information.
141.Sh WARNINGS
142If just one (or more) of the disks in a non-mirrored
143.Nm ccd
144fails, the entire
145file system will be lost.
146.Sh FILES
147.Bl -tag -width /dev/XXrXccdX -compact
148.It Pa /dev/{,r}ccd*
149ccd device special files.
150.El
151.Pp
152.Sh HISTORY
153The concatenated disk driver was originally written at the University of
154Utah.
155.Sh SEE ALSO
156.Xr MAKEDEV 8 ,
157.Xr ccdconfig 8 ,
158.Xr config 8 ,
159.Xr fsck 8 ,
160.Xr mount 8 ,
161.Xr newfs 8 .
162