So now we'll spend just a little bit of time taking a look at Software RAID.
If you want to know what it stands for, and sometimes it helps,
Redundant Array of Inexpensive Disks,
although it doesn't really matter what it stands for; it's
there to create fault tolerant disk arrays.
Although,
you'll see there are other ways RAID can be configured
other than just fault tolerance.
Traditional Linux Software RAID creates, again, dev‑mapper virtual device files.
RAID, in itself, is also integrated into the btrfs file system,
so our file system can also manage the RAID itself.
When we look at the different levels of RAID that we have,
we can create a pure linear array.
This is where we're just expanding space across different disks,
and in this case, we're not using any fault tolerance at all.
RAID level 0 is similar above, but the partitions are of similar size.
RAID1 is mirroring.
So if we've got a 1 GB volume, it's actually taking 2 GB of disk space.
We can also create RAID4, 5, and 6, and with these types of arrays,
we're using 3 or more devices.
Actually, with RAID level 6, we have to be using at least 4 devices.
Our RAID is calculated using parity data that is stored on the additional disk.
We also see that we can use flags.
We've seen when using parted, we can set our lvm lag.
There is a specific flag for RAID as well.
Again,
this is more information for the operating system and hints as to
what the partition is going to be used for.
But this lists the available flags for the parted command.
Now before anything else,
we can go through and make sure that we've got the correct package installed.
Any RAID array that we have is going to be in our proc file and mdstat.
Now if we've only just installed mdadm, we know then we aren't going to have any,
but if we've got an existing system,
we can go through and check any RAID arrays that we do have.
We then go ahead and create our RAID device.
So again, using mdadm, we can go through and create.
Verbose means that we'll write to the screen.
We're going to call it then md0.
Our RAID level is going to be RAID level 1, or mirroring.
We're using two devices, and we can specify the devices that we want to use.
And again, once we've done that,
we can go through and check that our RAID is active within the proc/mdstat file.
We can also go through and check to see if the kernel module is loaded.
With this, we can use the lsmod command and grep for our RAID module.
To persist our RAID configuration, we can go ahead and check the /etc/mdadm.conf.
This is what we're going to find on AlmaLinux or any Red Hat‑based Linux system.
On Ubuntu, it's going to be in its own subdirectory.
We can populate this by using the mdadm command,
using a detail scan, and sending our output through to our configuration file.
We can test that this is working by stopping the RAID device,
and then going through and assembling it again using the scan.
We read in our configuration file,
and we make sure the device then can be created.
Now, as always,
the best way to learn is to dive out to our command line and
make sure that we can see this in action.
So we're going to do this just now to make sure that you fully understand how to set up your Software RAID.