1995-12-27 10:51:05 +00:00
|
|
|
.\" $NetBSD: ccdconfig.8,v 1.1.2.1 1995/11/11 02:43:33 thorpej Exp $
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1995 Jason R. Thorpe.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
1998-06-04 06:41:26 +00:00
|
|
|
.\" must display the following acknowledgment:
|
1995-12-27 10:51:05 +00:00
|
|
|
.\" This product includes software developed for the NetBSD Project
|
|
|
|
.\" by Jason R. Thorpe.
|
|
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1998-06-04 06:41:26 +00:00
|
|
|
.\"
|
1995-12-27 10:51:05 +00:00
|
|
|
.Dd July 17, 1995
|
|
|
|
.Dt CCDCONFIG 8
|
2001-07-10 11:04:34 +00:00
|
|
|
.Os
|
1995-12-27 10:51:05 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm ccdconfig
|
|
|
|
.Nd configuration utility for the concatenated disk driver
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
.Op Fl cv
|
|
|
|
.Ar ccd
|
|
|
|
.Ar ileave
|
|
|
|
.Op Ar flags
|
|
|
|
.Ar dev
|
1998-06-04 06:41:26 +00:00
|
|
|
.Op Ar
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
.Fl C
|
|
|
|
.Op Fl v
|
|
|
|
.Op Fl f Ar config_file
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
.Fl u
|
|
|
|
.Op Fl v
|
|
|
|
.Ar ccd
|
1998-06-04 06:41:26 +00:00
|
|
|
.Op Ar
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
.Fl U
|
|
|
|
.Op Fl v
|
|
|
|
.Op Fl f Ar config_file
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
.Fl g
|
2000-12-27 14:40:52 +00:00
|
|
|
.Op Ar ccd Op Ar ...
|
1995-12-27 10:51:05 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm Ccdconfig
|
|
|
|
is used to dynamically configure and unconfigure concatenated disk
|
|
|
|
devices, or ccds. For more information about the ccd, see
|
|
|
|
.Xr ccd 4 .
|
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl c
|
|
|
|
Configure a ccd. This is the default behavior of
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm .
|
1995-12-27 10:51:05 +00:00
|
|
|
.It Fl C
|
|
|
|
Configure all ccd devices listed in the ccd configuration file.
|
|
|
|
.It Fl f Ar config_file
|
|
|
|
When configuring or unconfiguring all devices, read the file
|
|
|
|
.Pa config_file
|
|
|
|
instead of the default
|
|
|
|
.Pa /etc/ccd.conf .
|
|
|
|
.It Fl g
|
|
|
|
Dump the current ccd configuration in a format suitable for use as the
|
|
|
|
ccd configuration file. If no arguments are specified, every configured
|
|
|
|
ccd is dumped. Otherwise, the configuration of each listed ccd is dumped.
|
|
|
|
.It Fl u
|
|
|
|
Unconfigure a ccd.
|
|
|
|
.It Fl U
|
|
|
|
Unconfigure all ccd devices listed the ccd configuration file.
|
|
|
|
.It Fl v
|
1998-06-04 06:41:26 +00:00
|
|
|
Cause
|
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
to be verbose.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
A ccd is described on the command line and in the ccd configuration
|
|
|
|
file by the name of the ccd, the interleave factor, the ccd configuration
|
|
|
|
flags, and a list of one or more devices. The flags may be represented
|
|
|
|
as a decimal number, a hexadecimal number, a comma-separated list
|
|
|
|
of strings, or the word
|
|
|
|
.Dq none .
|
|
|
|
The flags are as follows:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
CCDF_SWAP 0x01 Interleave should be dmmax
|
|
|
|
CCDF_UNIFORM 0x02 Use uniform interleave
|
1996-01-31 11:04:52 +00:00
|
|
|
CCDF_MIRROR 0x04 Support mirroring
|
|
|
|
CCDF_PARITY 0x08 Support parity (not implemented yet)
|
1995-12-27 10:51:05 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The format in the
|
|
|
|
configuration file appears exactly as if it were entered on the command line.
|
|
|
|
Note that on the command line and in the configuration file, the
|
|
|
|
.Pa flags
|
|
|
|
argument is optional.
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
#
|
|
|
|
# /etc/ccd.conf
|
|
|
|
# Configuration file for concatenated disk devices
|
|
|
|
#
|
|
|
|
.Pp
|
|
|
|
# ccd ileave flags component devices
|
1998-11-19 20:22:10 +00:00
|
|
|
ccd0 16 none /dev/da2e /dev/da3e
|
1995-12-27 10:51:05 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-07-15 07:53:42 +00:00
|
|
|
The component devices need to name partitions of type
|
1999-08-06 06:25:07 +00:00
|
|
|
.Li FS_BSDFFS
|
|
|
|
(or
|
|
|
|
.Dq 4.2BSD
|
|
|
|
as shown by
|
2001-01-16 09:15:57 +00:00
|
|
|
.Xr disklabel 8 ) .
|
2000-11-17 11:44:16 +00:00
|
|
|
.Sh EXAMPLES
|
1999-09-23 10:35:48 +00:00
|
|
|
A number of ccdconfig examples are shown below. The arguments passed
|
|
|
|
to ccdconfig are exactly the same as you might place in the
|
2001-07-15 07:53:42 +00:00
|
|
|
.Pa /etc/ccd.conf
|
1999-09-23 10:35:48 +00:00
|
|
|
configuration file. The first example creates a 4-disk stripe out of
|
|
|
|
four scsi disk partitions. The stripe uses a 64 sector interleave.
|
|
|
|
The second example is an example of a complex stripe/mirror combination.
|
|
|
|
It reads as a two disk stripe of da2e and da3e which is mirrored
|
|
|
|
to a two disk stripe of da4e and da5e. The last example is a simple
|
|
|
|
mirror. /dev/da2e is mirrored with /dev/da4e and assigned to ccd0.
|
|
|
|
.Pp
|
|
|
|
.Bd -unfilled -offset
|
|
|
|
# ccdconfig ccd0 64 none /dev/da2e /dev/da3e /dev/da4e /dev/da5e
|
|
|
|
# ccdconfig ccd0 128 CCDF_MIRROR /dev/da2e /dev/da3e /dev/da4e /dev/da5e
|
|
|
|
# ccdconfig ccd0 128 CCDF_MIRROR /dev/da2e /dev/da4e
|
1995-12-27 10:51:05 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
1999-09-23 10:35:48 +00:00
|
|
|
When you create a new ccd disk you generally want to
|
|
|
|
.Nm disklabel
|
2001-07-15 07:53:42 +00:00
|
|
|
it before doing anything else. Once you create the initial label you can
|
1999-09-23 10:35:48 +00:00
|
|
|
edit it, adding additional partitions. The label itself takes up the first
|
|
|
|
16 sectors of the ccd disk. If all you are doing is creating filesystems
|
|
|
|
with newfs, you do not have to worry about this as newfs will skip the
|
|
|
|
label area. However, if you intend to
|
|
|
|
.Nm dd
|
|
|
|
to or from a ccd partition it is usually a good idea to construct the
|
|
|
|
partition such that it does not overlap the label area. For example, if
|
|
|
|
you have A ccd disk with 10000 sectors you might create a 'd' partition
|
|
|
|
with offset 16 and size 9984.
|
|
|
|
.Pp
|
|
|
|
.Bd -unfilled -offset
|
|
|
|
# disklabel -r -w ccd0c auto
|
|
|
|
# disklabel -e ccd0c
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The disklabeling of a ccd disk is usually a one-time affair. Unlike other
|
|
|
|
devices, ccd currently requires that you specify partition 'c' when
|
|
|
|
running disklabel. If you reboot the machine and reconfigure the ccd disk,
|
|
|
|
the disklabel you
|
|
|
|
had created before will still be there and not require reinitialization.
|
|
|
|
Beware that changing any ccd parameters: interleave, flags, or the
|
|
|
|
device list making up the ccd disk, will usually destroy any prior
|
|
|
|
data on that ccd disk. If this occurs it is usually a good idea to
|
|
|
|
reinitialize the label before [re]constructing your ccd disk.
|
|
|
|
.Sh RECOVERY
|
2001-07-15 07:53:42 +00:00
|
|
|
An error on a ccd disk is usually unrecoverable unless you are using the
|
1999-09-23 10:35:48 +00:00
|
|
|
mirroring option. But mirroring has its own perils: It assumes that
|
|
|
|
both copies of the data at any given sector are the same. This holds true
|
|
|
|
until a write error occurs or until you replace either side of the mirror.
|
|
|
|
.Nm Ccd
|
|
|
|
uses a poor-man's mirroring implementation. It works well enough that if
|
|
|
|
you begin to get disk errors you should be able to backup the ccd disk,
|
|
|
|
replace the broken hardware, and then regenerate the ccd disk. If you need
|
2001-11-24 19:47:12 +00:00
|
|
|
more than this you should look into external hardware RAID SCSI boxes,
|
1999-09-23 10:35:48 +00:00
|
|
|
RAID controllers such as the
|
|
|
|
.Nm dpt
|
|
|
|
controller, or software RAID systems such as
|
|
|
|
.Nm vinum .
|
1995-12-27 10:51:05 +00:00
|
|
|
.Sh FILES
|
1998-06-04 06:41:26 +00:00
|
|
|
.Bl -tag -width /etc/ccd.conf -compact
|
|
|
|
.It Pa /etc/ccd.conf
|
|
|
|
default ccd configuration file
|
|
|
|
.El
|
1995-12-27 10:51:05 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ccd 4 ,
|
2000-12-14 16:24:38 +00:00
|
|
|
.Xr rc 8 ,
|
1999-09-23 10:35:48 +00:00
|
|
|
.Xr vinum 8
|
1995-12-27 10:51:05 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1998-06-04 06:41:26 +00:00
|
|
|
.Nm
|
1995-12-27 10:51:05 +00:00
|
|
|
command first appeared in
|
|
|
|
.Nx 1.0a .
|