Pcornel
Linux

RAID

Cheat sheet · https://pcornel.dk/topic.php?topic=2768

Back to the Topic

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.

Remember

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.

First 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

Commands

mdadm
Inspect, assemble, create and manage Linux MD software RAID arrays.
mdadm --detail /dev/md0
mdadm --monitor

Verify in this order

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

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2768

Confirmation

Confirm action

Continue?