ZFS (Zettabyte File System)
Overview
ZFS is a revolutionary 128-bit file system and logical volume manager originally designed by Sun Microsystems (now maintained as OpenZFS). Unlike traditional architectures where a volume manager (e.g., LVM, mdadm) is layered underneath a standalone file system (e.g., ext4, xfs), ZFS unifies both into a single cohesive layer.
Core Architectural Pillars
- Pooled Storage (ZFS Storage Pools (zpool) & VDEVs):
- Eliminates traditional partition boundaries. Storage devices are grouped into a virtual pool (
zpool), and datasets dynamically allocate space on demand.
- Eliminates traditional partition boundaries. Storage devices are grouped into a virtual pool (
- Copy-on-Write (Copy-on-Write (CoW) Filesystems):
- Data is never overwritten in place. Modifications are written to new blocks, making writes atomic and eliminating file system inconsistencies on sudden power loss.
- End-to-End Data Integrity & Self-Healing (Data Scrubbing & Self-Healing in ZFS):
- Every block contains a 256-bit checksum (Fletcher4, SHA-256, Blake3). If silent data corruption (“bit rot”) is detected during read or scrub, ZFS automatically repairs the block using redundant parity from a mirror or RAID-Z vdev.
- Zero-Cost Snapshots & Clones (ZFS Snapshots, Clones, & Replication):
- Instantaneous point-in-time read-only states created with zero space overhead until blocks diverge.
- Two-Tier Caching Architecture:
- ARC (Adaptive Replacement Cache): High-performance RAM cache balancing frequency and recency.
- L2ARC (Level 2 ARC): Fast SSD-based secondary read cache.
- SLOG / ZIL (ZFS Intent Log / Separate Log): Non-volatile fast write log ensuring synchronous write latency reduction without risking integrity.
Key Properties & Limits
- 128-bit Addressing: Theoretically addresses up to $2^{128}$ bytes (256 quadrillion zettabytes).
- Native Encryption: Per-dataset AES-GCM encryption without performance overhead from external dm-crypt/LUKS layers.
- Transparent Compression: Block-level inline compression algorithms including LZ4 (fast default), ZSTD (high ratio), and GZIP.