Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

RAID

Direct answer

RAID combines disks for redundancy and/or performance. On Linux it is done in software (mdadm), by LVM/Btrfs/ZFS, or by a hardware controller.

When to use this

Use it to choose a RAID level or as the entry point for RAID problems.

First 30 seconds

1. cat /proc/mdstat — [UU] healthy or [U_] degraded?

2. mdadm --detail /dev/md0 — failed member?

3. Disk health: smartctl -a.

4. Monitoring and mail configured? (mdadm --detail --scan, mdadm.conf MAILADDR)

5. Plan replacement and rebuild.

Operational verification

disks → RAID layer → array device → filesystem; monitoring alerts on failures

Evidence · next step

For RAID, continue with the first unproven Topic check: Identify the exact md device, array UUID/name, RAID level, metadata version, chunk/layout and expected member count before changing state. If that boundary is healthy, advance to the adjacent check: Map each component by stable device identity and record role, state, event counter, errors and whether it is active, spare, removed or faulty. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandmdadm
Scope / prerequisiteUse it to choose a RAID level or as the entry point for RAID problems.
Reference · 1
What next?3 suggested next steps
Child topics (this level)8
Catalog command links1
Evidence1
On this pageJump to a specific section
Linux command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

physical/virtual block devices → stable member identity + md metadata/events → array assembly + RAID personality/layout → md device state → recovery/reshape/check if active → LVM/filesystem consumer → mount/application I/O → workload verification

Healthy evidence: the intended UUID assembles with the expected level, member roles and event generation, reports clean/redundant state with no unexplained recovery, and upper-layer reads/writes match the original workload.

Step 2 Commands Verify boundary
cat /proc/mdstat
mdadm --detail /dev/md0
mdadm --examine /dev/sdb1
Step 3 Verification and output interpretation Verify boundary

Verification path. Walk the same stack the workload uses: physical/path health → block identity/size/errors → partition/device-mapper/RAID/LVM state → filesystem integrity/capacity → mount options/namespace → application I/O.

Existing fast checks for this Topic. - Identify the exact md device, array UUID/name, RAID level, metadata version, chunk/layout and expected member count before changing state.

  • Map each component by stable device identity and record role, state, event counter, errors and whether it is active, spare, removed or faulty.
  • Separate md-array state from lower media/path health and upper LVM/filesystem/application state; stop at the first failing step.
  • After the smallest justified repair or recovery, show clean/redundant array state, upper-layer consistency and the original workload plus an adjacent regression check.

Verification chain. physical/virtual block devices → stable member identity + md metadata/events → array assembly + RAID personality/layout → md device state → recovery/reshape/check if active → LVM/filesystem consumer → mount/application I/O → workload verification

Step 4 Verification path Verify boundary

Exercise one safe negative or boundary case implied by missing device, stale UUID, degraded RAID, inactive LV, thin-pool exhaustion, read-only filesystem, mount namespace mismatch, full blocks/inodes or permission/MAC denial.

Step 5 Failure modes and next checks Narrow the fault

Suspicious evidence: an md device exists but is degraded, auto-assembled from stale members, rebuilding unexpectedly, missing a role, reporting mismatched metadata/events or hiding an unhealthy upper consumer.

It does not show behavior outside the captured host/VM, array UUID, metadata generation, member set, device/path health, recovery window, upper filesystem/LVM, time or workload scope. RAID verification ends only when the intended array is assembled with the expected member/role state and redundancy, no unexplained recovery or mismatch remains, and the upper consumer plus original workload read back successfully.

Next check: Continue from the first unproven RAID boundary: capture exact member metadata and downstream state, preserve recoverability, change only the demonstrated cause, verify stable array membership/redundancy, then repeat the original upper-layer workload and adjacent regression checks.

Step 6 Common mistakes Narrow the fault
  • Not saving mdadm.conf and updating the initramfs.
  • No monitoring (mdadm --monitor) for degraded arrays.
Step 7 Where it fails Narrow the fault

Walk hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O and stop where observed state diverges.

Common failure classes are missing device, stale UUID, degraded RAID, inactive LV, thin-pool exhaustion, read-only filesystem, mount namespace mismatch, full blocks/inodes or permission/MAC denial.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Software RAID

Software RAID covers the Linux md subsystem and mdadm-managed arrays where the kernel RAID personality performs mirroring, striping or parity across block devices and persistent md metadata identifies member roles and array identity.

Subtopic RAID 0

RAID 0 stripes data across multiple members to aggregate capacity and parallel I/O but provides no redundancy: loss or unreadability of any required member makes portions of the logical array unavailable and normally invalidates the whole dataset.

Subtopic RAID 1

RAID 1 mirrors logical blocks across members so a surviving in-sync copy can continue serving data after selected member failures, subject to the configured member count, metadata state and integrity of the remaining copies.

Subtopic RAID 5

RAID 5 stripes data and single distributed parity across at least three members, tolerating one member failure while introducing parity read-modify-write/full-stripe behavior and a critical degraded/rebuild window.

Subtopic RAID 6

