Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 1996 03:34:52 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        stable@freebsd.org, hackers@freebsd.org
Cc:        ccd@forgery.cs.berkeley.edu
Subject:   New version of ccd driver available
Message-ID:  <199601311134.DAA07361@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
(Note crosspost: followups set to `stable')

A new version of the ccd driver is now available from:

  ftp://forgery.cs.berkeley.edu/pub/ccd-960131.tar.gz

Attached below is the README file.  It now includes mirroring support, 
so if you have gobs of disk space and need more reliability than
straight striping, please try it!

Satoshi
-------
$Id: ccd.README,v 1.1 1996/01/31 10:39:54 asami Exp $
**********************************************************
*           The FreeBSD ccd driver (pre-alpha)           *
*                    for 2.1.0-RELEASE users             *
*                           by Satoshi Asami             *
*                          and Nisha Talagala            *
*                         version of 96/01/31            *
**********************************************************

(0) Changes from previous version (Jan/14)

 . There is mirroring support
 . ccdcontrol is renamed ccdconfig (back to original NetBSD name)
 . ccdconfig is now in /sbin (so you can call it from rc -- a patch to 
   rc is also included)

(1) Introduction

This is a port of NetBSD's ccd (concatenated disk) driver.  It is not
a complete work in any way, but seems to be working fairly ok here, so
we decided to make it available so that people can test it and even
fix some bugs. :)

(2) Warning

As the title above says, this is pre-alpha software and is therefore
VERY GREEN.  You should not expect this to work.  It may eat your
system disk for lunch.  It may even fry your microwave in the process.
Make sure you have backed up all your data and locked your children in
the basement before you attempt to try this.

(3) What it does

In case you don't know what it is, ccd is a disk array driver.  You
can combine several disk partitions into one "virtual disk".  Then you
can partition it or use the whole thing or add some pepper and salt or
whatever you want.

(4) What it does not

There is no parity support yet.  That's why its name doesn't resemble
RAID in any form.  However, there is mirroring available starting
from the Jan/31 version.

(4a) Cool, how do I use mirroring?

Add CCDF_MIRROR to the list of flags (third field in /etc/ccd.conf),
and your disk space will magically shrink into half.  The writes go to
all disks, while the reads will all come from the first n/2 disks.

If one of the disk goes "poof", you can reconfigure the ccd to use
only half the disks without mirroring.  That should keep your users
happy until you get the chance to put in the replacement disk.  When
the new disk is installed, use the ccd recovery program called `dd'
(which mysteriously made its way into the release even before we put
out an alpha version of ccd), e.g., to copy sd1g to sd4g,

dd if=/dev/sd1g of=/dev/sd4g bs=1048576

(5) How to compile

Note this package is for FreeBSD-2.1.0R.  It probably won't work right
away for -stable or -current.  We are planning to upgrade our machines
soon, and will release snapshots for -current as well.

Ok, first you need to unpack the distribution.  It contains the
following files:

  ccd.README (this file)
  ccd.PLIST
  ccd.patch
  sys/ccd/ccd.4
  sys/ccd/ccd.c
  sys/sys/ccdvar.h
  sbin/ccdconfig/Makefile
  sbin/ccdconfig/ccdconfig.8
  sbin/ccdconfig/ccdconfig.c
  sbin/ccdconfig/pathnames.h

You can unpack them in your /usr/src directory.

After that, apply the ccd.patch.  It makes several changes to the
header files and such, including one totally ridiculous change to
sys/disk.h that was done by a certain FreeBSD hacker who owns a
hamster with one black eye and one red eye.  (Someone please tell me
how to fix it properly.)  You can use the following command to apply
the patch:

patch -p < ccd.patch

(On a separate line for your triple-clicking pleasure.)

There is a patch to rc in there, so take a look at your /etc/rc and
install the new one.  If you have changed your /etc/rc, either cut &
paste the relevant lines or take out the hunk pertaining rc and apply
it to your /etc/rc.

Then add the following to your kernel configuration file:

device	ccd0	at isa?
device	ccd1	at isa?
device	ccd2	at isa?
device	ccd3	at isa?

(You can have as many of them as you want, or fewer than four, of
course.)

We recommend you to add "options DDB" too.  This will make the kernel
go into a debugger in case of a panic.  That will make it easier for
you to send us a complete bug report.  (Note this will disable
auto-rebooting after a panic, so don't do this on a machine that has
to run unattended.)

(6) How to use ccd

Wait, you need to compile ccdconfig too!  Go in there, do "make
depend all install".  If install complains about missing directories
and such, make sure you have the correct Makefile.inc in the parent
(/usr/src/sbin) directory.  If you don't have one (like, you don't
have the usr.sbin source tree), just editing the ccdconfig Makefile
and adding "BINDIR=/sbin" and "NOSHARED=YES" by hand should do.

