1994-11-30 19:22:03 +03:00
|
|
|
.\" $NetBSD: ccd.4,v 1.3 1994/11/30 16:22:06 jtc Exp $
|
1994-08-04 04:18:03 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1994 Jason Downs
|
|
|
|
.\" Copyright (c) 1994 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
|
|
|
|
.\" must display the following acknowledgement:
|
1994-08-06 02:54:09 +04:00
|
|
|
.\" This product includes software developed by Jason Downs and
|
|
|
|
.\" Jason R. Thorpe.
|
1994-08-04 04:18:03 +04:00
|
|
|
.\" 4. Neither the name of the author nor the names of its contributors
|
|
|
|
.\" may 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.
|
|
|
|
.\"
|
|
|
|
.Dd August 3, 1994
|
|
|
|
.Dt CCD 4
|
|
|
|
.Os BSD 4
|
|
|
|
.Sh NAME
|
|
|
|
.Nm ccd
|
|
|
|
.Nd procedure for configuring concatenated disk devices
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver provides the capability of `concatenating' two
|
|
|
|
or more disks/partitions into one virtual disk.
|
|
|
|
.Pp
|
|
|
|
This document assumes that you're familiar with how to generate kernels,
|
|
|
|
and how to properly set up a system configuration file.
|
|
|
|
.Pp
|
|
|
|
First, you need to add the disks that you wish to concatenate to your
|
|
|
|
kernel configuration. They should probably have `hard-coded' id numbers
|
|
|
|
as opposed to wildcards, since you don't want the autoconfig sequence
|
|
|
|
to move these disks around. For a hp300, your config might look something
|
|
|
|
like this:
|
|
|
|
.Pp
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
master hpib0 at scode7
|
|
|
|
master hpib1 at scode?
|
|
|
|
master hpib2 at scode?
|
|
|
|
disk rd0 at hpib1 slave 0
|
|
|
|
disk rd1 at hpib1 slave 1
|
|
|
|
disk rd2 at hpib1 slave 2
|
|
|
|
disk rd3 at hpib2 slave 0
|
|
|
|
disk rd4 at hpib2 slave 1
|
|
|
|
tape ct0 at hpib0 slave ?
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
In this example, the disks rd3 and rd4 will be concatenated.
|
|
|
|
.Pp
|
|
|
|
The `c' partitions of the disks
|
|
|
|
.Pa should not
|
|
|
|
be concatenated. Rather, you should use some other partition, which is
|
|
|
|
defined in the individual labels of each disk, to use the entire disk
|
|
|
|
.Pa except the first cylinder.
|
|
|
|
This is to avoid corrupting the labels of component disks within the
|
|
|
|
concatenated disk. In this example, the `h' partition will be used.
|
|
|
|
.Pp
|
|
|
|
The next piece is the pseudo-device line in your kernel configuration file
|
|
|
|
that actually configures the
|
|
|
|
.Nm
|
|
|
|
device. It should look something like:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
pseudo-device ccd0 on rd3h and rd4h interleave 8192
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
This will configure a virtual disk using rd3h and rd4h, interleaving the access
|
|
|
|
at every 8192 blocks. An interleave is recommended, but not required; if it
|
|
|
|
is not specified, the driver will use each disk in sequence, which isn't as
|
|
|
|
efficient as interleaving the access.
|
|
|
|
.Pp
|
|
|
|
In this example, the disks to be concatenated are HP 7958s, which are
|
|
|
|
approximately 120 megabytes in size. The label on each of the
|
|
|
|
example disks reads as follows:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
# /dev/rrd3c:
|
|
|
|
type: HP-IB
|
|
|
|
disk:
|
|
|
|
label:
|
|
|
|
flags:
|
|
|
|
bytes/sector: 512
|
|
|
|
sectors/track: 36
|
|
|
|
tracks/sector: 7
|
|
|
|
sectors/cylinder: 252
|
|
|
|
cylinders: 1013
|
|
|
|
rpm: 3600
|
|
|
|
interleave: 1
|
|
|
|
trackskew: 0
|
|
|
|
cylinderskew: 0
|
|
|
|
headswitch: 0 # milliseconds
|
|
|
|
track-to-track seek: 0 # milliseconds
|
|
|
|
drivedata: 0
|
|
|
|
.Pp
|
|
|
|
2 partitions:
|
|
|
|
# size offset fstype [fsize bsize cpg]
|
|
|
|
c: 255276 0 boot 1024 4096 16 # (Cyl. 0 - 1012)
|
|
|
|
h: 255024 252 4.2BSD 1024 4096 15 # (Cyl. 1 - 1012)
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Of course, this label will not work for any other type of disk, so you
|
|
|
|
will have to create your own. In the simple case, make the `h' (or whatever
|
|
|
|
partition you specified in your ccd pseudo-device specification) the size of
|
|
|
|
partition `c',
|
|
|
|
minus the number of sectors/cylinder, and set the offset to the same
|
|
|
|
number as your sectors/cylinder. This leaves an extra cylinder for the label
|
|
|
|
to reside in.
|
|
|
|
.Pp
|
|
|
|
Once you have given each disk an appropriate label, you should reboot
|
|
|
|
with the newly generated, ccd-capable kernel.
|
|
|
|
.Pp
|
|
|
|
At boot time, shortly after the autoconfig sequence, you should see a message
|
|
|
|
like the following:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
ccd0: 2 components (rd3h, rd4h), 507904 blocks interleaved at 8192
|
|
|
|
ccd0 configured
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
If you do not see this message, then the
|
|
|
|
.Nm
|
|
|
|
device is
|
|
|
|
.Pa NOT
|
|
|
|
configured.
|
|
|
|
.Pp
|
|
|
|
Now it is time to make the device nodes for the concatenated disk, if you
|
|
|
|
have not done so already. You can do this with the
|
|
|
|
.Xr MAKEDEV 8
|
|
|
|
script, as follows:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
# cd /dev
|
|
|
|
# sh MAKEDEV ccd0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Now you need to create
|
|
|
|
.Xr disktab 5
|
|
|
|
entry for the virtual disk, since it does not
|
|
|
|
support labels within itself. The following is appropriate for this
|
|
|
|
example:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
rd7958-2:\\
|
|
|
|
:ty=winchester:ns#36:nt#7:nc#2024:\\
|
|
|
|
:pc#507904:bc#4096:fc#1024
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
All values are copied from the `standard' entry, taking into account any
|
|
|
|
differences from your label(s), except:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
nc#4048
|
|
|
|
This is the total number of cylinders. This should be the
|
|
|
|
total number of cylinders from all of the partitions you
|
|
|
|
defined your ccd to encompass.
|
|
|
|
.Pp
|
|
|
|
pc#507904
|
|
|
|
This is the total size, which is not the sum of all of the
|
|
|
|
partitions configured as the ccd. Use the number reported
|
|
|
|
by the autoconfig sequence.
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
If your
|
|
|
|
.Xr disktab 5
|
|
|
|
entry is set up correctly, you can now use
|
|
|
|
.Xr newfs 8
|
|
|
|
to create a file system on the virtual disk:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
# newfs /dev/rccd0c rd7958-2
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
where `/dev/rccd0c' is the raw device of the
|
|
|
|
.Nm
|
|
|
|
device, and `rd7958-2' is the name
|
|
|
|
of your
|
|
|
|
.Xr disktab 5
|
|
|
|
entry.
|
|
|
|
.Pp
|
|
|
|
You should now have a working file system on the concatenated disk, which you
|
|
|
|
can
|
|
|
|
.Xr fsck 8
|
|
|
|
and
|
|
|
|
.Xr mount 8
|
|
|
|
just like any other, normal, disk.
|
|
|
|
.Sh WARNINGS
|
|
|
|
Presumably, you must use disks of all of the same type. The results of using
|
|
|
|
disks with different geometries would be unpredictable, at best.
|
|
|
|
.Pp
|
|
|
|
If just one (or more) of the disks in a concatenated disk fails, the entire
|
|
|
|
file system will be lost.
|
|
|
|
.Pp
|
|
|
|
There is a kernel-level limit of eight devices per one
|
|
|
|
.Nm
|
|
|
|
device.
|
|
|
|
.Sh BUGS
|
|
|
|
Currently, the
|
|
|
|
.Nm
|
|
|
|
driver works only on the hp300. It should be fairly easy to add
|
|
|
|
support for other architectures using
|
|
|
|
.Xr config 8 ,
|
|
|
|
but support for architectures using
|
|
|
|
.Xr config.new 8
|
|
|
|
is more difficult.
|
|
|
|
.Sh FILES
|
|
|
|
/etc/disktab - disk description file
|
|
|
|
.Pp
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr MAKEDEV 8 ,
|
|
|
|
.Xr disktab 5 ,
|
|
|
|
.Xr newfs 8 ,
|
|
|
|
.Xr fsck 8 ,
|
|
|
|
.Xr mount 8 ,
|
|
|
|
.Xr config 8 ,
|
|
|
|
.Xr config.new 8
|