April 20, 2019

Using RAID in Linux - page 5

The Mysteries of RAID

  • August 1, 2002
  • By Alexander Prohorenko

This is a good question. First of all--what don't we need to keep in an array? There is no sense to keep our swap there there, especially in a RAID 0 or RAID 5 configuration. Linux can put its swap on common disks and will handle the swap space better. For example, /etc/fstab configuration can look like:

/dev/sda2       swap           swap    defaults,pri=1   0 0
/dev/sdb2       swap           swap    defaults,pri=1   0 0
/dev/sdc2       swap           swap    defaults,pri=1   0 0
/dev/sdd2       swap           swap    defaults,pri=1   0 0

which means that partitions /dev/sda2 to /dev/sdd2 are using swap with equal priority and the system will balance the load on them itself.

The only exception to this approach is when using RAID 1--in this case, the mirroring of swap-partitions can increase the long-life of your system. In case a disk crashes, then, the computer will continue to work with the swap space on the mirror.

Should we place the root file system on the array and/or try to boot from it? I don't know the proper answer, and it's a never-ending dispute among system administrators. From my point of view, there is no profitability in such a configuration, and only possible harm when you may not be able to boot at all.

In any case, it's kind of a moot point, since nowadays there is no possibility to boot from any RAID except RAID 1. Therefore, if you want to keep file systems (for some reason) on any other level of array, you will need to create a special separate partition (/boot) for kernel loading.

Also, I don't think it's good idea to keep /usr on RAID 0 or RAID 5, because in case of array rejection or breakdown, you can easily lose all the useful system tools, and without them you will have really big problems trying to restore your system integrity.

There are also the file systems /home, /opt, /var, /tmp, /usr/local and others to consider. When planning RAID, remember that usually UNIX filesystems like /home, /opt, and /usr/local obviously keep "slow-changing" data, and file systems like /var "fast-changing" data. And for /tmp, well, we don't need to take care of it at all after a system crash. So, I recommend that for /home, /opt, and /usr/local the best choice will be RAID 5 and for /var its preferable to apply RAID 0 or RAID 10. Remember, everything you decide about RAID configuration should come from your system targets and common sense.

Most Popular LinuxPlanet Stories