1 .\" $NetBSD: ccd.4,v 1.5 1995/10/09 06:09:09 thorpej Exp $
3 .\" Copyright (c) 1994 Jason Downs.
4 .\" Copyright (c) 1994, 1995 Jason R. Thorpe.
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
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.
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
35 .\" $FreeBSD: src/share/man/man4/ccd.4,v 1.11.2.8 2001/12/17 11:30:11 ru Exp $
42 .Nd Concatenated Disk driver
44 To compile this driver into the kernel,
45 place the following lines in your
46 kernel configuration file (for 4 instances):
47 .Bd -ragged -offset indent
48 .Cd "pseudo-device ccd 4"
51 Alternatively, to load the driver as a
52 module at boot time, place the following line in
54 .Bd -literal -offset indent
60 driver provides the capability of combining one or more disks/partitions
61 into one virtual disk.
63 This document assumes that you're familiar with how to generate kernels,
64 how to properly configure disks and pseudo-devices in a kernel
65 configuration file, and how to partition disks.
69 partitions of the disks
71 be combined. The kernel will only allow component partitions of type
79 may be either serially concatenated or interleaved. To serially
80 concatenate the partitions, specify the interleave factor of 0.
81 Note that mirroring may not be used with an interleave factor of 0.
84 is a run-time utility that is used for configuring
86 Running it will load the
88 module if it is not already loaded or
90 is compiled into the kernel.
91 .Ss The Interleave Factor
94 is interleaved correctly, a
96 effect is achieved, which can increase sequential read/write
97 performance. The interleave factor is expressed in units of DEV_BSIZE
98 (usually 512 bytes). For large writes, the optimum interleave factor
99 is typically the size of a track, while for large reads, it is about a
101 (Note that this changes greatly depending on the
102 number and speed of disks.) For instance, with eight 7,200 RPM drives
103 on two Fast-Wide SCSI buses, this translates to about 128 for writes
104 and 32 for reads. A larger interleave tends to work better when the
105 disk is taking a multitasking load by localizing the file I/O from
106 any given process onto a single disk. You lose sequential performance when
107 you do this, but sequential performance is not usually an issue with a
110 An interleave factor must be specified when using a mirroring configuration,
111 even when you have only two disks (i.e. the layout winds up being the same
112 no matter what the interleave factor). The interleave factor will determine
113 how I/O is broken up, however, and a value 128 or greater is recommended.
115 CCD has an option for a parity disk, but does not currently implement it.
117 The best performance is achieved if all component disks have the same
118 geometry and size. Optimum striping cannot occur with different
121 For random-access oriented workloads, such as news servers, a larger
122 interleave factor (e.g., 65,536) is more desirable. Note that there
125 can do to speed up applications that are seek-time limited. Larger
126 interleave factors will at least reduce the chance of having to seek
127 two disk-heads to read one directory or a file.
129 You can configure the
133 any even number of disks. See
135 for how to specify the necessary flags. For example, if you have a ccd
136 configuration specifying four disks, the first two disks will be mirrored with
137 the second two disks. A write will be run to both sides of
138 the mirror. A read will be run to either side of the mirror depending
139 on what the driver believes to be most optimal. If the read fails,
140 the driver will automatically attempt to read the same sector from the
141 other side of the mirror. Currently
143 uses a dual seek zone model to optimize reads for a multi-tasking load
144 rather than a sequential load.
146 In an event of a disk
149 to recover the failed disk.
153 is not the same as the original partition. In particular, this means
154 if you have a filesystem on a two-disk mirrored
156 and one of the disks fail, you cannot mount and use the remaining
157 partition as itself; you have to configure it as a one-disk
159 You cannot replace a disk in a mirrored
161 partition without first backing up the partition, then replacing the disk,
162 then restoring the partition.
164 If just one (or more) of the disks in a
167 file system will be lost unless you are mirroring the disks.
169 If one of the disks in a mirror is lost, you should still
170 be able to backup your data. If a write error occurs, however, data
171 read from that sector may be non-deterministic. It may return the data
172 prior to the write or it may return the data that was written. When a
173 write error occurs, you should recover and regenerate the data as soon
176 Changing the interleave or other parameters for a
178 disk usually destroys whatever data previously existed on that disk.
180 .Bl -tag -width ".Pa /dev/ccd*"
195 The concatenated disk driver was originally written at the University of