ubuntuusers.de

ZFS und Parity

Status: Gelöst | Ubuntu-Version: Ubuntu 22.04 (Jammy Jellyfish)
Antworten |

andes135

Anmeldungsdatum:
18. September 2011

Beiträge: 584

Hallo zusammen, ich beschäftige mich seit kurzem mit ZFS. Nun habe ich alles soweit eingerichtet. Jetzt würde ich gerne einen neuen Pool anlegen mit 3 Festplatten und habe dazu eine Frage und zwar, kann man das Parity z.Bsp. bei einem Raidz1 auf einer bestimmten HDD ablegen ? Oder besser noch, auf einer gespiegelten HDD ? Auf youtube habe ich ein Video gesehen, wo jemand meinte, das Parity liegt auf dieser bestimmten Festplatte. Er hat aber soweit ich weiß, Unraid benutzt, das möchte ich aber nicht.

LAZA74

Avatar von LAZA74

Anmeldungsdatum:
8. Januar 2009

Beiträge: 511

Wohnort: Hegau

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

Antworten |