Also, you will need to create the device files.  There is a patch to
MAKEDEV included in ccd.patch, so go into etc/etc.i386 and install the
new MAKEDEV into /dev.  Then you can, say, "cd /dev; sh MAKEDEV ccd0"
to create the appropriate device files for your first ccd devices,
etc.

Now, go and read the man pages.  ccdconfig.8 should be installed by
now; ccd.4 is still sitting in the source directory so go read it
there.  (Try "nroff -man ccd.4 | less -s".)

Assuming you've read them, here is an example, if you have four
partitions (sd1g, sd2g, sd3g, sd4g) you want to combine into one:

echo "ccd0 16 none /dev/sd1g /dev/sd2g /dev/sd3g /dev/sd4g" > /etc/ccd.conf
ccdconfig -Cv (to configure; you'll see a message here)
disklabel ccd0 (just to make sure there is a valid disklabel)
newfs /dev/rccd0c
mount /dev/ccd0c /mnt
(play with /mnt)
umount /mnt
ccdconfig -U (to unconfigure)

(7) What's the second field in /etc/ccd.conf?

That's the "interleave size".  Basically, the ccd driver will write
this many sectors (usually 512 bytes) to one disk before it moves to
the next disk.  As a special case, a zero here means no interleave,
i.e., to concatenate disks serially.

We have found that in FFS, a value of 16 usually optimizes read
performance, while the write peaks with a much larger value (like
512).  This probably has to do with cluster_write() thinking it's
writing to a single disk when it's actually not.  This is one of the
things we are planning to fix.

(8) Are there any caveats?

Oh sure.  One of them is "don't use a partition that starts at a
beginning of the slice".  So please leave some space at the beginning
of the slice in the partitions you are combining (sd[1-4]g in the
above example).  Of course, if someone can figure out why and fix it,
that will be great.

(9) My disk is totally hosed.  It's all your fault!

See (2).

(10) Anything I can help?

Well, any bug fix is welcome.  In addition to the stuff mentioned
above, we are aware of at least the following:

 a. Since I didn't know how to properly register a pseudo-device, this
    baby thinks it's a ISA device (look at kern_devconf and isa_driver
    and such in ccd.c).  It should be specified like "pseudo-device
    ccd 4" in the kernel configuration file (like the manual says).

 b. I'm not exactly sure what the "geometry" of this pseudo-disk
    means.  If it doesn't matter, it's ok; if newfs (for instance)
    cares, we should give it a better set of default values.

(11) Where should I send bug reports/fixes?

Please send them to ccd@forgery.cs.berkeley.edu.  This will reach the
two primary developers (Satoshi and Nisha), as well as other
interested parties.  If you want to be added to this list, please send
mail to Satoshi (asami@cs.berkeley.edu).

(12) Where do I get new versions?

They will be made available as

ftp://forgery.cs.berkeley.edu/pub/ccd-<date>.tar.gz

so check this site regularly.

(13) I'm tired

Yeah, I'm tired too.  Well go to sleep now then, and try it tomorrow!
Good night!

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601311134.DAA07361>