RAID 6 uses dual distributed parity so an array can tolerate up to two member failures within its redundancy model, at the cost of additional parity work and a recovery window whose risk rises as failures accumulate.

Subtopic RAID 10

RAID 10 in Linux md combines mirrored copies with striping/layout rules to provide redundancy and parallelism; actual fault tolerance depends on which copies fail and on the configured near/far/offset layout rather than only the count of failed devices.

Subtopic Rebuild

Rebuild covers Linux md recovery/resynchronization after a member is added, replaced, re-added or an array requires synchronization, with emphasis on source-member health, progress, completion semantics and post-recovery verification.

Subtopic RAID Troubleshooting

RAID Troubleshooting is the Linux md failure-isolation workflow for missing arrays, degraded membership, stale metadata, failed assembly, unexpected recovery, recurring member faults, performance symptoms and upper-layer failures without destroying recoverability.

Key points

RAID is not a backup. Monitor arrays (mdadm --monitor, email) — a degraded array must be fixed before a second disk fails. Rebuilds stress the remaining disks.

Key checks
  • cat /proc/mdstat — md arrays and sync status
  • mdadm --detail /dev/md<n> — array state and members
  • mdadm --examine /dev/<dev> — member superblock
  • smartctl -H /dev/<disk> — disk health
ReferenceWhat it is1 section · depth on demand

Core model

Treat RAID as a layered state machine rather than a label such as RAID1 or RAID5. Pin the exact array UUID/name and metadata version, enumerate member devices by stable identity and role, read current array state and event counters, show whether the array is clean/degraded/recovering/reshaping, then verify the upper LVM/filesystem and original workload independently.

ReferenceWhy it matters1 section · depth on demand

Overview

Linux RAID options: md (mdadm, kernel software RAID), LVM RAID (lvcreate --type raid1/5/6/10, uses md internally), filesystem RAID (Btrfs, ZFS), and hardware controllers (managed with vendor tools: storcli, perccli, ssacli).

LevelMin disksUsableSurvives
RAID 02100 %0
RAID 1250 %n−1 mirrors
RAID 53(n−1)/n1
RAID 64(n−2)/n2
RAID 10450 %1 per mirror pair
cat /proc/mdstat
ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

RAID verification ends only when the intended array is assembled with the expected member/role state and redundancy, no unexplained recovery or mismatch remains, and the upper consumer plus original workload read back successfully.

In depth

Software RAID with md: levels and behaviour

Linux software RAID is provided by the md driver. The md(4) manual page describes its capabilities:

  • Levels: RAID1 (mirroring), RAID4 and RAID5 (striping with parity), RAID6 (two parity blocks) and RAID10 (striped mirrors), plus non-redundant RAID0 and LINEAR.
  • Fault tolerance: RAID4 and RAID5 survive one failed device, RAID6 survives two, and RAID1 survives all but one.
  • Degraded operation: a degraded array keeps running. But a RAID4/5/6 array that is both degraded and dirty (after an unclean shutdown) won't start automatically, because of the risk of silent data loss.
  • Write-intent bitmap: shortens the resync after a crash, and lets a briefly removed device be re-added without a full rebuild.

Choosing a level

LevelMinimum devicesUsable capacitySurvivesTypical use
RAID02100 %NothingScratch space, throughput
RAID121 devicen−1 failuresBoot and OS disks, small servers
RAID53n−1 devices1 failureBulk storage (with care for large disks)
RAID64n−2 devices2 failuresLarge arrays of big disks
RAID102 (4 typical)50 % (with 2 copies)1 per mirror setDatabases, VMs: random I/O

Monitoring and health

CheckCommand or file
Overall status/proc/mdstat
One array in detailmdadm --detail /dev/md0
Scrub (read and compare everything)echo check > /sys/block/md0/md/sync_action
Inconsistencies found/sys/block/md0/md/mismatch_cnt
Alertsmdadm --monitor with MAILADDR

Scrubbing

The manual explains that writing check to sync_action reports inconsistencies without changing anything, while repair corrects them. Many distributions run a monthly check by timer. On RAID1 and RAID10, a non-zero mismatch count isn't necessarily corruption, especially when the array holds swap.

host$ cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid1 sdb1[1] sda1[0]
      1953382400 blocks super 1.2 [2/2] [UU]
      bitmap: 2/15 pages [8KB], 65536KB chunk
md1 : active raid6 sdf1[3] sde1[2] sdd1[1] sdc1[0]
      7813771264 blocks super 1.2 level 6, 512k chunk, algorithm 2 [4/3] [UUU_]
host$ echo check | sudo tee /sys/block/md0/md/sync_action
host$ cat /sys/block/md0/md/mismatch_cnt
0
host$ systemctl list-timers | grep -i mdcheck

Reading /proc/mdstat

[2/2] [UU] means two of two devices are up. md1 shows [4/3] [UUU_]: four devices expected, three working, and the last slot (sdf1) has failed. The RAID6 array still has one parity's worth of redundancy left, but the disk should be replaced now.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Runtime state ownership and mechanics. Linux storage is layered: hardware/path and block devices, partition tables, device mapper or MD RAID, LVM, filesystem, mount namespace and application I/O. Filesystem capacity, inode availability, thin-pool metadata/data usage, RAID redundancy, multipath state and block-device errors can fail independently.

