Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jan 1996 04:14:40 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        hackers@freebsd.org
Cc:        stable@freebsd.org, ccd@forgery.cs.berkeley.edu
Subject:   ccd driver or 2.1R available
Message-ID:  <199601141214.EAA01042@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
(Note crossposting -- followups to -stable only please, this is 2.1R
 material.)

I put up the initial snapshot of the ccd driver on ftp.  The README is 
included below.

Satoshi
-------
**********************************************************
*           The FreeBSD ccd driver (pre-alpha)           *
*                    for 2.1.0-RELEASE users             *
*                           by Satoshi Asami             *
*                          and Nisha Talagala            *
*                         version of 96/01/14            *
**********************************************************

(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.

(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
  usr.sbin/ccdcontrol/Makefile
  usr.sbin/ccdcontrol/ccdcontrol.8
  usr.sbin/ccdcontrol/ccdcontrol.c
  usr.sbin/ccdcontrol/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.)

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 ccdcontrol 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/usr.sbin) directory.  If you don't have one (like, you don't
have the usr.sbin source tree), just editing the ccdcontrol Makefile
and adding "BINDIR=/usr/sbin" 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.  ccdcontrol.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
ccdcontrol -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
ccdcontrol -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 developers (Satoshi and Nisha).  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?199601141214.EAA01042>