Experimental RAID 5 and 6 support in Btrfs
Chris Mason has released experimental Btrfs extensions which enable the file system to natively support RAID 5 and 6 in addition to the existing RAID 0 and 1 support. Mason is lead developer of the file system, which has long been included in the Linux kernel but is still marked as experimental. In an announcement regarding the new feature, he includes benchmark results obtained using two fast systems containing flash storage. In some of these tests, native Btrfs RAID runs two to three times faster than a multiple device (MD) created using mdadm. Mason addressed the MD array directly in some tests and set up a Btrfs partition on it in others.
Native support for RAID arrays within a file system permits functionality which is difficult to realise in a layered model. File systems achieve this using a software RAID array, similar to that which can be created in Linux using device-mapper/LVM2 or multiple device/mdadm. Btrfs is already capable of storing file system metadata using RAID 1 (mirroring), whilst using RAID 0 (striping) for the file system's payload data. Integrating RAID technologies within the file system means that only used areas need to be restored during recovery. With device-mapper and multiple devices, it is necessary to regenerate the complete array, as these technologies are not able to access the information on where data is located. Native file system RAID support also offers benefits in the event of data errors, as it is able to access checksums for stored data.
The new Btrfs extensions are based on a prototype, presented by David Woodhouse back in summer 2009. There have since been repeated hints that RAID 5 support in Btrfs would soon be completed, most recently in December, but nothing concrete was ever released. This new, more substantial announcement suggests that merger of the extensions into the Linux kernel and the file system tools may be approaching. Some changes are, however, still required, as Mason himself notes. Details and background information on how the code works can be found in the announcement on RAID 5/6 extensions for Btrfs.