ccd.4: Break line after sentence.
[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 .\"
37 .Dd February 15, 2013
38 .Dt CCD 4
39 .Os
40 .Sh NAME
41 .Nm ccd
42 .Nd Concatenated Disk driver
43 .Sh SYNOPSIS
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"
49 .Ed
50 .Pp
51 Alternatively, to load the driver as a
52 module at boot time, place the following line in
53 .Xr loader.conf 5 :
54 .Bd -literal -offset indent
55 ccd_load="YES"
56 .Ed
57 .Sh DESCRIPTION
58 The
59 .Nm
60 driver provides the capability of combining one or more disks/partitions
61 into one virtual disk.
62 .Pp
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.
66 .Pp
67 Note that the
68 .Sq raw
69 partitions of the disks
70 .Em should not
71 be combined.
72 The kernel will only allow component partitions of type FS_CCD (type
73 .Dq ccd
74 as shown by
75 .Xr disklabel 8 ) .
76 .Pp
77 A
78 .Nm
79 may be either serially concatenated or interleaved.
80 To serially concatenate the partitions, specify the interleave factor of 0.
81 Note that mirroring may not be used with an interleave factor of 0.
82 .Pp
83 .Xr ccdconfig 8
84 is a run-time utility that is used for configuring
85 .Nm Ns s .
86 Running it will load the
87 .Nm
88 module if it is not already loaded or
89 .Nm
90 is compiled into the kernel.
91 .Ss The Interleave Factor
92 If a
93 .Nm
94 is interleaved correctly, a
95 .Dq striping
96 effect is achieved, which can increase sequential read/write
97 performance.
98 The interleave factor is expressed in units of DEV_BSIZE (usually 512 bytes).
99 For large writes, the optimum interleave factor
100 is typically the size of a track, while for large reads, it is about a
101 quarter of a track.
102 (Note that this changes greatly depending on the
103 number and speed of disks.)  For instance, with eight 7,200 RPM drives
104 on two Fast-Wide SCSI buses, this translates to about 128 for writes
105 and 32 for reads.
106 A larger interleave tends to work better when the
107 disk is taking a multitasking load by localizing the file I/O from
108 any given process onto a single disk.
109 You lose sequential performance when
110 you do this, but sequential performance is not usually an issue with a
111 multitasking load.
112 .Pp
113 An interleave factor must be specified when using a mirroring configuration,
114 even when you have only two disks (i.e.\& the layout winds up being the same
115 no matter what the interleave factor).
116 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.
123 Optimum striping cannot occur with different 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.
127 Note that there isn't much
128 .Nm
129 can do to speed up applications that are seek-time limited.
130 Larger
131 interleave factors will at least reduce the chance of having to seek
132 two disk-heads to read one directory or a file.
133 .Ss Disk Mirroring
134 You can configure the
135 .Nm
136 to
137 .Dq mirror
138 any even number of disks.
139 See
140 .Xr ccdconfig 8
141 for how to specify the necessary flags.
142 For example, if you have a ccd
143 configuration specifying four disks, the first two disks will be mirrored with
144 the second two disks.
145 A write will be run to both sides of the mirror.
146 A read will be run to either side of the mirror depending
147 on what the driver believes to be most optimal.
148 If the read fails,
149 the driver will automatically attempt to read the same sector from the
150 other side of the mirror.
151 Currently
152 .Nm
153 uses a dual seek zone model to optimize reads for a multi-tasking load
154 rather than a sequential load.
155 .Pp
156 In an event of a disk
157 failure, you can use
158 .Xr dd 1
159 to recover the failed disk.
160 .Pp
161 Note that a one-disk
162 .Nm
163 is not the same as the original partition.
164 In particular, this means if you have a filesystem on a two-disk mirrored
165 .Nm
166 and one of the disks fail, you cannot mount and use the remaining
167 partition as itself; you have to configure it as a one-disk
168 .Nm .
169 You cannot replace a disk in a mirrored
170 .Nm
171 partition without first backing up the partition, then replacing the disk,
172 then restoring the partition.
173 .Sh WARNINGS
174 If just one (or more) of the disks in a
175 .Nm
176 fails, the entire
177 file system will be lost unless you are mirroring the disks.
178 .Pp
179 If one of the disks in a mirror is lost, you should still
180 be able to backup your data.
181 If a write error occurs, however, data
182 read from that sector may be non-deterministic.
183 It may return the data
184 prior to the write or it may return the data that was written.
185 When a
186 write error occurs, you should recover and regenerate the data as soon
187 as possible.
188 .Pp
189 Changing the interleave or other parameters for a
190 .Nm
191 disk usually destroys whatever data previously existed on that disk.
192 .Sh FILES
193 .Bl -tag -width ".Pa /dev/ccd*"
194 .It Pa /dev/ccd*
195 .Nm
196 device special files
197 .El
198 .Sh SEE ALSO
199 .Xr dd 1 ,
200 .Xr ccdconfig 8 ,
201 .Xr config 8 ,
202 .Xr disklabel 8 ,
203 .Xr fsck 8 ,
204 .Xr mount 8 ,
205 .Xr newfs 8 ,
206 .Xr vinum 8
207 .Sh HISTORY
208 The concatenated disk driver was originally written at the University of
209 Utah.