Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Software RAID

Direct answer

Linux software RAID (md, managed with mdadm) builds arrays from disks or partitions in the kernel: /dev/md0 with levels 0, 1, 5, 6 and 10. Configuration is stored in member superblocks and /etc/mdadm.conf.

When to use this

Use it to create, monitor or repair software RAID arrays.

First 30 seconds

1. cat /proc/mdstat.

2. mdadm --detail /dev/md0 — state clean?

3. Array in mdadm.conf and initramfs updated?

4. systemctl status mdmonitor — alerts configured?

5. Test the alert: mdadm --monitor --scan --test --oneshot.

Operational verification

members with superblocks → mdadm assembles at boot → /dev/mdN → filesystem; mdmonitor watches

Evidence · next step

For RAID → Software RAID, continue with the first unproven Topic check: Examine every candidate component before assembly and record array UUID, metadata version, role/device number, state and event counter. If that boundary is healthy, advance to the adjacent check: Compare /proc/mdstat with mdadm --detail for actual runtime level, active/working/failed/spare counts and any recovery/reshape/check progress. 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
Scope / prerequisiteUse it to create, monitor or repair software RAID arrays.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
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

component block devices → md superblocks/UUID + role/events → mdadm assembly policy → kernel md personality → /dev/md* runtime array → upper LVM/filesystem → application I/O

Healthy evidence: component metadata agrees on one intended array generation, the kernel exposes the expected UUID/level/member roles, persistent assembly is correct and the upper consumer behaves normally.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Examine every candidate component before assembly and record array UUID, metadata version, role/device number, state and event counter.

  • Compare /proc/mdstat with mdadm --detail for actual runtime level, active/working/failed/spare counts and any recovery/reshape/check progress.
  • Verify persistent naming/assembly policy and initramfs inclusion separately from the currently running array.
  • After a change, restart or reboot only when justified, then show the same UUID assembles correctly and the original upper-layer workload succeeds.

Verification chain. component block devices → md superblocks/UUID + role/events → mdadm assembly policy → kernel md personality → /dev/md* runtime array → upper LVM/filesystem → application I/O

Step 3 Specialized verification Verify boundary

Inspect /proc/mdstat and detailed array/member metadata, including state, active devices, failed/spare roles and event counters. Correlate a rebuild with underlying device SMART/path health and kernel logs. Confirm the array device is the one used by the filesystem/LVM stack. After recovery, wait for the relevant resync/rebuild to complete and then verify higher-layer consistency and workload I/O; “clean” md state does not itself show application data correctness.

Step 4 Commands Verify boundary
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
update-initramfs -u
Step 5 Failure modes and next checks Narrow the fault

Suspicious evidence: different components advertise conflicting UUIDs/events, an array is assembled from too few or stale members, or current runtime works only because manual assembly bypassed persistent boot configuration.

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 Special cases and limits Narrow the fault

RAID is availability/redundancy, not backup. A rebuild can stress remaining members and expose latent errors. An array may be assembled from stale members if identity/event state is mishandled. Filesystem corruption can persist after the array becomes clean, and controller/path errors can mimic member failure. Keep member media/path health, md metadata/array state, higher-layer filesystem and restored application correctness separate.

Step 7 Common mistakes Narrow the fault
  • Not saving the array config.
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
Key points

Save the array definition (mdadm --detail --scan >> /etc/mdadm.conf or /etc/mdadm/mdadm.conf) and rebuild the initramfs so arrays assemble at boot. Enable mdmonitor for alerts. Boot disks in RAID 1 need the bootloader on every member.

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

Separate desired mdadm configuration from on-disk md metadata and kernel runtime state. Discover component superblocks first, then correlate UUID, level, role, event count and array state with /proc/mdstat and mdadm detail/examine output. Never infer safe assembly solely from device names or an old mdadm.conf entry.

ReferenceImportant terms & boundaries6 sections · depth on demand

What this shows and what it does not

Software RAID evidence requires agreement between component metadata and kernel runtime state for the intended UUID; configuration files or a successful mdadm invocation alone do not show safe persistent assembly or workload health.

