ZFS Storage Pools (zpool) & VDEVs
Overview
A zpool (storage pool) is the top-level container in ZFS that aggregates physical storage drives into a unified storage space. File systems (datasets) and block devices (zvols) draw storage dynamically from the pool rather than from fixed disk partitions.
Virtual Devices (VDEVs)
A pool is constructed from one or more VDEVs (Virtual Devices). Data is striped across all top-level VDEVs in a pool.
Types of VDEVs:
- Mirror:
- 2-way or 3-way mirroring (similar to RAID 1/10).
- High random IOPS performance and fastest resilvering times.
- RAID-Z1 / RAID-Z2 / RAID-Z3:
- Single, double, or triple parity protection (analogous to RAID 5 and RAID 6).
- Solves the classic hardware RAID “write hole” bug using dynamic stripe widths.
- dRAID (Distributed RAID):
- Modern OpenZFS feature that distributes spare capacity across all disks in the array, dramatically reducing rebuild (resilver) times under drive failure.
- Special VDEVs:
- SLOG (Separate ZFS Intent Log): Fast, low-latency NVMe dedicated to synchronous write transactions.
- L2ARC (Level 2 ARC): SSD read cache extending RAM-based ARC.
- Special Allocation Class (Metadata VDEV): Fast NVMe drives dedicated strictly to pool metadata and small files.
Common Management Commands
zpool create <pool_name> mirror /dev/sda /dev/sdb: Create a mirrored pool.zpool status: Inspect pool health, VDEV status, and check for I/O or checksum errors.zpool list: View capacity, allocation, fragmentation, and deduplication ratios.zpool scrub <pool_name>: Initiate an integrity check across all blocks.