Reorder to alphabetical order.
[dragonfly.git] / share / man / man4 / ccd.4
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: src/share/man/man4/ccd.4,v 1.11.2.8 2001/12/17 11:30:11 ru Exp $
36 .\" $DragonFly: src/share/man/man4/ccd.4,v 1.2 2003/06/17 04:36:58 dillon Exp $
37 .\"
38 .Dd August 9, 1995
39 .Dt CCD 4
40 .Os
41 .Sh NAME
42 .Nm ccd
43 .Nd Concatenated Disk driver
44 .Sh SYNOPSIS
45 .Cd "pseudo-device ccd 4"
46 .Sh DESCRIPTION
47 The
48 .Nm
49 driver provides the capability of combining one or more disks/partitions
50 into one virtual disk.
51 .Pp
52 This document assumes that you're familiar with how to generate kernels,
53 how to properly configure disks and pseudo-devices in a kernel
54 configuration file, and how to partition disks.
55 .Pp
56 Note that the
57 .Sq raw
58 partitions of the disks
59 .Pa should not
60 be combined.  The kernel will only allow component partitions of type
61 FS_BSDFFS (type
62 .Dq Bx 4.2
63 as shown as
64 .Xr disklabel 8 ) .
65 .Pp
66 In order to compile in support for the ccd, you must add a line similar
67 to the following to your kernel configuration file:
68 .Bd -unfilled -offset indent
69 pseudo-device   ccd     4       # concatenated disk devices
70 .Ed
71 .Pp
72 The count argument is how many
73 .Nm Ns 's
74 memory is allocated for a boot time.  In this example, no more than 4
75 .Nm Ns s
76 may be configured.  As of the
77 .Fx 3.0
78 release, you do not need to
79 configure your kernel with ccd but may instead use it as a kernel loadable
80 module.  Simply running
81 .Nm ccdconfig
82 will load the module into the kernel.
83 .Pp
84 A
85 .Nm
86 may be either serially concatenated or interleaved.  To serially
87 concatenate the partitions, specify the interleave factor of 0.
88 Note that mirroring may not be used with an interleave factor of 0.
89 .Pp
90 There is a run-time utility that is used for configuring
91 .Nm Ns s .
92 See
93 .Xr ccdconfig 8
94 for more information.
95 .Ss The Interleave Factor
96 If a
97 .Nm
98 is interleaved correctly, a
99 .Dq striping
100 effect is achieved, which can increase sequential read/write
101 performance.  The interleave factor is expressed in units of DEV_BSIZE
102 (usually 512 bytes).  For large writes, the optimum interleave factor
103 is typically the size of a track, while for large reads, it is about a
104 quarter of a track.
105 (Note that this changes greatly depending on the
106 number and speed of disks.)  For instance, with eight 7,200 RPM drives
107 on two Fast-Wide SCSI buses, this translates to about 128 for writes
108 and 32 for reads.  A larger interleave tends to work better when the
109 disk is taking a multitasking load by localizing the file I/O from
110 any given process onto a single disk.  You lose sequential performance when
111 you do this, but sequential performance is not usually an issue with a
112 multitasking load.
113 .Pp
114 An interleave factor must be specified when using a mirroring configuration,
115 even when you have only two disks (i.e. the layout winds up being the same
116 no matter what the interleave factor).  The interleave factor will determine
117 how I/O is broken up, however, and a value 128 or greater is recommended.
118 .Pp
119 CCD has an option for a parity disk, but does not currently implement it.
120 .Pp
121 The best performance is achieved if all component disks have the same
122 geometry and size.  Optimum striping cannot occur with different
123 disk types.
124 .Pp
125 For random-access oriented workloads, such as news servers, a larger
126 interleave factor (e.g., 65,536) is more desirable.  Note that there
127 isn't much
128 .Nm
129 can do to speed up applications that are seek-time limited.  Larger
130 interleave factors will at least reduce the chance of having to seek
131 two disk-heads to read one directory or a file.
132 .Ss Disk Mirroring
133 You can configure the
134 .Nm
135 to
136 .Dq mirror
137 any even number of disks.  See
138 .Xr ccdconfig 8
139 for how to specify the necessary flags.   For example, if you have a ccd
140 configuration specifying four disks, the first two disks will be mirrored with
141 the second two disks.  A write will be run to both sides of
142 the mirror.  A read will be run to either side of the mirror depending
143 on what the driver believes to be most optimal.  If the read fails,
144 the driver will automatically attempt to read the same sector from the
145 other side of the mirror.  Currently
146 .Nm
147 uses a duel seek zone model to optimize reads for a multi-tasking load
148 rather then a sequential load.
149 .Pp
150 In an event of a disk
151 failure, you can use
152 .Xr dd 1
153 to recover the failed disk.
154 .Pp
155 Note that a one-disk
156 .Nm
157 is not the same as the original partition.  In particular, this means
158 if you have a filesystem on a two-disk mirrored
159 .Nm
160 and one of the disks fail, you cannot mount and use the remaining
161 partition as itself; you have to configure it as a one-disk
162 .Nm .
163 You cannot replace a disk in a mirrored
164 .Nm
165 partition without first backing up the partition, then replacing the disk,
166 then restoring the partition.
167 .Sh WARNINGS
168 If just one (or more) of the disks in a
169 .Nm
170 fails, the entire
171 file system will be lost unless you are mirroring the disks.
172 .Pp
173 If one of the disks in a mirror is lost, you should still
174 be able to backup your data.  If a write error occurs, however, data
175 read from that sector may be non-deterministic.  It may return the data
176 prior to the write or it may return the data that was written.  When a
177 write error occurs, you should recover and regenerate the data as soon
178 as possible.
179 .Pp
180 Changing the interleave or other parameters for a
181 .Nm
182 disk usually destroys whatever data previously existed on that disk.
183 .Sh FILES
184 .Bl -tag -width ".Pa /dev/ccd*"
185 .It Pa /dev/ccd*
186 .Nm
187 device special files
188 .El
189 .Sh HISTORY
190 The concatenated disk driver was originally written at the University of
191 Utah.
192 .Sh SEE ALSO
193 .Xr dd 1 ,
194 .Xr ccdconfig 8 ,
195 .Xr config 8 ,
196 .Xr disklabel 8 ,
197 .Xr fsck 8 ,
198 .Xr MAKEDEV 8 ,
199 .Xr mount 8 ,
200 .Xr newfs 8 ,
201 .Xr vinum 8