1.\" $NetBSD: ccd.4,v 1.27 2004/03/05 15:10:18 wiz 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.\" 49.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS 50.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 51.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 52.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, 53.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 54.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 55.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 56.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 57.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 58.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 59.\" SUCH DAMAGE. 60.\" 61.Dd March 5, 2004 62.Dt CCD 4 63.Os 64.Sh NAME 65.Nm ccd 66.Nd Concatenated disk driver 67.Sh SYNOPSIS 68.Cd "pseudo-device ccd" Op Ar count 69.Sh DESCRIPTION 70The 71.Nm 72driver provides the capability of combining one or more disks/partitions 73into one virtual disk. 74.Pp 75This document assumes that you're familiar with how to generate kernels, 76how to properly configure disks and pseudo-devices in a kernel 77configuration file, and how to partition disks. 78.Pp 79Note that the 80.Sq raw 81partitions of the disks 82.Pa must not 83be combined. 84Each component partition should be offset at least one cylinder 85from the beginning of the component disk. 86This avoids potential conflicts between the component disk's 87disklabel and the 88.Nm Ns 's 89disklabel. 90The kernel will only allow component partitions of type 91.Dv FS_CCD . 92But for now, it allows partition of all types since some port 93lacks support of an on-disk BSD disklabel. 94The partition of 95.Dv FS_UNUSED 96may be rejected because device driver of component disk will refuse it. 97.Pp 98In order to compile in support for the 99.Nm , 100you must add a line similar 101to the following to your kernel configuration file: 102.Bd -unfilled -offset indent 103pseudo-device ccd 4 # concatenated disk devices 104.Ed 105.Pp 106The count argument is how many 107.Nm Ns s 108memory is allocated for at boot time. 109In this example, no more than 4 110.Nm Ns s 111may be configured. 112.Pp 113A 114.Nm 115may be either serially concatenated or interleaved. 116To serially concatenate the partitions, specify the interleave factor of 0. 117.Pp 118If a 119.Nm 120is interleaved correctly, a 121.Dq striping 122effect is achieved, which can increase performance. 123.\" The optimum interleave factor is typically the size of a track, 124.\" see 125.\" .Dq sectors/track 126.\" value in 127.\" .Xr disklabel 8 128.\" output. 129Since the interleave factor is expressed in units of 130.Dv DEV_BSIZE , 131one must account for sector sizes other than 132.Dv DEV_BSIZE 133in order to calculate the correct interleave. 134The kernel will not allow an interleave factor less than the size 135of the largest component sector divided by 136.Dv DEV_BSIZE . 137.Pp 138Note that best performance is achieved if all component disks have the same 139geometry and size. 140Optimum striping cannot occur with different disk types. 141.Pp 142Also note that the total size of concatenated disk may vary depending on 143the interleave factor even if the exact same components are concatenated. 144And an old on-disk disklabel may be read after interleave factor change. 145As a result, the disklabel may contain wrong partition geometry and 146will cause an error when doing I/O near the end of concatenated disk. 147.Pp 148There is a run-time utility that is used for configuring 149.Nm Ns s . 150See 151.Xr ccdconfig 8 152for more information. 153.Sh WARNINGS 154If just one (or more) of the disks in a non-mirrored 155.Nm 156fails, the entire file system will be lost. 157.Sh FILES 158.Bl -tag -width /dev/XXrXccdX -compact 159.It Pa /dev/{,r}ccd* 160.Nm 161device special files. 162.El 163.Sh SEE ALSO 164.Xr MAKEDEV 8 , 165.Xr ccdconfig 8 , 166.Xr config 8 , 167.Xr fsck 8 , 168.Xr mount 8 , 169.Xr newfs 8 170.Sh HISTORY 171The concatenated disk driver was originally written at the University of Utah. 172