Main Page

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(News: linux 5.12)
(Features: SMR merged in 5.12)
Line 68: Line 68:
* Swapfile support
* Swapfile support
* [[Tree-checker]], post-read and pre-write metadata verification
* [[Tree-checker]], post-read and pre-write metadata verification
* Zoned mode support (SMR/ZBC/ZNS friendly allocation)
=== Features by kernel version ===
=== Features by kernel version ===
Line 76: Line 77:
=== Features Currently in Development or Planned for Future Implementation ===
=== Features Currently in Development or Planned for Future Implementation ===
* SMR (zoned block device) support
* DAX/persistent memory support
* DAX/persistent memory support
* The file/directory -level encryption support (fscrypt)
* The file/directory -level encryption support (fscrypt)
Line 83: Line 83:
<!-- Documentation Block -->
<!-- Documentation Block -->
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#fffff0; align:right; ">
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#fffff0; align:right; ">
== Documentation ==
== Documentation ==

Revision as of 19:32, 26 April 2021


btrfs is a modern copy on write (CoW) filesystem for Linux aimed at implementing advanced features while also focusing on fault tolerance, repair and easy administration. Its main features and benefits are:

  • Snapshots which do not make the full copy of files
  • RAID - support for software-based RAID 0, RAID 1, RAID 10
  • Self-healing - checksums for data and metadata, automatic detection of silent data corruptions

Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development.

Jointly developed at multiple companies, Btrfs is licensed under the GPL and open for contribution from anyone.

List of companies using btrfs in production.

Development and Issue Reporting

For feature status, please refer to the Status page.

The Btrfs code base is stable. However, new features are still under development. Every effort is made to ensure that it remains stable and fast at each and every commit. This rapid pace of development means that the filesystem improves noticeably with every new Linux release so it's highly recommended that users run the most modern kernel possible.

For benchmarks, it's recommended to test the latest stable Linux version, and not any older, as well as the latest Linux development versions. Also, it's recommended to test the various mount options such as different compression options.

If you find any behavior you suspect to be caused by a bug, performance issues, or have any questions about using Btrfs, please email the Btrfs mailing list (no subscription required). Please report bugs on Bugzilla.


Linux has a wealth of filesystems from which to choose, but we are facing a number of challenges with scaling to the large storage subsystems that are becoming common in today's data centers. Filesystems need to scale in their ability to address and manage large storage, and also in their ability to detect, repair and tolerate errors in the data stored on disk.

Major Features Currently Implemented

  • Extent based file storage
  • 2^64 byte == 16 EiB maximum file size (practical limit is 8 EiB due to Linux VFS)
  • Space-efficient packing of small files
  • Space-efficient indexed directories
  • Dynamic inode allocation
  • Writable snapshots, read-only snapshots
  • Subvolumes (separate internal filesystem roots)
  • Checksums on data and metadata (crc32c, xxhash, sha256, blake2b)
  • Compression (ZLIB, LZO, ZSTD), heuristics
  • Integrated multiple device support
    • File Striping
    • File Mirroring
    • File Striping+Mirroring
    • Single and Dual Parity implementations (experimental, not production-ready)
  • SSD (flash storage) awareness (TRIM/Discard for reporting free blocks for reuse) and optimizations (e.g. avoiding unnecessary seek optimizations, sending writes in clusters, even if they are from unrelated files. This results in larger write operations and faster write throughput)
  • Efficient incremental backup
  • Background scrub process for finding and repairing errors of files with redundant copies
  • Online filesystem defragmentation
  • Offline filesystem check
  • In-place conversion of existing ext2/3/4 and reiserfs file systems
  • Seed devices. Create a (readonly) filesystem that acts as a template to seed other Btrfs filesystems. The original filesystem and devices are included as a readonly starting point for the new filesystem. Using copy on write, all modifications are stored on different devices; the original is unchanged.
  • Subvolume-aware quota support
  • Send/receive of subvolume changes
    • Efficient incremental filesystem mirroring
  • Batch, or out-of-band deduplication (happens after writes, not during)
  • Swapfile support
  • Tree-checker, post-read and pre-write metadata verification
  • Zoned mode support (SMR/ZBC/ZNS friendly allocation)

Features by kernel version

As part of the changelog you can also review

Features Currently in Development or Planned for Future Implementation

  • DAX/persistent memory support
  • The file/directory -level encryption support (fscrypt)


Guides and usage information

External Btrfs Documentation / Guides

Links to Btrfs documentation of various Linux distributions:

Manual pages

  • Original wiki documentation (obsolete, will be removed)

Developer documentation

  • Development setup - how to build btrfs from sources and prepare a development environment
  • Original COW B-tree: Source code in C that implements the COW B-tree algorithms repository. Written by Ohad Rodeh at IBM Research in 2006, and released under a BSD license. This is a reference implementation, that works in user space.
  • Unmerged features
    • In-band (write) time deduplication


linux v5.12 (Apr 2021)

  • features
    • zoned mode (SMR/ZBC/ZNS friendly allocation mode), first working version with limitations
  • misc performance improvements
    • flushing and ticket space reservations
    • preemptive background flushing
    • less lock contention for delayed refs
    • dbench-like workload (+7% throughput, -20% latency)
  • core changes:
    • subpage block size support peparations
  • fixes
    • swapfile fixes (vs scrub, activation vs snapshot creation)

btrfs-progs v5.11.1 (Mar 2021)

  • properly format checksums when a mismatch is reported
  • check: fix false alert on tree block crossing 64K page boundary
  • convert:
    • refuse to convert filesystem with 'needs_recovery'
    • update documentation to require fsck before conversion
  • balance convert: fix raid56 warning when converting other profiles
  • fi resize: improved summary

btrfs-progs v5.11 (Mar 2021)

  • fix device path canonicalization for device mapper devices
  • receive: remove workaround for setting capabilities, all stable kernels have been patched
  • receive: fix duplicate mount path detection
  • rescue: new subcommand create-control-device
  • device stats: minor fix for plain text format output
  • build: detect if e2fsprogs support 64bit timestamps
  • build: drop libmount, required functionality has been reimplemented
  • mkfs: warn when raid56 is used
  • balance convert: warn when raid56 is used
  • other
    • new and updated tests
    • documentation updates: seeding device, raid56 status
    • CI updates: docker images for various distros

linux v5.11 (Feb 2021)

  • new mount option rescue, various modes how to access a damaged filesystem
  • sysfs updates: filesystem generation, supported rescue modes, read mirror policy
  • removed feature: mount -o inode_cache
  • free space tree fixes, v1 cache removed during conversion
  • core
    • locking switched to standard rw semaphores
    • direct IO ported to iomap infrastructure
    • zoned allocation mode preparation
    • subpage blocksize preparation
    • various performance improvements (skipping unnecessary work)

Source code download

Btrfs source repositories describes purpose and contents, here are a few quick links:

Articles, presentations, podcasts

Historical resources

Links to old or obsolete documentation, articles. Kept for historical reasons. Stuff that's more than 3 years old.

Articles, presentations, podcasts

Project information/Contact

Wiki accounts, editing

The wiki contributions are welcome! Please create an account and wait for approval (this is a necessary spam protection and we cannot remove it). You can try to catch some of the wiki admins on IRC (or ping user 'kdave' in a query) to expedite the account creation.

The registration requires full name for account but it's not mandatory from our perspective. The wiki User and User talk pages are created automatically but removed after account is approved. If you want to use the pages, create them manually, they won't be deleted.

Personal tools