In depth

Managing arrays with mdadm

mdadm creates, assembles, monitors and repairs md arrays. The mdadm(8) manual page describes the main modes and options:

  • --create builds a new array with a given level, number of devices and chunk size. The metadata format defaults to 1.2, and "missing" can stand in for a device to create a degraded array.
  • --detail shows an assembled array, and --examine reads the metadata on a member device.
  • --detail --scan prints lines suitable for mdadm.conf.
  • --add, --fail and --remove manage members, and --grow changes the device count or the level.
  • --monitor sends mail on Fail, FailSpare, DegradedArray, SparesMissing and TestMessage events.

Metadata versions (manual)

VersionSuperblock locationNotes
0.90End of the deviceOriginal format; at most 28 devices
1.0End of the deviceMembers can be read as plain file systems (useful for /boot on RAID1)
1.1Start of the device
1.2 (default)4 KiB from the startThe standard choice

Creating an array and making it persistent

StepCommand
Create a RAID1 with a write-intent bitmapmdadm --create /dev/md0 --level=1 --raid-devices=2 --bitmap=internal /dev/sda1 /dev/sdb1
Record itmdadm --detail --scan >> /etc/mdadm/mdadm.conf (or /etc/mdadm.conf)
Include it in the initramfsupdate-initramfs -u / dracut -f
Set up alertsMAILADDR ops@example.net in mdadm.conf; check with mdadm --monitor --scan --test --oneshot

Replacing a failed disk

host$ sudo mdadm --detail /dev/md0 | grep -E "State :|Active Devices|Failed Devices|/dev/sd"
             State : clean, degraded
    Active Devices : 1
    Failed Devices : 1
       0       8        1        0      active sync   /dev/sda1
       -       8       17        -      faulty   /dev/sdb1
host$ sudo mdadm /dev/md0 --remove /dev/sdb1
host$ sudo sfdisk -d /dev/sda | sudo sfdisk /dev/sdb
host$ sudo mdadm /dev/md0 --add /dev/sdb1
mdadm: added /dev/sdb1
host$ watch -n5 cat /proc/mdstat
      [==>..................]  recovery = 12.4% (242311680/1953382400) finish=142.1min speed=200633K/sec
host$ sudo mdadm --detail --scan
ARRAY /dev/md0 metadata=1.2 UUID=6b1c2a4e:...

Notes on the example

The partition table is copied from the healthy disk to the replacement with sfdisk -d | sfdisk, so the new partition has the same size. Re-adding a member with an internal bitmap resyncs only the blocks that changed. A brand-new disk needs a full rebuild, as the recovery line shows.

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

Software RAID is part of RAID → 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.

Topic-specific state model. 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.

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. - mdadm.conf entry ≠ effective array membership; component superblocks and kernel assembly state are authoritative at runtime.

  • Device path such as /dev/sdb ≠ stable member identity; enumeration can change across boots or controllers.
  • mdadm command success ≠ filesystem/LVM consumer is consistent, mounted or workload-ready.
  • Force assembly ≠ safe assembly; stale metadata/event generations can make the wrong member look usable while risking corruption.

Specialized mechanics

Linux MD combines block devices into arrays with RAID-level-specific redundancy and performance behavior. md metadata tracks member identity, roles, events and array state; mdadm is the primary user-space management tool while the kernel md layer performs I/O. A degraded array can remain assembled and usable depending on level and failures, and rebuild/resync/recovery are distinct background operations whose progress and source/target choices matter. Array identity also depends on member metadata and assembly policy; device names such as /dev/md0 are presentation names and should not be treated as stable member identity.

Quick reference

Creating and monitoring md arrays:

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm --detail --scan >> /etc/mdadm.conf          # /etc/mdadm/mdadm.conf on Debian
dracut -f   # or update-initramfs -u, so the array assembles at boot
mdadm --detail /dev/md0
mdadm --examine /dev/sdb1
# monitoring
mdadm --monitor --scan --daemonise --mail=ops@example.com
systemctl enable --now mdmonitor

