xref: /netbsd-src/share/man/man4/ccd.4 (revision 76dfffe33547c37f8bdd446e3e4ab0f3c16cea4b)
1.\"	$NetBSD: ccd.4,v 1.6 1996/02/01 20:47:46 thorpej 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 4"
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 compoent disk's disklabel and the
60.Nm ccd's
61disklabel.  The kernel will only allow component partitions of type FS_BSDFFS.
62.Pp
63In order to compile in support for the ccd, you must add a line similar
64to the following to your kernel configuration file:
65.Bd -unfilled -offset indent
66pseudo-device	ccd	4	# concatenated disk devices
67.Ed
68.Pp
69The count argument is how many
70.Nm ccds
71memory is allocated for a boot time.  In this example, no more than 4
72.Nm ccds
73may be configured.
74.Pp
75A
76.Nm ccd
77may be either serially concatenated or interleaved.  If a
78.Nm ccd
79is interleaved correctly, a
80.Dq striping
81effect is achieved, which can increase performance.  The optimum interleave
82factor is typically the size of a track.  Since the interleave factor
83is expressed in units of DEV_BSIZE, one must account for sector sizes
84other than DEV_BSIZE in order to calculate the correct interleave.
85The kernel will not allow an interleave factor less than the size
86of the largest component sector divided by DEV_BSIZE.
87.Pp
88Note that best performance is achieved if all compent disks have the same
89geometery and size.  Optimum striping cannot occur with different
90disk types.
91.Pp
92The
93.Nm ccd
94also supports primitive data mirroring.  To enable this mirroring support,
95the
96.Nm ccd
97must be configured with the
98.Nm CCDF_MIRROR
99flag set.  Note that the
100.Nm CCDF_MIRROR
101flag implies the
102.Nm CCDF_UNIFORM
103flag and requires an interleaved even number of components.
104.Pp
105Mirroring functions by making the second n/2 components exact duplicates
106of the first n/2.  For example, in a mirrored
107.Nm ccd
108with components sd0g, sd1g, sd2g, and sd3g, sd2g would mirror sd0g and
109sd3g would mirror sd1g.  Reads will come from the first n/2 components
110(in this example: sd0g and sd1g) while writes will go to all components.
111.Pp
112If a component of a mirrored
113.Nm ccd
114should fail, the
115.Nm ccd
116can be reconfigured as a non-mirrored
117.Nm ccd
118until the failed component can be replaced.  For example, using the
119hypothetical
120.Nm ccd
121above, the recovery process might look like this:
122.Bd -literal -offset indent
123* Component sd1g fails.  Reconfigure ccd without mirroring
124  using the same interleave factor with components sd0g and sd3g.
125  ccd can still be used until replacement drive arrives.
126* Replace failed component.  Using dd(1), copy the contents of
127  sd3g to the new sd1g.
128* Restore ccd configuration to that of before the component failure.
129.Ed
130.Pp
131There is a run-time utility that is used for configuring
132.Nm ccds .
133See
134.Xr ccdconfig 8
135for more information.
136.Sh WARNINGS
137If just one (or more) of the disks in a non-mirrored
138.Nm ccd
139fails, the entire
140file system will be lost.
141.Sh FILES
142/dev/{,r}ccd* - ccd device special files.
143.Pp
144.Sh HISTORY
145The concatenated disk driver was originally written at the University of
146Utah.
147.Sh SEE ALSO
148.Xr MAKEDEV 8 ,
149.Xr ccdconfig 8 ,
150.Xr config 8 ,
151.Xr config.old 8 ,
152.Xr fsck 8 ,
153.Xr mount 8 ,
154.Xr newfs 8 .
155