Topic-specific state model. RAID is the Linux reference for combining multiple block devices into an array whose layout determines capacity, redundancy, failure tolerance, write behavior and recovery semantics before an upper filesystem or LVM consumer uses the resulting md device.

Technical metadata. Host/VM identity, distribution/kernel/mdadm version, md device + array UUID/name, RAID level, metadata version, chunk/layout, expected/active/working/failed/spare counts, member stable identity, role/device number/state/event count, /proc/mdstat, md detail/examine, recovery/resync/check/reshape progress, kernel/device/path errors, LVM/filesystem/mount state, backup status and original workload result.

Interpretation rule. - Array assembled ≠ array healthy; Linux can expose an md device while one or more members are missing or faulty.

  • Redundancy present ≠ backup exists; RAID protects selected device failures, not deletion, corruption, ransomware or site loss.
  • All member devices visible ≠ metadata/event state agrees that they belong to the same current array generation.
  • Recovery completed ≠ application data is correct; rebuild reproduces array blocks and must be followed by upper-layer and workload verification.

Mechanics

Follow the path in order: hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O.

Important negative cases include missing device, stale UUID, degraded RAID, inactive LV, thin-pool exhaustion, read-only filesystem, mount namespace mismatch, full blocks/inodes or permission/MAC denial.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. RAID verification ends only when the intended array is assembled with the expected member/role state and redundancy, no unexplained recovery or mismatch remains, and the upper consumer plus original workload read back successfully.

Free filesystem space says nothing about LVM thin-pool exhaustion or RAID redundancy. RAID rebuild completion does not show application data correctness. /etc/fstab syntax validation does not show the device will appear at next boot.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Linux RAID owns Linux md/MD RAID operational state and recovery. Storage RAID owns generic parity/mirroring theory; Disks & Block Devices owns member presentation; LVM/Filesystems owns consumers; Backup & Restore owns independent recovery copies.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in RAID. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/admin-guide/md.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux raidmd raid linuxmdadm raidlinux software raid
Embedded reference data

Quick lookup tables

RAID operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for RAID.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateRAID is the Linux reference for combining multiple block devices into an array whose layout determines capacity, redundancy, failure tolerance, write behavior and recovery semantics before an upper filesystem or LVM consumer uses the resulting md device.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact host + array UUID/name → capture /proc/mdstat + md detail → examine every candidate member superblock/role/event count → prove lower device/path health → identify clean/degraded/recovery/reshape state → change one demonstrated cause → verify expected active membership/redundancy → read back LVM/filesystem → repeat original workload and regression.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainphysical/virtual block devices → stable member identity + md metadata/events → array assembly + RAID personality/layout → md device state → recovery/reshape/check if active → LVM/filesystem consumer → mount/application I/O → workload verificationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryRAID verification ends only when the intended array is assembled with the expected member/role state and redundancy, no unexplained recovery or mismatch remains, and the upper consumer plus original workload read back successfully.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux RAID evidence can establish this proof path: physical/virtual block devices → stable member identity + md metadata/events → array assembly + RAID personality/layout → md device state → recovery/reshape/check if active → LVM/filesystem consumer → mount/application I/O → workload verificationUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host/VM, array UUID, metadata generation, member set, device/path health, recovery window, upper filesystem/LVM, time or workload scope. RAID verification ends only when the intended array is assembled with the expected member/role state and redundancy, no unexplained recovery or mismatch remains, and the upper consumer plus original workload read back successfully.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven RAID boundary: capture exact member metadata and downstream state, preserve recoverability, change only the demonstrated cause, verify stable array membership/redundancy, then repeat the original upper-layer workload and adjacent regression checks.Continue to the next unresolved boundary while preserving the original test condition.

RAID · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryRAID
Topic pathRAID
Runtime stateRAID is the Linux reference for combining multiple block devices into an array whose layout determines capacity, redundancy, failure tolerance, write behavior and recovery semantics before an upper filesystem or LVM consumer uses the resulting md device.
Fast checks- Identify the exact md device, array UUID/name, RAID level, metadata version, chunk/layout and expected member count before changing state. - Map each component by stable device identity and record role, state, event counter, errors and whether it is active, spare, removed or faulty. - Separate md-array state from lower media/path health and upper LVM/filesystem/application state; stop at the first failed boundary. - After the smallest justified repair or recovery, prove clean/redundant array state, upper-layer consistency and the original workload plus an adjacent regression check.
Verification chainphysical/virtual block devices → stable member identity + md metadata/events → array assembly + RAID personality/layout → md device state → recovery/reshape/check if active → LVM/filesystem consumer → mount/application I/O → workload verification Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryRAID verification ends only when the intended array is assembled with the expected member/role state and redundancy, no unexplained recovery or mismatch remains, and the upper consumer plus original workload read back successfully. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?