23.6 When to Use Hardware RAID vs Software RAID

Alright, let’s settle this ancient, holy war. You’re standing there, looking at your server or your pile of drives, and you have to decide: do you let a dedicated piece of hardware manage your data redundancy, or do you let the Linux kernel itself do the heavy lifting? The answer, like most good things in system administration, is “it depends,” but I can tell you that for 99% of you reading this, the answer is going to be software RAID with mdadm. Let’s break down why, and more importantly, when you might actually want to reach for that expensive hardware card.

23.5 RAID and LVM Together: Common Layered Setups

Right, so you’ve got your RAID array built. It’s beautiful. It’s redundant. It’s… a single, big, dumb block device. That’s like buying a giant, empty warehouse and just throwing all your stuff in one big pile. It works, but good luck organizing it. This is where LVM waltzes in, puts up some walls, installs some shelves, and turns that raw space into something you can actually use. Think of RAID (mdadm) as your foundation for performance and resilience. It’s all about the disks. LVM (Logical Volume Manager), on the other hand, is about flexibly managing the storage space on top of that foundation. It’s the interior designer for your data warehouse. Layering LVM on top of RAID gives you the best of both worlds: the reliability of RAID with the sheer flexibility of LVM. You can resize filesystems on the fly, take snapshots, and create volumes of different sizes without having to pre-plan every partition until your brain melts.

23.4 Adding a Spare and Rebuilding After Disk Failure

Alright, let’s get our hands dirty. Your array is degraded. A drive has thrown in the towel, and the little [U_] in your mdadm --detail output is mocking you. Don’t panic. This is exactly what you built this system for. It’s not a disaster; it’s a feature. Think of it like your car’s “check engine” light—annoying, but a sign the system is smart enough to know something’s wrong. Your job now is to be the mechanic.

23.3 /proc/mdstat and mdadm --detail: Monitoring Array Health

Alright, let’s talk about checking the pulse of your RAID array. You didn’t go through all the trouble of building this digital Voltron just to cross your fingers and hope for the best. You need to know its status, and for that, we have two primary tools: the kernel’s status file, /proc/mdstat, and the Swiss Army knife itself, mdadm --detail. One gives you the quick, at-a-glance view; the other gives you the full medical chart. You’ll use both.

23.2 mdadm: Creating, Assembling, and Managing Software RAID

Right, let’s get our hands dirty with mdadm. This isn’t some glossy GUI wizard that hides the messy bits from you; this is the command-line power tool that actually builds the arrays. Think of it as the difference between ordering a pre-made sandwich and being handed a knife, a fresh loaf, and the finest ingredients. More work? Absolutely. But you get exactly what you want, and you know it’s made right.

23.1 RAID Levels: 0 (Striping), 1 (Mirroring), 5, 6, and 10

Alright, let’s talk RAID levels. Forget the marketing fluff from hardware vendors; we’re going to look at this from the perspective of someone who has to actually use and, more importantly, recover these things. RAID isn’t a backup. Let me say that again so it sinks in: RAID is not a backup. It’s a tool for uptime and performance. You back up your data to a separate system, preferably off-site. Got it? Good. Now, let’s get our hands dirty with the main levels you’ll configure with mdadm.

— joke —

...