ccdconfig.8 (7f3dea244c40159a41ab22da77a434d7c5b5e85a) ccdconfig.8 (18252fc19288b5afbef646fffaf46153bae40f25)
1.\" $NetBSD: ccdconfig.8,v 1.1.2.1 1995/11/11 02:43:33 thorpej Exp $
2.\"
3.\" Copyright (c) 1995 Jason R. Thorpe.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 131 unchanged lines hidden (view full) ---

140.Pp
141The component devices need to name partitions of type
142.Li FS_BSDFFS
143(or
144.Dq 4.2BSD
145as shown by
146.Xr disklabel 8 ).
147.Sh EXAMPLE
1.\" $NetBSD: ccdconfig.8,v 1.1.2.1 1995/11/11 02:43:33 thorpej Exp $
2.\"
3.\" Copyright (c) 1995 Jason R. Thorpe.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 131 unchanged lines hidden (view full) ---

140.Pp
141The component devices need to name partitions of type
142.Li FS_BSDFFS
143(or
144.Dq 4.2BSD
145as shown by
146.Xr disklabel 8 ).
147.Sh EXAMPLE
148The following command, executed from the command line, would configure ccd0
149with 4 components (/dev/da2e, /dev/da3e, /dev/da4e, /dev/da5e), and an
150interleave factor of 32 blocks.
151.Bd -unfilled -offset indent
152# ccdconfig ccd0 32 0 /dev/da2e /dev/da3e /dev/da4e /dev/da5e
148.Pp
149A number of ccdconfig examples are shown below. The arguments passed
150to ccdconfig are exactly the same as you might place in the
151.Pa /etc/ccd.conf
152configuration file. The first example creates a 4-disk stripe out of
153four scsi disk partitions. The stripe uses a 64 sector interleave.
154The second example is an example of a complex stripe/mirror combination.
155It reads as a two disk stripe of da2e and da3e which is mirrored
156to a two disk stripe of da4e and da5e. The last example is a simple
157mirror. /dev/da2e is mirrored with /dev/da4e and assigned to ccd0.
158.Pp
159.Bd -unfilled -offset
160# ccdconfig ccd0 64 none /dev/da2e /dev/da3e /dev/da4e /dev/da5e
161# ccdconfig ccd0 128 CCDF_MIRROR /dev/da2e /dev/da3e /dev/da4e /dev/da5e
162# ccdconfig ccd0 128 CCDF_MIRROR /dev/da2e /dev/da4e
153.Ed
154.Pp
163.Ed
164.Pp
165When you create a new ccd disk you generally want to
166.Nm disklabel
167it before doing anything else. Once you create the initial label you can
168edit it, adding additional partitions. The label itself takes up the first
16916 sectors of the ccd disk. If all you are doing is creating filesystems
170with newfs, you do not have to worry about this as newfs will skip the
171label area. However, if you intend to
172.Nm dd
173to or from a ccd partition it is usually a good idea to construct the
174partition such that it does not overlap the label area. For example, if
175you have A ccd disk with 10000 sectors you might create a 'd' partition
176with offset 16 and size 9984.
177.Pp
178.Bd -unfilled -offset
179# disklabel -r -w ccd0c auto
180# disklabel -e ccd0c
181.Ed
182.Pp
183The disklabeling of a ccd disk is usually a one-time affair. Unlike other
184devices, ccd currently requires that you specify partition 'c' when
185running disklabel. If you reboot the machine and reconfigure the ccd disk,
186the disklabel you
187had created before will still be there and not require reinitialization.
188Beware that changing any ccd parameters: interleave, flags, or the
189device list making up the ccd disk, will usually destroy any prior
190data on that ccd disk. If this occurs it is usually a good idea to
191reinitialize the label before [re]constructing your ccd disk.
192.Pp
193.Sh RECOVERY
194.Pp
195An error on a ccd disk is usually unrecoverable unless you are using the
196mirroring option. But mirroring has its own perils: It assumes that
197both copies of the data at any given sector are the same. This holds true
198until a write error occurs or until you replace either side of the mirror.
199.Nm Ccd
200uses a poor-man's mirroring implementation. It works well enough that if
201you begin to get disk errors you should be able to backup the ccd disk,
202replace the broken hardware, and then regenerate the ccd disk. If you need
203more then this you should look into external hardware RAID SCSI boxes,
204RAID controllers such as the
205.Nm dpt
206controller, or software RAID systems such as
207.Nm vinum .
208.Pp
155.Sh FILES
156.Bl -tag -width /etc/ccd.conf -compact
157.It Pa /etc/ccd.conf
158default ccd configuration file
159.El
160.Sh SEE ALSO
161.Xr ccd 4 ,
162.Xr rc 8
209.Sh FILES
210.Bl -tag -width /etc/ccd.conf -compact
211.It Pa /etc/ccd.conf
212default ccd configuration file
213.El
214.Sh SEE ALSO
215.Xr ccd 4 ,
216.Xr rc 8
217.Xr vinum 8
163.Sh HISTORY
164The
165.Nm
166command first appeared in
167.Nx 1.0a .
218.Sh HISTORY
219The
220.Nm
221command first appeared in
222.Nx 1.0a .