Configure MAILADDR in mdadm.conf — a degraded array nobody notices is the classic failure. Schedule periodic checks (/usr/share/mdadm/checkarray or raid-check cron/timer).

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. Software RAID evidence requires agreement between component metadata and kernel runtime state for the intended UUID; configuration files or a successful mdadm invocation alone do not show safe persistent assembly or workload health.

Preserve at least three independent checks: prerequisite/interface or identity/transport state; the responsible control/service/policy state; then effective data-plane, backend or workload state. A healthy upstream step does not show the downstream consumer or return path.

ReferenceConfiguration & state2 sections · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Software RAID owns Linux md/mdadm implementation semantics. RAID level child Topics own layout-specific behavior; Boot Process/initramfs owns early assembly dependencies; Storage RAID owns vendor-neutral RAID theory.

Specialized lifecycle

Create arrays with deliberate metadata version, member identity and RAID level, then ensure assembly policy and initramfs/boot integration are correct if the array is needed early. When replacing a member, identify the failed device by stable identity and confirm the correct new device before adding it. Avoid forcing assembly unless metadata and event counters have been understood; --force can choose a dangerous view of state. Filesystem and LVM layers above md must be handled separately during resize or recovery.

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 → Software RAID. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/admin-guide/md.html · confidence 94%
2026-09-13 · vendor docLinux MD / mdadm current

Authoritative Linux project/vendor documentation reviewed for bounded reference claims: software RAID assembly, metadata, array state and recovery boundaries. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.

Basis: https://man7.org/linux/man-pages/man8/mdadm.8.html · confidence 93%
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 software raidmdadmmd subsystemproc mdstat
Embedded reference data

Quick lookup tables

Software RAID operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateSoftware 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.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 chaincomponent block devices → md superblocks/UUID + role/events → mdadm assembly policy → kernel md personality → /dev/md* runtime array → upper LVM/filesystem → application I/OTrace requested/configured state through effective state to the observed workload result.
Failure boundarySoftware RAID proof requires agreement between component metadata and kernel runtime state for the intended UUID; configuration files or a successful mdadm invocation alone do not prove safe persistent assembly or workload health.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux RAID evidence can establish this proof path: component block devices → md superblocks/UUID + role/events → mdadm assembly policy → kernel md personality → /dev/md* runtime array → upper LVM/filesystem → application I/OUse 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. Software RAID proof requires agreement between component metadata and kernel runtime state for the intended UUID; configuration files or a successful mdadm invocation alone do not prove safe persistent assembly or workload health.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.

Software RAID · operational reference

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

Reference boundarySoftware RAID
Topic pathRAID → Software RAID
Runtime stateSoftware 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.
Fast checks- Examine every candidate component before assembly and record array UUID, metadata version, role/device number, state and event counter. - Compare /proc/mdstat with mdadm --detail for actual runtime level, active/working/failed/spare counts and any recovery/reshape/check progress. - Verify persistent naming/assembly policy and initramfs inclusion separately from the currently running array. - After a change, restart or reboot only when justified, then prove the same UUID assembles correctly and the original upper-layer workload succeeds.
Verification chaincomponent block devices → md superblocks/UUID + role/events → mdadm assembly policy → kernel md personality → /dev/md* runtime array → upper LVM/filesystem → application I/O 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 boundarySoftware RAID proof requires agreement between component metadata and kernel runtime state for the intended UUID; configuration files or a successful mdadm invocation alone do not prove safe persistent assembly or workload health. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. Preserve at least three independent checks: prerequisite/interface or identity/transport state; the owning control/service/policy state; then effective data-plane, backend or workload state. A healthy upstream boundary does not prove the downstream consumer or return path.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.

Software RAID · specialized operational reference

Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.

Operational boundaryTopic-specific reference
OwnershipKernel md layer + mdadm metadata management
Statesclean/degraded + resync/rebuild/recovery
IdentityMember UUID/role/event counters
ProofHealthy array + higher-layer consistency/workload
Confirmation

Confirm action

Continue?