Use it when configuring, checking or troubleshooting Parity in RAID.
Parity · RAID
Parity RAID spreads data and parity across a stripe. Small writes may require read-modify-write or reconstruct-write work, while full-stripe writes can reduce that overhead. Single- and dual-parity layouts differ in how many member failures per protected stripe/group they can tolerate.
1. Parity (XOR/Reed-Solomon) rebuilds missing data.
2. RAID5 single, RAID6 double parity.
3. Write penalty from read-modify-write.
4. Regular scrubs detect errors.
5. Write hole risk without journal/BBU.
data → parity computed → stored across disks
Context & applicabilityCommon mistakes · platform/version boundaries
Valid parity can reconstruct missing data within the layout's tolerance; it does not provide an independent historical copy or automatically detect every corruption source.
Suspicious evidence: parity check reports mismatches, small-write workload drives high backend work, multiple members have latent errors, or parity is assumed to be a checksum/backup system.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
logical write → stripe mapping → old-data/parity read when required → parity calculation → data/parity writes → acknowledgement; degraded read → surviving chunks/parity → reconstruction
Healthy evidence: parity state is consistent, all required members are healthy, no uncorrectable read errors occur and degraded reconstruction behaves as designed.
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.
- Parity ≠ checksum-based end-to-end integrity.
- Parity protection ≠ backup.
- Parity write penalty is workload- and implementation-dependent rather than one fixed universal number.
- A parity-consistent stripe ≠ proof that the stored logical data is semantically correct.
mdadm --detail /dev/md0 | grep -i level— RAID levelecho check > /sys/block/md0/md/sync_action— parity checkcat /sys/block/md0/md/mismatch_cnt— mismatches
ReferenceImportant terms & boundaries3 sections · depth on demand
Protection
Valid parity can reconstruct missing data within the layout's tolerance; it does not provide an independent historical copy or automatically detect every corruption source.
In depth
Parity lets a stripe be rebuilt from the remaining members
RAID 5 stores one parity block per stripe (XOR of the data blocks). RAID 6 adds a second, independent syndrome. If one block of a stripe is lost, XOR of the rest recreates it.
Data: D1 = 1011 D2 = 0110 D3 = 1100
Parity: P = D1 ⊕ D2 ⊕ D3 = 0001
Lost D2: D2 = D1 ⊕ D3 ⊕ P = 1011 ⊕ 1100 ⊕ 0001 = 0110
Cost of parity
| Item | RAID 5 | RAID 6 |
|---|---|---|
| Capacity used for parity | 1 disk | 2 disks |
| Survives | 1 failure | 2 failures |
| Small random write | 4 back-end I/Os | 6 back-end I/Os |
| Full-stripe write | No read penalty | No read penalty |
Verifying parity on Linux md
The kernel md documentation describes sync_action values. check reads all blocks to verify redundancy. repair checks and rewrites inconsistencies. mismatch_cnt counts what was found, and it can exceed the real number of bad blocks because md works in pages.
# echo check > /sys/block/md0/md/sync_action
# cat /sys/block/md0/md/sync_action
check
# cat /sys/block/md0/md/mismatch_cnt
0
Limits of parity
- Parity does not know which copy is right. A mismatch is fixed by recomputing parity from the data, not by finding the corrupt block. Checksumming file systems (ZFS, Btrfs) can find it.
- The write hole: a crash between writing data and parity leaves a stripe inconsistent. md offers a write journal or PPL against this.
- With large disks, a single-parity rebuild is a long window without redundancy. That is why RAID 6 is preferred for big HDDs.
Illustrative example (not a system capture).
How it works
Parity stores a calculated value that lets the array rebuild one missing block per stripe. Single parity (P) is XOR of the data blocks; double parity adds a second, independent value (Q, Reed-Solomon over a Galois field) so any two missing blocks can be rebuilt.
Example with XOR: data blocks 1010 and 0110 give parity 1100. If the first block is lost, 0110 XOR 1100 = 1010 restores it.
The cost is the read-modify-write on small writes: read old data and old parity, write new data and new parity — 4 back-end I/Os for RAID 5, 6 for RAID 6. Full-stripe writes avoid it because parity is computed from new data only.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in RAID → Parity. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/admin-guide/md.html · confidence 94%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.
Quick lookup tables
RAID → Parity RAID map
Fast layout, protection, failure and verification boundaries for RAID → Parity.
| RAID boundary | What to verify | Proof limit |
|---|---|---|
| Layout / topology | RAID level, member grouping, effective member size and stripe/mirror/parity structure | The label alone does not prove current member health or exact failure tolerance |
| Protection state | Array state, members, spares, cache protection and active rebuild/consistency work | Optimal/online state does not prove backup or application integrity |
| Failure boundary | Valid parity can reconstruct missing data within the layout's tolerance; it does not provide an independent historical copy or automatically detect every corruption source. | Failure tolerance must be evaluated against the exact layout and failure pattern |
| Acceptance | Healthy evidence: parity state is consistent, all required members are healthy, no uncorrectable read errors occur and degraded reconstruction behaves as designed. | Close only after the original workload/data check succeeds |