Hallo,
so wie ich das weiss und verstehe ist die Parity bei ZFS über alle verwendeten Platten verteilt.
ChatGPT weiss es so:
ZFS handles parity differently than traditional RAID setups. Here’s how parity is calculated and stored:
ZFS supports **RAID-Z1 (single parity), RAID-Z2 (double parity), and RAID-Z3 (triple parity)**, which are similar in concept to RAID-5, RAID-6, and a three-parity version, respectively.
- **RAID-Z1**: Uses a single parity block per stripe, similar to RAID-5.
- **RAID-Z2**: Uses two parity blocks per stripe, similar to RAID-6.
- **RAID-Z3**: Uses three parity blocks per stripe.
The parity is calculated using XOR for single parity (RAID-Z1), and more advanced Reed-Solomon error correction for multiple parity levels (RAID-Z2, RAID-Z3).
Unlike traditional RAID, which often places parity blocks in fixed locations, **ZFS dynamically distributes parity across all disks in the vdev**. This means:
1. **Parity is not stored on a dedicated drive** – it is spread across all drives participating in the vdev.
2. **Each stripe (group of blocks spanning multiple disks) has its parity stored on a different disk each time**. This avoids write bottlenecks that are common in traditional RAID configurations.
3. **Variable stripe width** – Unlike traditional RAID-5/6, which requires strict fixed-size stripes, ZFS can handle different stripe sizes depending on how much data is written. This allows ZFS to handle small writes more efficiently than traditional RAID.
For a RAID-Z2 vdev with five disks:
| Stripe # | Disk 1 | Disk 2 | Disk 3 | Disk 4 | Disk 5 |
|–––––-|––––|––––|––––|––––|––––|
| Stripe 1 | Data | Data | Data | Parity | Parity |
| Stripe 2 | Data | Parity | Data | Data | Parity |
| Stripe 3 | Parity | Data | Data | Parity | Data |
This ensures that no single disk is constantly handling parity calculations, improving performance and longevity.
- Parity in ZFS is **distributed across all drives in a vdev** rather than dedicated to a single drive.
- The placement of parity blocks is dynamic, ensuring **even distribution and reducing bottlenecks**.
- RAID-Z has **variable stripe widths**, making it more efficient for mixed workloads.
- ZFS handles **automatic parity checking and self-healing**, ensuring data integrity.
Ich nutze es seit einigen jahren auf meinem selbstgebauten NAS und funktioniert super; selbst ein Wechsel auf größere Platten ohne Datenverlust war easy.
Grüssle
LAZA