1.\" $NetBSD: ccd.4,v 1.5 1995/10/09 06:09:09 thorpej Exp $ 2.\" 3.\" Copyright (c) 1994 Jason Downs. 4.\" Copyright (c) 1994, 1995 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. The kernel will only allow component partitions of type 58FS_BSDFFS (type 59.Dq 4.2BSD 60as shown as 61.Xr disklabel 8 ). 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. To serially 78concatenate the partitions, specify the interleave factor of 0. 79.Pp 80There is a run-time utility that is used for configuring 81.Nm ccds . 82See 83.Xr ccdconfig 8 84for more information. 85.Ss The Interleave Factor 86If a 87.Nm ccd 88is interleaved correctly, a 89.Dq striping 90effect is achieved, which can increase sequential read/write 91performance. The interleave factor is expressed in units of DEV_BSIZE 92(usually 512 bytes). For large writes, the optimum interleave factor 93is typically the size of a track, while for large reads, it is about a 94quarter of a track. (Note that this changes greatly depending on the 95number and speed of disks.) For instance, with eight 7,200 RPM drives 96on two Fast-Wide SCSI buses, this translates to about 128 for writes 97and 32 for reads. 98.Pp 99The best performance is achieved if all component disks have the same 100geometry and size. Optimum striping cannot occur with different 101disk types. 102.Pp 103For random-access oriented workloads, such as news servers, a larger 104interleave factor (e.g., 65,536) is more desirable. Note that there 105isn't much 106.Nm ccd 107can do to speed up applications that are seek-time limited. Larger 108interleave factors will at least reduce the chance of having to seek 109two disk-heads to read one directory or a file. 110.Ss Disk Mirroring 111You can configure the 112.Nm ccd 113to 114.Dq mirror 115any even number of disks. See 116.Xr ccdconfig 8 117for how to specify the necessary flags. In an event of a disk 118failure, you can use 119.Xr dd 1 120to recover the failed disk. 121.Pp 122Note that a one-disk 123.Nm ccd 124is not the same as the original partition. In particular, this means 125if you have a filesystem on a two-disk mirrored 126.Nm ccd 127and one of the disks fail, you cannot mount and use the remaining 128partition as itself; you have to configure it as a one-disk 129.Nm ccd. 130.Sh WARNINGS 131If just one (or more) of the disks in a 132.Nm ccd 133fails, the entire 134file system will be lost unless you are mirroring the disks. 135.Sh FILES 136/dev/{,r}ccd* - ccd device special files. 137.Pp 138.Sh HISTORY 139The concatenated disk driver was originally written at the University of 140Utah. 141.Sh SEE ALSO 142.Xr dd 1 , 143.Xr ccdconfig 8 , 144.Xr config 8 , 145.Xr disklabel 8 , 146.Xr fsck 8 , 147.Xr MAKEDEV 8 , 148.Xr mount 8 , 149.Xr newfs 8 . 150