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.\" $FreeBSD$ 36.\" 37.Dd August 9, 1995 38.Dt CCD 4 39.Os NetBSD 40.Sh NAME 41.Nm ccd 42.Nd Concatenated Disk Driver 43.Sh SYNOPSIS 44.Cd "pseudo-device ccd 4" 45.Sh DESCRIPTION 46The 47.Nm 48driver provides the capability of combining one or more disks/partitions 49into one virtual disk. 50.Pp 51This document assumes that you're familiar with how to generate kernels, 52how to properly configure disks and pseudo-devices in a kernel 53configuration file, and how to partition disks. 54.Pp 55Note that the 56.Sq raw 57partitions of the disks 58.Pa should not 59be combined. The kernel will only allow component partitions of type 60FS_BSDFFS (type 61.Dq 4.2BSD 62as shown as 63.Xr disklabel 8 ). 64.Pp 65In order to compile in support for the ccd, you must add a line similar 66to the following to your kernel configuration file: 67.Bd -unfilled -offset indent 68pseudo-device ccd 4 # concatenated disk devices 69.Ed 70.Pp 71The count argument is how many 72.Nm ccds 73memory is allocated for a boot time. In this example, no more than 4 74.Nm ccds 75may be configured. 76.Pp 77A 78.Nm ccd 79may be either serially concatenated or interleaved. To serially 80concatenate the partitions, specify the interleave factor of 0. 81.Pp 82There is a run-time utility that is used for configuring 83.Nm ccds . 84See 85.Xr ccdconfig 8 86for more information. 87.Ss The Interleave Factor 88If a 89.Nm ccd 90is interleaved correctly, a 91.Dq striping 92effect is achieved, which can increase sequential read/write 93performance. The interleave factor is expressed in units of DEV_BSIZE 94(usually 512 bytes). For large writes, the optimum interleave factor 95is typically the size of a track, while for large reads, it is about a 96quarter of a track. (Note that this changes greatly depending on the 97number and speed of disks.) For instance, with eight 7,200 RPM drives 98on two Fast-Wide SCSI buses, this translates to about 128 for writes 99and 32 for reads. 100.Pp 101The best performance is achieved if all component disks have the same 102geometry and size. Optimum striping cannot occur with different 103disk types. 104.Pp 105For random-access oriented workloads, such as news servers, a larger 106interleave factor (e.g., 65,536) is more desirable. Note that there 107isn't much 108.Nm ccd 109can do to speed up applications that are seek-time limited. Larger 110interleave factors will at least reduce the chance of having to seek 111two disk-heads to read one directory or a file. 112.Ss Disk Mirroring 113You can configure the 114.Nm ccd 115to 116.Dq mirror 117any even number of disks. See 118.Xr ccdconfig 8 119for how to specify the necessary flags. In an event of a disk 120failure, you can use 121.Xr dd 1 122to recover the failed disk. 123.Pp 124Note that a one-disk 125.Nm ccd 126is not the same as the original partition. In particular, this means 127if you have a filesystem on a two-disk mirrored 128.Nm ccd 129and one of the disks fail, you cannot mount and use the remaining 130partition as itself; you have to configure it as a one-disk 131.Nm ccd. 132.Sh WARNINGS 133If just one (or more) of the disks in a 134.Nm ccd 135fails, the entire 136file system will be lost unless you are mirroring the disks. 137.Sh FILES 138/dev/{,r}ccd* - ccd device special files. 139.Pp 140.Sh HISTORY 141The concatenated disk driver was originally written at the University of 142Utah. 143.Sh SEE ALSO 144.Xr dd 1 , 145.Xr ccdconfig 8 , 146.Xr config 8 , 147.Xr disklabel 8 , 148.Xr fsck 8 , 149.Xr MAKEDEV 8 , 150.Xr mount 8 , 151.Xr newfs 8 . 152