Subject: how to concatenate disks
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: jason downs <downsj@CSOS.ORST.EDU>
List: current-users
Date: 08/03/1994 04:19:29
[the following should probably be in some sort of FAQ, so people don't have
 to go to the 'source', as i did.]

How To Concatenate Disks
--- -- ----------- -----

This document assumes that you're familiar with how to generate kernels, and
how to properly set up a system configuration file.  This document also
assumes that you're using a fairly up to date system, as there are bugs
limiting the use of concatenated disks; hopefully these will get fixed.
This document also assumes you're using the hp300; your results will vary
with other platforms, but this should give you a good idea of how to
proceed.

First, you need to add the disks that you wish to concatenate to your
kernel config.  These should probably all have hard coded id numbers and
such, since you *really* don't want the autoconfig sequence to move these
disks around.  Here's a section of my config:

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
disk            rd5     at hpib2 slave 2
disk            rd6     at hpib2 slave 3
tape            ct0     at hpib0 slave ?

In this example, I'm going to be concatenating the devices rd3, rd4, rd5,
and rd6.

Contrary to popular belief you really should *not* concatenate the 'c'
partition of these disks.  Rather, you should use some other partition,
which you define in the individual disklabels of each disk to be the
entire disk, except the first cylinder.  This way, the concatenated
filesystem does not write into the disklabel area of the disk.

In this example, I will be using the 'h' partition of each disk.

The line that actually sets up the ccd is:

pseudo-device   ccd0 on rd3h and rd4h and rd5h and rd6h interleave 8192

This will set up a ccd using rd3h, rd4h, rd5h, and rd6h, interleaving the
access every 8192k blocks.

The 'interleave' is important.  From my reading of the code, without
this specified, the driver will use each full disk in sequence, which
really doesn't seem as efficient as interleaving the access.

In my system all of the concatenated disks are hp7958s, which are ~120meg
drives.  I've set the disklabel on each of them up as:

# /dev/rrd3c:
type: HP-IB
disk: 
label: 
flags:
bytes/sector: 512
sectors/track: 36
tracks/cylinder: 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 

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  c:   255276        0      boot     1024  4096    16   # (Cyl.    0 - 1012)
  h:   255024      252    4.2BSD     1024  4096    16   # (Cyl.    1 - 1012)

Of course, this disklabel most likely won't work on any other disk type, so
you'll have to roll your own.  Simply make partition 'h' (or whatever you
gave in the ccd pseudo-device declaration) the size of partition 'c', minus
the number of sectors per cylinder, and set the offset to the same sectors/
cylinder.

Once the label is set up on each disk, you should reboot with the newly
generated ccd kernel.

At boot time, it will come up with a message like this, shortly after it
autoconfigures all the drives:

ccd0: 4 components (rd3h, rd4h, rd5h, rd6h), 1015808 blocks interleaved at 8192 blocks
ccd0 configured

If you don't get this message, the ccd is NOT configured.

You should cd into your /dev, and do a MAKEDEV cd0, if you haven't already.

No it's time to write a disktab entry for the ccd, since it doesn't support
disklabels in itself.

I used the following, based on the standard hp300 7958 entry:

rd7958-4:\
        :ty=winchester:ns#36:nt#7:nc#4052:\
        :pc#1015808:bc#4096:fc#1024:

All values are copied from the 'standard' entry, taking into account
any differences from your disklabel(s), except:

nc#4052

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.

pc#1015808

This is the total size, and should be the total size from all of the
partitions your configured into your ccd.

If your disktab is set up correctly, you can now newfs your ccd:

# newfs /dev/rccd0c rd7958-4

Where '/dev/rccd0c' is the raw device, and 'rd7958-4' is the name of your
disktab entry.  Note that the hp300 MAKEDEV may very will name this
'rcd0c', if it hasn't been fixed yet.

You should now have a working concatenated disk, which can be fsck'd,
mounted, and used just like any other, normal, disk.

Written by Jason Downs, <downsj@CSOS.ORST.EDU>; inspired by some mail
written by Mike Hibler.



--
                    ----------------------------------------
-------------------// jason downs // downsj@CSOS.ORST.EDU //------------------
                   ----------------------------------------      JD105
		  http://www.CSOS.ORST.EDU/downsj/index.html
		       have you fed your sysadmin today?

------------------------------------------------------------------------------