xref: /netbsd-src/share/man/man4/ccd.4 (revision 054f95470cfd21e32486598184c3f54e49b3b98b)
1.\"	$NetBSD: ccd.4,v 1.32 2014/10/27 16:20:48 wiz Exp $
2.\"
3.\" Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jason R. Thorpe.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.\" Copyright (c) 1994 Jason Downs.
31.\" All rights reserved.
32.\"
33.\" Redistribution and use in source and binary forms, with or without
34.\" modification, are permitted provided that the following conditions
35.\" are met:
36.\" 1. Redistributions of source code must retain the above copyright
37.\"    notice, this list of conditions and the following disclaimer.
38.\" 2. Redistributions in binary form must reproduce the above copyright
39.\"    notice, this list of conditions and the following disclaimer in the
40.\"    documentation and/or other materials provided with the distribution.
41.\"
42.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
43.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
44.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
45.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
46.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
47.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
48.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
49.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52.\" SUCH DAMAGE.
53.\"
54.Dd November 30, 2013
55.Dt CCD 4
56.Os
57.Sh NAME
58.Nm ccd
59.Nd Concatenated disk driver
60.Sh SYNOPSIS
61.Cd pseudo-device ccd
62.Sh DESCRIPTION
63The
64.Nm
65driver provides the capability of combining one or more disks/partitions
66into one virtual disk.
67.Pp
68This document assumes that you're familiar with how to generate kernels,
69how to properly configure disks and pseudo-devices in a kernel
70configuration file, and how to partition disks.
71.Pp
72Note that the
73.Sq raw
74partitions of the disks
75.Pa must not
76be combined.
77Each component partition should be offset at least one cylinder
78from the beginning of the component disk.
79This avoids potential conflicts between the component disk's
80disklabel and the
81.Nm Ns 's
82disklabel.
83The kernel will only allow component partitions of type
84.Dv FS_CCD .
85But for now, it allows partition of all types since some port
86lacks support of an on-disk BSD disklabel.
87The partition of
88.Dv FS_UNUSED
89may be rejected because device driver of component disk will refuse it.
90.Pp
91In order to compile in support for the
92.Nm ,
93you must add a line similar
94to the following to your kernel configuration file:
95.Bd -unfilled -offset indent
96pseudo-device	ccd	# concatenated disk devices
97.Ed
98.Pp
99The
100.Nm Ns s
101are allocated dynamically as needed.
102.Pp
103A
104.Nm
105may be either serially concatenated or interleaved.
106To serially concatenate the partitions, specify the interleave factor of 0.
107.Pp
108If a
109.Nm
110is interleaved correctly, a
111.Dq striping
112effect is achieved, which can increase performance.
113.\" The optimum interleave factor is typically the size of a track,
114.\" see
115.\" .Dq sectors/track
116.\" value in
117.\" .Xr disklabel 8
118.\" output.
119Since the interleave factor is expressed in units of
120.Dv DEV_BSIZE ,
121one must account for sector sizes other than
122.Dv DEV_BSIZE
123in order to calculate the correct interleave.
124The kernel will not allow an interleave factor less than the size
125of the largest component sector divided by
126.Dv DEV_BSIZE .
127.Pp
128Note that best performance is achieved if all component disks have the same
129geometry and size.
130Optimum striping cannot occur with different disk types.
131.Pp
132Also note that the total size of concatenated disk may vary depending on
133the interleave factor even if the exact same components are concatenated.
134And an old on-disk disklabel may be read after interleave factor change.
135As a result, the disklabel may contain wrong partition geometry and
136will cause an error when doing I/O near the end of concatenated disk.
137.Pp
138There is a run-time utility that is used for configuring
139.Nm Ns s .
140See
141.Xr ccdconfig 8
142for more information.
143.Sh WARNINGS
144If just one (or more) of the disks in a non-mirrored
145.Nm
146fails, the entire file system will be lost.
147.Sh FILES
148.Bl -tag -width /dev/XXrXccdX -compact
149.It Pa /dev/{,r}ccd*
150.Nm
151device special files.
152.El
153.Sh SEE ALSO
154.Xr config 1 ,
155.Xr ccdconfig 8 ,
156.Xr fsck 8 ,
157.Xr MAKEDEV 8 ,
158.Xr mount 8 ,
159.Xr newfs 8
160.Sh HISTORY
161The concatenated disk driver was originally written at the University of Utah.
162