User:SwifT/Complete Handbook/Software RAID

Introduction
Redundant Array of Inexpensive Disks (RAID) is a technology to combine multiple disks in order to improve their reliability and/or performance. There is hardware RAID, implemented by the controller on your motherboard or specific extension cards, and there is software RAID, implemented by the kernel.

Advantages of RAID
The main advantages of RAID are reliability and/or performance improvements.

There are vast differences between soft- and hardware RAID. Differences include: cost (monetarily), performance, overhead and flexibility. Of course software RAID comes cheapest. Another advantage of soft- over hardware RAID is that you can easily move you RAID set to another (Linux) computer. With hardware RAID you will depend on the Vendor.

Disadvantages of RAID
RAID usually takes more disk space then it delivers. E.g. a RAID-1 set of 2 3TB disks delivers a 3TB RAID disk (a reduction of 50%).


 * The time it takes to synchronize you RAID disk (initially and when they need to rebuild).
 * The extra effort to manage and monitor your RAID disks. Nothing is more frustrating then loosing the 2nd disk from your 3 disk RAID-5 set after you did not notice the first disk was out-of-order for months already :-(

Installing the Tools
Start with the kernel configuration. After all, the kernel does most of the work:

Get the proper RAID admin tool:

Make sure your RAID disks are started and stopped:

Using Software RAID
To create a simple mirrored disk, make sure you have two partitions that have the same size and bring them together in your first RAID-1 disk:

The disks in the mirror will now be synchronized (also when there is no data or file system yet). you can check the status like this:

Create a filesystem of choice:

Start using the RAID!

Boot Using GRUB 2.x
When using GRUB 2.x and the root file system is located on a software RAID, add the  parameter to the Kernel parameters in

Adding Disks
To add a new disk to the software RAID, issue this command:

If the RAID has healthy members, the new disk will be added as spare disk.

Removing Disks
First determine the disk to be removed.

As you can see, there sdd1 marked as failed  and RAID missing one of disks. To remove the failed drive execute following command:

Physically replace the (sdd) disk or add blank space from another attached location.

Sometimes you may need remove healthy member. For this you need to mark drive as failed then remove it from the software RAID set. Perform this action all in one command:

Changing RAID Layout
In some cases it is necessary to change the RAID layout. An example case would be when adding disks to a RAID1 or converting a RAID1 to a RAID5.

External Resources

 * The mdadm page on Wikipedia
 * The Linux-raid kernel list