In this lesson, you will learn how the architectural philosophy of traditional software RAID (mdadm) differs from modern Copy-on-Write (CoW) storage pools like ZFS and Btrfs when handling data parity.
The Traditional Approach: mdadm
When you use mdadm, you are managing "dumb" block devices. The RAID layer sits between the filesystem and the physical disks. It focuses entirely on data redundancy. If a bit flips on your drive due to magnetic decay, the filesystem has no way of knowing; it simply writes the "corrupted" data to the array. mdadm does its job perfectly, but it lacks the "awareness" to verify if the data it is protecting is actually healthy. You are essentially building a wall around your data without checking if the bricks are rotten.
The Modern Approach: ZFS and Btrfs
ZFS and Btrfs take a different path by integrating the volume manager, the RAID engine, and the filesystem into one unified stack. Instead of treating the disk as a raw sequence of blocks, these systems use checksums for every block of data.
Because the filesystem is aware of the parity, it can detect "silent data corruption" (bit rot). If you request a file and the checksum doesn't match the stored data, ZFS/Btrfs knows exactly which block is wrong and automatically repairs it using the parity data from the other drives.
Consider the logical flow:
mdadm: Application → Filesystem (Ext4/XFS) → RAID Layer → Physical Disks.- ZFS/Btrfs: Application → Filesystem/RAID/Checksum Engine → Physical Disks.
Practical Impact
With mdadm, you perform manual consistency checks (echo check > /sys/block/md0/md/sync_action) which verify parity but cannot always fix silent corruption because the filesystem doesn't know which version of the data is the "correct" one.
With ZFS or Btrfs, the system performs "scrubbing." During a scrub, the engine reads all data, compares the checksums against the stored blocks, and—if a mismatch is found—rebuilds the corrupt data using the parity blocks instantly.
# In ZFS, checking for and repairing data is a single command:
zpool scrub tank
# In mdadm, you rely on the filesystem (like ext4) to notice errors:
fsck.ext4 /dev/md0
Key Takeaway: While mdadm provides a solid redundancy layer, ZFS and Btrfs offer superior data integrity by tightly coupling checksums with parity, allowing for the detection and automatic repair of silent corruption that traditional RAID cannot see.