FreeBSD Handbook
Prev | Chapter 20 GEOM: Modular Disk Transformation Framework | Next

# 20.3 RAID0 - Striping

Written by Tom Rhodes and Murray Stokely.

Striping is a method used to combine several disk drives into a single volume. In many cases, this is done through the use of hardware controllers. The GEOM disk subsystem provides software support for RAID0, also known as disk striping.

In a RAID0 system, data are split up in blocks that get written across all the drives in the array. Instead of having to wait on the system to write 256k to one disk, a RAID0 system can simultaneously write 64k to each of four different disks, offering superior I/O performance. This performance can be enhanced further by using multiple disk controllers.

Each disk in a RAID0 stripe must be of the same size, since I/O requests are interleaved to read or write to multiple disks in parallel.

Creating a Stripe of Unformatted ATA Disks

1. Load the `geom_stripe.ko` module:

       # kldload geom_stripe

2. Ensure that a suitable mount point exists. If this volume will become a root partition, then temporarily use another mount point such as `/mnt`:

       # mkdir /mnt

3. Determine the device names for the disks which will be striped, and create the new stripe device. For example, to stripe two unused and unpartitioned ATA disks, for example `/dev/ad2` and `/dev/ad3`:

       # gstripe label -v st0 /dev/ad2 /dev/ad3
       Metadata value stored on /dev/ad2.
       Metadata value stored on /dev/ad3.
       Done.

4. Write a standard label, also known as a partition table, on the new volume and install the default bootstrap code:

       # bsdlabel -wB /dev/stripe/st0

5. This process should have created two other devices in the `/dev/stripe` directory in addition to the `st0` device. Those include `st0a` and `st0c`. At this point a file system may be created on the `st0a` device with the `newfs` utility:

       # newfs -U /dev/stripe/st0a

   Many numbers will glide across the screen, and after a few seconds, the process will be complete. The volume has been created and is ready to be mounted.

To manually mount the created disk stripe:

    # mount /dev/stripe/st0a /mnt

To mount this striped file system automatically during the boot process, place the volume information in `/etc/fstab` file. For this purpose, a permanent mount point, named `stripe`, is created:

    # mkdir /stripe
    # echo "/dev/stripe/st0a /stripe ufs rw 2 2" \
        >> /etc/fstab

The `geom_stripe.ko` module must also be automatically loaded during system initialization, by adding a line to `/boot/loader.conf`:

    # echo 'geom_stripe_load="YES"' >> /boot/loader.conf

Prev | Home | Next
GEOM Introduction | Up | RAID1 - Mirroring