]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/ccd.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.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$
36 .\"
37 .Dd August 9, 1995
38 .Dt CCD 4
39 .Os
40 .Sh NAME
41 .Nm ccd
42 .Nd Concatenated Disk driver
43 .Sh SYNOPSIS
44 .Cd "device ccd"
45 .Sh DESCRIPTION
46 The
47 .Nm
48 driver provides the capability of combining one or more disks/partitions
49 into one virtual disk.
50 .Pp
51 This document assumes that you are familiar with how to generate kernels,
52 how to properly configure disks and devices in a kernel
53 configuration file, and how to partition disks.
54 .Pp
55 In order to compile in support for the
56 .Nm ,
57 you must add a line similar
58 to the following to your kernel configuration file:
59 .Pp
60 .Dl "device     ccd             # concatenated disk devices"
61 .Pp
62 As of the
63 .Fx 3.0
64 release, you do not need to
65 configure your kernel with
66 .Nm
67 but may instead use it as a kernel loadable
68 module.
69 Simply running
70 .Xr ccdconfig 8
71 will load the module into the kernel.
72 .Pp
73 A
74 .Nm
75 may be either serially concatenated or interleaved.
76 To serially
77 concatenate the partitions, specify the interleave factor of 0.
78 Note that mirroring may not be used with an interleave factor of 0.
79 .Pp
80 There is a run-time utility that is used for configuring
81 .Nm Ns s .
82 See
83 .Xr ccdconfig 8
84 for more information.
85 .Ss The Interleave Factor
86 If a
87 .Nm
88 is interleaved correctly, a
89 .Dq striping
90 effect is achieved, which can increase sequential read/write
91 performance.
92 The interleave factor is expressed in units of
93 .Dv DEV_BSIZE
94 (usually 512 bytes).
95 For large writes, the optimum interleave factor
96 is typically the size of a track, while for large reads, it is about a
97 quarter of a track.
98 (Note that this changes greatly depending on the
99 number and speed of disks.)
100 For instance, with eight 7,200 RPM drives
101 on two Fast-Wide SCSI buses, this translates to about 128 for writes
102 and 32 for reads.
103 A larger interleave tends to work better when the
104 disk is taking a multitasking load by localizing the file I/O from
105 any given process onto a single disk.
106 You lose sequential performance when
107 you do this, but sequential performance is not usually an issue with a
108 multitasking load.
109 .Pp
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).
113 The interleave factor will determine
114 how I/O is broken up, however, and a value 128 or greater is recommended.
115 .Pp
116 .Nm
117 has an option for a parity disk, but does not currently implement it.
118 .Pp
119 The best performance is achieved if all component disks have the same
120 geometry and size.
121 Optimum striping cannot occur with different
122 disk types.
123 .Pp
124 For random-access oriented workloads, such as news servers, a larger
125 interleave factor (e.g., 65,536) is more desirable.
126 Note that there
127 is not 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
143 .Nm
144 configuration specifying four disks, the first two disks will be mirrored with
145 the second two disks.
146 A write will be run to both sides of
147 the mirror.
148 A read will be run to either side of the mirror depending
149 on what the driver believes to be most optimal.
150 If the read fails,
151 the driver will automatically attempt to read the same sector from the
152 other side of the mirror.
153 Currently
154 .Nm
155 uses a dual seek zone model to optimize reads for a multi-tasking load
156 rather than a sequential load.
157 .Pp
158 In an event of a disk
159 failure, you can use
160 .Xr dd 1
161 to recover the failed disk.
162 .Pp
163 Note that a one-disk
164 .Nm
165 is not the same as the original partition.
166 In particular, this means
167 if you have a file system on a two-disk mirrored
168 .Nm
169 and one of the disks fail, you cannot mount and use the remaining
170 partition as itself; you have to configure it as a one-disk
171 .Nm .
172 You cannot replace a disk in a mirrored
173 .Nm
174 partition without first backing up the partition, then replacing the disk,
175 then restoring the partition.
176 .Ss Linux Compatibility
177 The
178 .Tn Linux
179 compatibility mode does not try to read the label that
180 .Tn Linux Ns '
181 .Xr md 4
182 driver leaves on the raw devices.
183 You will have to give the order
184 of devices and the interleave factor on your own.
185 When in
186 .Tn Linux
187 compatibility mode,
188 .Nm
189 will convert the interleave factor from
190 .Tn Linux
191 terminology.
192 That means you give the same interleave factor that you
193 gave as chunk size in
194 .Tn Linux .
195 .Pp
196 If you have a
197 .Tn Linux
198 .Xr md 4
199 device in
200 .Dq legacy
201 mode, do not use the
202 .Dv CCDF_LINUX
203 flag in
204 .Xr ccdconfig 8 .
205 Use the
206 .Dv CCDF_NO_OFFSET
207 flag instead.
208 In that case you have to convert
209 the interleave factor on your own, usually it is
210 .Tn Linux Ns '
211 chunk size multiplied by two.
212 .Pp
213 Using a
214 .Tn Linux
215 RAID this way is potentially dangerous and can destroy
216 the data in there.
217 Since
218 .Fx
219 does not read the label used by
220 .Tn Linux ,
221 changes in
222 .Tn Linux
223 might invalidate the compatibility layer.
224 .Pp
225 However, using this is reasonably safe if you test the compatibility
226 before mounting a RAID read-write for the first time.
227 Just using
228 .Xr ccdconfig 8
229 without mounting does not write anything to the
230 .Tn Linux
231 RAID.
232 Then you do a
233 .Nm fsck.ext2fs Pq Pa ports/sysutils/e2fsprogs
234 on the
235 .Nm
236 device using the
237 .Fl n
238 flag.
239 You can mount the file system read-only to check files in there.
240 If all this works, it is unlikely that there is a problem with
241 .Nm .
242 Keep in mind that even when the
243 .Tn Linux
244 compatibility mode in
245 .Nm
246 is working correctly, bugs in
247 .Fx Ap s
248 .Nm ex2fs
249 implementation would still destroy
250 your data.
251 .Sh WARNINGS
252 If just one (or more) of the disks in a
253 .Nm
254 fails, the entire
255 file system will be lost unless you are mirroring the disks.
256 .Pp
257 If one of the disks in a mirror is lost, you should still
258 be able to back up your data.
259 If a write error occurs, however, data
260 read from that sector may be non-deterministic.
261 It may return the data
262 prior to the write or it may return the data that was written.
263 When a
264 write error occurs, you should recover and regenerate the data as soon
265 as possible.
266 .Pp
267 Changing the interleave or other parameters for a
268 .Nm
269 disk usually destroys whatever data previously existed on that disk.
270 .Sh FILES
271 .Bl -tag -width ".Pa /dev/ccd*"
272 .It Pa /dev/ccd*
273 .Nm
274 device special files
275 .El
276 .Sh SEE ALSO
277 .Xr dd 1 ,
278 .Xr ccdconfig 8 ,
279 .Xr config 8 ,
280 .Xr disklabel 8 ,
281 .Xr fsck 8 ,
282 .Xr gvinum 8 ,
283 .Xr mount 8 ,
284 .Xr newfs 8
285 .Sh HISTORY
286 The concatenated disk driver was originally written at the University of
287 Utah.