Posted by: jasonk2600 | November 18, 2009

Quickie HowTo – RAID 0 on FreeBSD

Configure The Kernel

First, add the ccd device to your kernel configuration.

device    ccd

Recompile, install, and boot with the new kernel.  The GENERIC kernel configuration file is used in the example below, replace GENERIC with your kernel configuration file if you have a different one.

# cd /usr/src
# make buildkernel KERNCONF=GENERIC

   ....[ Lots of output here ]....

# make instalkernel KERNCONF=GENERIC

   ....[ Lots of output here ]....

# reboot

Setup The Disks

Next, label the disks to be used in the RAID array with bsdlabel.  In the example below /dev/afd0 and /dev/afd1 are used, replace them with the device names of the drives you are using.

# bsdlabel -w afd0 auto
# bsdlabel -w afd1 auto

Build And Format The RAID Array

Create the RAID 0 pseudo device “/dev/ccd0” and add the newly labeled disks to the array.

# ccdconfig ccd0 32 0 /dev/afd0 /dev/afd1

Finally, format the newly created RAID 0 array.

# newfs /dev/ccd0

The RAID 0 array can now be mounted using /dev/ccd0 just like a normal hard drive.  To automatically mount the RAID 0 array at system boot see the optional section below.

OPTIONAL: Auto Mount At System Boot

In the example below the RAID 0 array on /dev/ccd0 is automatically mounted to /RAID at system boot.  Replace /RAID with a mount point of your choice.

If necessary, create a new mount point for the RAID 0 array.

# mkdir /RAID

Generate /etc/ccd.conf.

# ccdconfig -g > /etc/ccd.conf

Finally, edit /etc/fstab and add the following to enable the automatic mount of the RAID 0 array to /RAID at system boot.

/dev/ccd0    /RAID   ufs   rw   2   2



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: