In this lesson, you will learn how to apply native RAID redundancy policies within Btrfs to protect your data across multiple physical devices.
Unlike traditional hardware RAID which manages data at the disk level, Btrfs manages redundancy through RAID profiles applied to "block groups." Because Btrfs is a Copy-on-Write filesystem, it treats your collection of disks as a single pool, allowing you to choose different redundancy levels for data and metadata independently.
Applying Profiles
When you format a multi-device pool, or even convert an existing one, you define how data is mirrored or striped. The most common profiles are single (no redundancy), raid1 (mirroring), and raid10 (striped mirrors).
To see what profiles your current pool is using, run:
sudo btrfs filesystem usage /path/to/mountpoint
You can change the profile of an active pool without reformatting by using the balance command. For example, to convert your metadata to raid1 and your data to raid1 across available disks, you would execute:
sudo btrfs balance start -mconvert=raid1 -dconvert=raid1 /path/to/mountpoint
Redundancy at the Pool Level
The brilliance of Btrfs RAID profiles is that they apply to the entire pool. When you save a file, Btrfs calculates the checksums and distributes the data chunks across your disks according to the profile you selected. If you lose a drive, you don't need to reconstruct an entire partition table; you simply replace the drive and let Btrfs "balance" the data back onto the new hardware.
It is important to note that you cannot apply different RAID profiles to individual subvolumes. While subvolumes provide logical separation for your files, the RAID profile remains a global property of the filesystem pool. This ensures that the filesystem's self-healing properties—which compare checksums to detect and fix silent data corruption—are consistently applied to every bit of data on every disk in the pool.
Key Takeaway: Btrfs RAID profiles allow you to define global redundancy policies for your data and metadata, enabling seamless, dynamic conversion and self-healing across your entire storage pool.