Ubuntu Server 18.04 – Understanding RAID

How to manage remote IIS on Windows Server 2019

Now that we know the ins and outs of managing storage, we must face a simple and uncomfortable truth: disks fail. It’s not a matter of if, but when—all disks will fail eventually. When they do, we rely on our backups and disaster recovery procedures to get up and running. One thing that can help us with this burden is RAID, which is an acronym for Redundant Array of Inexpensive Disks. The basic idea of RAID is that when a disk does fail, we don’t lose any data (unless additional disks fail) and we’ll continue on without any significant downtime assuming we replace the disk within a reasonable time frame. This isn’t used as a backup, but it is a nice safety net in a situation where we lose a disk.

There are two types of RAID, hardware RAID and software RAID. With hardware RAID, the operating system is completely oblivious to the fact that RAID is even present. In this case, RAID is managed by a hardware controller card on the server, that completely abstracts the disk layout from the OS. Basically, the OS only sees one disk regardless of how many are on the controller card. With software RAID, the operating system manages the RAID configuration, and it does see all the disks. On a server with RAID already set up, it’s very easy to see whether or not you’re running with software or hardware RAID. Simply use the sudo fdisk -l command, which shows us the disks installed in the system. If it shows only one disk, it’s hardware RAID. If it shows multiple, it’s software.

Hardware RAID is beyond the scope of this tutorial. Reason being, each controller card is different, and many servers have a different implementation so there is no way to cover them all. With hardware RAID, you’d want to consult the documentation that came with your server for information on how to configure it.

Software RAID is much more common with Linux, and is generally a better choice (though some administrators would argue the opposite, and they wouldn’t necessarily be wrong depending on their environment). Most of the RAID controller cards out there are known as fakeRAID, which means that it attempts to operate as close to hardware RAID as possible, but at the end of the day it’s easy to tell the difference (true hardware RAID means the server only sees one disk). What’s worse is that some of these controller cards, even if they are true hardware RAID, do not ship drivers for Linux distributions, and may not function on anything other than Windows. The Linux implementation of software RAID is known as MDRAID, which we manage via the mdadm command. Since this is a native Linux tool, it works very well for this purpose. (In case you’re wondering, the mdadm command is an acronym for Multiple Disk And Disk Administration).

Another benefit of MDRAID is that we can easily use the mdadm command-line tool to query the status of the RAID array, to determine its health. We can also write scripts that will check the array periodically, and alert us if there is failure. Hardware RAID can certainly alert us as well, but native tools in a Linux installation are generally more reliable and this is yet another reason why I prefer this approach.

To implement MDRAID it’s preferable to do so right at the beginning—and set it up while installing Ubuntu. For this, we need to use the alternative installer, because this feature is not available with the default Ubuntu installer. In the appendix at the end of the tutorial, the alternative installer is covered. In addition, the setup process for RAID is covered there as well. If you feel you would benefit from RAID, consult the appendix to learn more.

Comments are closed.