Hands-on Lab·LPIC-2
mdadm RAID, and a failure that heals itself
RAID is only interesting when something breaks, so this guide builds a RAID 1 mirror with a hot spare and then deliberately fails a member to watch the array recover on its own. It runs on loop devices, because this host has one spare disk and RAID needs several - which is also how a reader with no spare disk can follow along.
201: Filesystems and Storage Guide 7 of 29 Intermediate
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- Block devicesone 50 GB disk
- TimeAbout 18 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC2-A01 | 192.168.0.78 | Ubuntu 26.04 LTS | Primary service host - BIND, Apache, Samba, Postfix. Topic 204 RAID runs on loop devices; this machine has no spare disk | 2 Core | 4 GB | 50 GB |
This guide includes
Use this because RAID is only interesting when something breaks. This matters because the only way to know recovery works is to fail a device on purpose and watch the spare take over.
- building three devices out of three files
- assembling a mirror with a hot spare
- failing a device on purpose
- reading the member list afterwards, rather than just the summary
Before you start
- lvm-on-a-real-disk
-
Three devices out of three files
-
A mirror with a hot spare
-
Fail a device on purpose
-
What the array looks like afterwards