CertGrid CertGrid
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

One host. The array is built on three file-backed loop devices, not physical disks - the commands and the output are identical either way.
Server NameIP AddressOSRolesCPURAMHDD
LPIC2-A01192.168.0.78Ubuntu 26.04 LTSPrimary service host - BIND, Apache, Samba, Postfix. Topic 204 RAID runs on loop devices; this machine has no spare disk2 Core4 GB50 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.

Before you start

  1. Three devices out of three files

  2. A mirror with a hot spare

  3. Fail a device on purpose

  4. What the array looks like afterwards

Official sources