1.9. Soft RAID

The purpose of RAID (redundant array of inexpensive disks) is to combine several hard disk partitions into one large virtual hard disk for the optimization of performance and data security. Using this method, however, one advantage is sacrificed for another. RAID level defines the pool and common triggering device of the all hard disks, the RAID controller. A RAID controller mostly uses the SCSI protocol, because it can drive more hard disks better than the IDE protocol. It is also better able to process commands running in parallel.

Like a RAID controller, which can often be quite expensive, soft RAID is also able to take on these tasks. SUSE LINUX offers the option of combining several hard disks into one soft RAID system with the help of YaST — a very reasonable alternative to hardware RAID.

1.9.1. Common RAID Levels

RAID 0

This level improves the performance of your data access. Actually, this is not really a RAID, because it does not provide data backup, but the name RAID 0 for this type of system has become the norm. With RAID 0, two hard disks are pooled together. The performance is very good — although the RAID system will be destroyed and your data lost if even one of hard disks fails.

RAID 1

This level provides adequate security for your data, as the data is copied to another hard disk 1:1. This is known as hard disk mirroring. If a disk is destroyed, a copy of its contents is available on another one. All of them except one could be damaged without endangering your data. The writing performance suffers a little in the copying process when using RAID 1 (ten to twenty percent slower), but read access is significantly faster in comparison to any one of the normal physical hard disks, because the data is duplicated so can be parallel scanned.

RAID 5

RAID 5 is an optimized compromise between the two other levels in terms of performance and redundancy. The hard disk space equals the number of disks used minus one. The data is distributed over the hard disks as with RAID 0. Parity blocks, created on one of the partitions, are there for security reasons. They are linked to each other with XOR — enabling the contents, via XDR, to be reconstructed by the corresponding parity block in case of system failure. With RAID 5, no more than one hard disk can fail at the same time. If one hard disk fails, it must be replaced as soon as possible to avoid the risk of losing data.

1.9.2. Soft RAID Configuration with YaST

Access Soft RAID configuration with the RAID module under System or via the partitioning module under Hardware.

1.9.2.1. First Step: Partitioning

First, see a list of your partitions under Expert Settings in the partitioning tool. If the Soft RAID partitions have already been set up, they appear here. Otherwise, set them up from scratch. For RAID 0 and RAID 1, at least two partitions are needed — for RAID 1, usually exactly two and no more. If RAID 5 is used, at least three partitions are required. It is recommended to take only partitions of the same size. The RAID partitions should be stored on various hard disks to decrease the risk of losing data if one is defective (RAID 1 and 5) and to optimize the performance of RAID 0.

1.9.2.2. Second Step: Setting up RAID

Click RAID to open a dialog in which to choose between RAID levels 0, 1, and 5. In the following screen, assign the partition to the new RAID. Expert Options opens the settings options for the chunk size — for fine-tuning the performance. Checking Persistent Superblock ensures that the RAID partitions are recognized as such when booting. After completing the configuration, you will then see the /dev/md0 device and others indicated with RAID on the expert page in the partitioning module.

1.9.3. Troubleshooting

Find out whether a RAID partition has been destroyed by the file contents /proc/mdstats. The basic procedure in case of system failure is to shut down your Linux system and replace the defective hard disk with a new one partitioned the same way. Then restart your system and give the raidhotadd /dev/mdX /dev/sdX command. This enables the hard disk to be integrated automatically into the RAID system and be fully reconstructed.

1.9.4. For More Information

Configuration instructions and more details for Soft RAID can be found in the HOWTOs at:

  • /usr/share/doc/packages/raidtools/Software-RAID-HOWTO.html

  • http://en.tldp.org/HOWTO/Software-RAID-HOWTO.html

Linux RAID mailing lists are also available, such as http://www.mail-archive.com/linux-raid@vger.rutgers.edu.