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