Main Page

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(News and Changelog: progs 4.8.3)
(News)
 
(156 intermediate revisions by 14 users not shown)
Line 1: Line 1:
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. Jointly developed at [[Contributors|multiple companies]], Btrfs is licensed under the GPL and open for contribution from anyone.
+
__NOTOC__
Not too many companies have said that they are using Btrfs in production, but we welcome those who can say so on the [[Production_Users|production users]] page.
+
<!-- Welcome Block -->
 +
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; align:right; ">
 +
[[File:Btrfs_logo_small.png|200px|left|btrfs]]
  
== Stability status ==
+
'''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:
  
'''For a feature status and stability please refer to the [[Status]] page.''' The filesystem [[On-disk_Format|disk format]] is stable; this means it is not expected to change unless there are very strong reasons to do so. If there is a format change, filesystems which implement the previous disk format will continue to be mountable and usable by newer kernels.
+
* '''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
  
The Btrfs code base is under heavy development. Not only is every effort being made to ensure that it remains stable and fast but to make it more so with 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.
+
Development of Btrfs started in 2007. Since that time, Btrfs is a part of the Linux kernel and is under active development.
  
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.
+
Jointly developed at [[Contributors|multiple companies]], Btrfs is licensed under the GPL and open for contribution from anyone.
  
As with all software, newly added features may need a few releases to stabilize.
+
[[Production_Users|List of companies using btrfs in production]].
 +
</div>
 +
 
 +
{| width="100%"
 +
|-
 +
|style="vertical-align:top" |
 +
 
 +
<!-- Development and Issue Reporting Block -->
 +
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#dcf5ff; align:right;">
 +
== 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 [[Manpage/btrfs(5)#MOUNT_OPTIONS|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 [[Problem_FAQ#How_do_I_report_bugs_and_issues.3F|Bugzilla]].
 
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 [[Problem_FAQ#How_do_I_report_bugs_and_issues.3F|Bugzilla]].
 +
</div>
  
 +
<!-- Features Block -->
 +
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#F8F8FF; align:right;">
 
== Features ==
 
== Features ==
  
Line 26: Line 48:
 
* Writable snapshots, read-only snapshots
 
* Writable snapshots, read-only snapshots
 
* Subvolumes (separate internal filesystem roots)
 
* Subvolumes (separate internal filesystem roots)
* Checksums on data and metadata (crc32c)
+
* Checksums on data and metadata (crc32c, xxhash, sha256, blake2b)
* [[Compression]] (zlib and LZO)
+
* [[Compression]] (ZLIB, LZO, ZSTD), heuristics
 
* Integrated [[Multiple_Device_Support|multiple device support]]
 
* Integrated [[Multiple_Device_Support|multiple device support]]
 
** File Striping
 
** File Striping
Line 38: Line 60:
 
* Online filesystem defragmentation
 
* Online filesystem defragmentation
 
* [[btrfsck|Offline filesystem check]]
 
* [[btrfsck|Offline filesystem check]]
* In-place [[Conversion_from_Ext3|conversion]] of existing ext3/4 file systems
+
* In-place [[Conversion_from_Ext3|conversion]] of existing ext2/3/4 and reiserfs file systems
 
* [[Seed-device|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.
 
* [[Seed-device|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]]
 
* Subvolume-aware [[quota support]]
Line 44: Line 66:
 
** Efficient incremental filesystem mirroring
 
** Efficient incremental filesystem mirroring
 
* Batch, or out-of-band [[deduplication]] (happens after writes, not during)
 
* 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 ===
 
=== Features by kernel version ===
Line 52: Line 77:
 
=== Features Currently in Development or Planned for Future Implementation ===
 
=== Features Currently in Development or Planned for Future Implementation ===
  
* Online filesystem check
+
* DAX/persistent memory support
* Object-level mirroring and striping
+
* The file/directory -level encryption support (fscrypt)
* Alternative checksum algorithms
+
* fsverity integration
* In-band deduplication (happes during writes)
+
</div>
** [https://btrfs.wiki.kernel.org/index.php/Design_notes_on_dedupe In-band dedupe design document]
+
** [https://btrfs.wiki.kernel.org/index.php/User_notes_on_dedupe How to use in-band dedupe]
+
* Other compression methods ([[Project_ideas#Compression_enhancements|LZ4]])
+
* Hot data tracking and moving to faster devices (currently being pushed as a generic feature available through VFS)
+
  
== News and Changelog ==
+
<!-- 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; ">
''' btrfs-progs v4.8.3 (Nov 2016)'''
+
 
+
* check:
+
** support for clearing space cache (v1)
+
** size reduction of inode backref structure
+
* send:
+
** fix handling of multiple snapshots (-p and -c options)
+
** transfer buffer increased (should reduce number of context switches)
+
** reuse existing file for output (-f), eg. when root cannot create files (NFS)
+
* dump-tree:
+
** print missing items for various structures
+
** new: dev stats, balance status item
+
** sync key names with kernel (the persistent items)
+
* subvol show: now able to print the toplevel subvolume -- the creation time might be wrong though
+
* mkfs:
+
** store the creation time of toplevel root inode
+
** print UUID in the summary
+
* build: travis CI for devel
+
* other:
+
** lots of cleanups and refactoring
+
** switched to on-stack path structure
+
** fixes from coverity, asan, ubsan
+
** new tests
+
** updates in testing infrastructure
+
** fixed convert test 005
+
 
+
 
+
'''Linux v4.8 (Oct 2016)'''
+
* space reservations and handling uses ticketed system, this should improve latency and fairness in case when there are several threads blocked on flushing
+
* fixes of bugs triggered by fuzzed images
+
* global ratelmit of all printed messages
+
* several send, qgroup fixes
+
* cleanups
+
 
+
'''Wiki update'''
+
 
+
[[Status|A comprehensive page with feature status]]
+
 
+
Read about past releases in the [[Changelog]]
+
* [[Changelog#By_feature|features by kernel version]]
+
* [[Changelog#By_version_.28linux_kernel.29|kernel changes]]
+
* [[Changelog#By_version_.28btrfs-progs.29|btrfs-progs]]
+
  
 
== Documentation ==
 
== Documentation ==
Line 111: Line 90:
  
 
* [[Getting started]] — first steps, distributions with btrfs support
 
* [[Getting started]] — first steps, distributions with btrfs support
** [[Mount options]]
+
** [[Manpage/btrfs(5)#MOUNT_OPTIONS|Mount options]]
 
* [[FAQ]] — About the btrfs project and filesystem
 
* [[FAQ]] — About the btrfs project and filesystem
 
* [[UseCases]] — Recipes for how to do stuff with btrfs
 
* [[UseCases]] — Recipes for how to do stuff with btrfs
 
* [[SysadminGuide]] — A more in-depth guide to btrfs's concepts and a bit of its internals, to answer all those "but what ''is'' a subvolume?" kind of questions.
 
* [[SysadminGuide]] — A more in-depth guide to btrfs's concepts and a bit of its internals, to answer all those "but what ''is'' a subvolume?" kind of questions.
 
* [[Using Btrfs with Multiple Devices|Multiple devices]] – A guide to the RAID features of Btrfs
 
* [[Using Btrfs with Multiple Devices|Multiple devices]] – A guide to the RAID features of Btrfs
* [[Conversion_from_Ext3|Conversion from Ext3 and Ext4]]
+
* [[Conversion_from_Ext3|Conversion from Ext3 and Ext4]] or reiserfs
 
* [[Problem FAQ]] — Commonly-encountered problems and solutions.
 
* [[Problem FAQ]] — Commonly-encountered problems and solutions.
 
** [[Gotchas]] — lists known bugs and issues, but not necessarily solutions.
 
** [[Gotchas]] — lists known bugs and issues, but not necessarily solutions.
Line 126: Line 105:
 
* "[https://docs.oracle.com/cd/E37670_01/E37355/html/ol_btrfs.html The Btrfs File System]" chapter in the [https://docs.oracle.com/cd/E37670_01/E37355/html/index.html Oracle Linux 6 Administrator's Solutions Guide]
 
* "[https://docs.oracle.com/cd/E37670_01/E37355/html/ol_btrfs.html The Btrfs File System]" chapter in the [https://docs.oracle.com/cd/E37670_01/E37355/html/index.html Oracle Linux 6 Administrator's Solutions Guide]
 
* Oracle Linux [https://wikis.oracle.com/display/oraclelinux/Hands-on+lab+-+Storage+Management+with+Btrfs Hands-on lab - Storage Management with Btrfs]
 
* Oracle Linux [https://wikis.oracle.com/display/oraclelinux/Hands-on+lab+-+Storage+Management+with+Btrfs Hands-on lab - Storage Management with Btrfs]
* [https://www.suse.com/documentation/sles11/stor_admin/data/sec_filesystems_major.html Major File Systems in Linux] chapter in the [https://www.suse.com/documentation/sles11/stor_admin/data/bookinfo.html SLES 11 Storage Administration Guide]
+
* [https://documentation.suse.com/sles/15-GA/single-html/SLES-storage/#sec-filesystems-major-btrfs Major File Systems in Linux] chapter in the [https://documentation.suse.com/en-us/sles/15-GA/single-html/SLES-storage/ SLES 15 Storage Administration Guide]
 
* [https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-btrfs.html Btrfs] chapter in the [https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ Red Hat Enterprise Linux 6 Storage Administration Guide]
 
* [https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-btrfs.html Btrfs] chapter in the [https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ Red Hat Enterprise Linux 6 Storage Administration Guide]
 
* [https://help.ubuntu.com/community/btrfs Btrfs Wiki page] on the [https://help.ubuntu.com/community Ubuntu Community Help Wiki]
 
* [https://help.ubuntu.com/community/btrfs Btrfs Wiki page] on the [https://help.ubuntu.com/community Ubuntu Community Help Wiki]
Line 132: Line 111:
 
* [http://www.funtoo.org/BTRFS_Fun BTRFS Fun Wiki page] on the [http://www.funtoo.org/ Funtoo Wiki]
 
* [http://www.funtoo.org/BTRFS_Fun BTRFS Fun Wiki page] on the [http://www.funtoo.org/ Funtoo Wiki]
 
* [http://marc.merlins.org/perso/btrfs/post_2014-05-21_My-Btrfs-Talk-at-Linuxcon-JP-2014.html Marc MERLIN's Btrfs talk at Linuxcon JP 2014] which gives an overview of Btrfs, best practices, and its more interesting features.
 
* [http://marc.merlins.org/perso/btrfs/post_2014-05-21_My-Btrfs-Talk-at-Linuxcon-JP-2014.html Marc MERLIN's Btrfs talk at Linuxcon JP 2014] which gives an overview of Btrfs, best practices, and its more interesting features.
 
=== Project information/Contact ===
 
 
* [[Changelog]] — history of changes in linux kernel wrt btrfs
 
** [[Changelog#By_feature | features added by release]]
 
* [[Contributors#Statistics|Development statistics]] — contributors, commits, lines
 
* [[Glossary]]
 
* Contact information:
 
** [[Btrfs mailing list]]
 
** [http://en.wikipedia.org/wiki/Internet_Relay_Chat IRC] on freenode.net in the channel [irc://irc.freenode.net:6667/btrfs #btrfs]
 
** Reporting bugs: see [[Problem_FAQ#How_do_I_report_bugs_and_issues.3F | the Bugzilla FAQ]] for reporting and finding bugs. Quick tip: use product ''File System'' and component ''btrfs''.
 
* [[Project ideas]]
 
* [[Project_ideas#Cleanup_projects|Cleanup ideas]]
 
* [[Project_ideas#Userspace_tools_projects|Userspace tools projects]]
 
  
 
=== Manual pages ===
 
=== Manual pages ===
Line 160: Line 125:
 
=== Developer documentation ===
 
=== Developer documentation ===
  
 +
* [[Development setup]] - how to build btrfs from sources and prepare a development environment
 +
 +
* [https://github.com/btrfs/btrfs-dev-docs Developer documentation on Github] - collection of documents describing internals of BTRFS
 
* [[Developer's FAQ]] — hints and answers for contributors and developers, general information about patch formatting
 
* [[Developer's FAQ]] — hints and answers for contributors and developers, general information about patch formatting
 
* [[Development notes]] — notes, hints, checklists for specific implementation tasks (eg. adding new ioctls)
 
* [[Development notes]] — notes, hints, checklists for specific implementation tasks (eg. adding new ioctls)
 
* [[Code documentation]] — trees, source files, sample code for manipulating trees
 
* [[Code documentation]] — trees, source files, sample code for manipulating trees
 
* [[Data Structures]] — detailed on-disk data structures
 
* [[Data Structures]] — detailed on-disk data structures
 +
* [[On-disk_Format | On-disk Format]] - Details of data structures written on disk
 
* [[Trees]] — detailed in-tree representation of files and directories
 
* [[Trees]] — detailed in-tree representation of files and directories
  
Line 170: Line 139:
 
* [[ENOSPC]] — Current ENOSPC design issues
 
* [[ENOSPC]] — Current ENOSPC design issues
 
* [[Design_notes_on_Send/Receive]] — notes from initial impelentation, protocol V2 updates draft
 
* [[Design_notes_on_Send/Receive]] — notes from initial impelentation, protocol V2 updates draft
 +
* [[Qgroups status quo]] - notes on some qgroups observations/pain points
  
 
* [[Debugging Btrfs with GDB]]
 
* [[Debugging Btrfs with GDB]]
 
* [[Writing patch for btrfs]]
 
* [[Writing patch for btrfs]]
 
* [[Btree_Items]] - Mapping from Btrfs key to item-data
 
* [[Btree_Items]] - Mapping from Btrfs key to item-data
 +
* [[Resolving_Extent_Backrefs]] - How back references are resolved to root owners
  
 
* Original COW B-tree: Source code in C that implements the COW B-tree algorithms [https://github.com/orodeh/bt 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.
 
* Original COW B-tree: Source code in C that implements the COW B-tree algorithms [https://github.com/orodeh/bt 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.
Line 180: Line 151:
 
** In-band (write) time deduplication
 
** In-band (write) time deduplication
 
*** [[User notes on dedupe]] — User/tester notes for using in-band deduplication feature
 
*** [[User notes on dedupe]] — User/tester notes for using in-band deduplication feature
 +
</div>
  
==== Source code download ====
+
| width="50%" style="vertical-align:top" |
  
* [[Btrfs source repositories]]
+
<!-- News Block -->
* [http://git.kernel.org/?p=linux/kernel/git/mason/linux-btrfs.git;a=tree;f=fs/btrfs;hb=HEAD Gitweb source viewer] of the main kernel repository
+
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#f0e0d0; align:left;">
* [https://git.kernel.org/cgit/linux/kernel/git/kdave/btrfs-progs.git/ Gitweb source viewer] of the userspace tools repository
+
== News ==
  
 +
''' IRC channel is moving to libera.chat '''
 +
 +
Due to changes in ownership of freenode.net, there's a new #btrfs channel at [https://libera.chat libera.chat].
 +
 +
''' btrfs-progs v5.12.1 (May 2021) '''
 +
 +
* build: fix missing symbols in libbtrfs
 +
* mkfs: check for minimal number of zones
 +
* check: fix warning about cache generation when free space tree is enabled
 +
* fix superblock write in zoned mode on 16K pages
 +
 +
 +
''' btrfs-progs v5.12 (May 2021) '''
 +
 +
* libbtrfsutil: relicensed to LGPL v2.1+
 +
* mkfs: zoned mode support (kernel 5.12+)
 +
* fi df: show zone_unusable per profile type in zoned mode
 +
* fi usage: show total amount of zone_unusable
 +
* fi resize: fix message for exact size
 +
* image: fix warning and enlarge output file if necessary
 +
* core
 +
** refactor chunk allocator for more modes
 +
** implement zoned mode support: allocation and writes, sb log
 +
** crypto/hash refactoring and cleanups
 +
** refactoring and cleanups
 +
* other
 +
** test updates
 +
** CI updates
 +
**** travis-ci integration disabled
 +
**** docker images updated, more coverage
 +
*** incomplete build support for Android removed
 +
* doc updates
 +
** chattr mode m for 'NOCOMPRESS"
 +
** swapfile used from fstab
 +
** how to add a new export to libbtrfsutil
 +
** update status of mount options since 5.9
 +
 +
''' linux v5.12 (Apr 2021) '''
 +
 +
* features
 +
** [[Zoned|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)
 +
 +
</div>
 +
 +
<!-- Changelog Block -->
 +
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px">
 +
 +
== Changelog ==
 +
 +
Read about past releases in the separate [[Changelog]] page
 +
 +
* [[Changelog#By_feature|features by kernel version]]
 +
* [[Changelog#By_version_.28linux_kernel.29|kernel changes for each release]]
 +
* [[Changelog#By_version_.28btrfs-progs.29|btrfs-progs changes for each release]]
 +
</div>
 +
 +
<!-- Source code Block -->
 +
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px">
 +
== Source code download ==
 +
 +
[[Btrfs source repositories]] describes purpose and contents, here are a few quick links:
 +
 +
* repository for kernel pull requests: git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git ([https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git gitweb])
 +
* kernel development repository: git://github.com/kdave/btrfs-devel.git ([https://github.com/kdave/btrfs-devel.git web access])
 +
* kernel development repository (mirror): git://gitlab.com/kdave/btrfs-devel.git ([https://gitlab.com/kdave/btrfs-devel.git web access])
 +
* btrfs-progs development and release repository: git://github.com/kdave/btrfs-progs.git ([https://github.com/kdave/btrfs-progs.git web access])
 +
* released tarballs of btrfs-progs: https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/
 +
</div>
 +
 +
<!-- Articles Block -->
 +
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px">
 
== Articles, presentations, podcasts ==
 
== Articles, presentations, podcasts ==
 +
* '''Video:''' [https://www.youtube.com/watch?v=U7gXR2L05IU Deploying Btrfs at Facebook Scale] by Josef Bacik at the Open Source Summit 2020 (2020-06-29)
 +
* '''Video:''' [https://youtu.be/qHalOdCZO9Q btrfs is awesome, except when it isn't] by Richard Brown at openSUSE Conferece 2018 (2018-05-25)
 +
* '''Video:''' [https://youtu.be/-m01x3gHNjg btrfs: The Best Filesystem You've Never Heard Of] by poiupoiu at PhreakNIC 21 (2017-11-3)
 +
* '''Video''' [https://youtu.be/iwNg_fusT9A TUT91782 Getting the most out of the btrfs filesystem by Thorsthen Kukuk and Jeff Mahoney] (SUSECON, 2017)
 
* '''Video:''' [https://www.youtube.com/watch?v=W3QRWUfBua8 NYLUG Presents: Chris Mason on Btrfs (May 14th 2015)] by Chris Mason at the 192nd meeting of the NYLUG
 
* '''Video:''' [https://www.youtube.com/watch?v=W3QRWUfBua8 NYLUG Presents: Chris Mason on Btrfs (May 14th 2015)] by Chris Mason at the 192nd meeting of the NYLUG
 
* '''Video:''' [https://www.youtube.com/watch?v=6DplcPrQjvA Why you should consider using btrfs ... like Google does.] by Marc Merlin at linux.conf.au 2015. [http://marc.merlins.org/linux/talks/Btrfs-LCA2015/ talk slides]
 
* '''Video:''' [https://www.youtube.com/watch?v=6DplcPrQjvA Why you should consider using btrfs ... like Google does.] by Marc Merlin at linux.conf.au 2015. [http://marc.merlins.org/linux/talks/Btrfs-LCA2015/ talk slides]
Line 197: Line 253:
 
* '''Technical report:''' [http://domino.watson.ibm.com/library/cyberdig.nsf/1e4115aea78b6e7c85256b360066f0d4/9e29fdded06e5de785257c1d005e7e9e!OpenDocument Visualizating Block IO Workloads]. Section six shows a visual comparison of the IO patterns for BTRFS, XFS, and EXT4. Submitted to ACM Transactions on Storage, November 2013.
 
* '''Technical report:''' [http://domino.watson.ibm.com/library/cyberdig.nsf/1e4115aea78b6e7c85256b360066f0d4/9e29fdded06e5de785257c1d005e7e9e!OpenDocument Visualizating Block IO Workloads]. Section six shows a visual comparison of the IO patterns for BTRFS, XFS, and EXT4. Submitted to ACM Transactions on Storage, November 2013.
 
* '''Paper:''' [http://dl.acm.org/citation.cfm?id=2501623 BTRFS: The Linux B-Tree Filesystem] describing the overall concepts and architecture, appeared in ACM Transactions on Storage, August 2013. Includes a detailed comparison with ZFS. There is a free ACM authorized link, from O. Rodeh's [https://sites.google.com/site/ohadrodehshomepage/research] page. Otherwise, try [http://domino.research.ibm.com/library/cyberdig.nsf/papers/6E1C5B6A1B6EDD9885257A38006B6130/$File/rj10501.pdf IBM Research link]
 
* '''Paper:''' [http://dl.acm.org/citation.cfm?id=2501623 BTRFS: The Linux B-Tree Filesystem] describing the overall concepts and architecture, appeared in ACM Transactions on Storage, August 2013. Includes a detailed comparison with ZFS. There is a free ACM authorized link, from O. Rodeh's [https://sites.google.com/site/ohadrodehshomepage/research] page. Otherwise, try [http://domino.research.ibm.com/library/cyberdig.nsf/papers/6E1C5B6A1B6EDD9885257A38006B6130/$File/rj10501.pdf IBM Research link]
 +
</div>
  
<!--
+
<!-- Historical Block -->
== Benchmarking ==
+
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px">
-->
+
 
+
 
+
 
== Historical resources ==
 
== Historical resources ==
  
Line 221: Line 275:
 
* '''Webcast:''' [https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&eventid=233161&sessionid=1&key=D0B1D3285FA444C5745C344A1C859CE0&partnerref=banner&sourcepage=register State of "Btrfs" File System for Linux by Chris Mason] (2010-08-26) [email registration and flash required]
 
* '''Webcast:''' [https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&eventid=233161&sessionid=1&key=D0B1D3285FA444C5745C344A1C859CE0&partnerref=banner&sourcepage=register State of "Btrfs" File System for Linux by Chris Mason] (2010-08-26) [email registration and flash required]
 
* '''Article:''' [http://lwn.net/Articles/342892/ Valerie Aurora: A short history of btrfs] (2009-07-22)
 
* '''Article:''' [http://lwn.net/Articles/342892/ Valerie Aurora: A short history of btrfs] (2009-07-22)
 +
</div>
 +
 +
<!-- Project Block -->
 +
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px">
 +
== Project information/Contact ==
 +
 +
* [[Changelog]] — history of changes in linux kernel wrt btrfs
 +
** [[Changelog#By_feature | features added by release]]
 +
* [[Contributors#Statistics_for_5.x_series|Development statistics]] — contributors, commits, lines
 +
* [[Glossary]]
 +
* Contact information:
 +
** [[Btrfs mailing list]]
 +
** [http://en.wikipedia.org/wiki/Internet_Relay_Chat IRC] on [https://libera.chat libera.chat] in the channel [irc://irc.libera.chat:6667/btrfs #btrfs]
 +
** Reporting bugs:
 +
*** for kernel code see [[Problem_FAQ#How_do_I_report_bugs_and_issues.3F | the Bugzilla FAQ]], quick tip: use product ''File System'' and component ''btrfs''.
 +
*** for btrfs-progs it's either bugzilla or [https://github.com/kdave/btrfs-progs/issues/ github issues]
 +
*** for read-only documentation exported on wiki eg. manual pages as [https://github.com/kdave/btrfs-progs/issues/ github issues]
 +
* [[Project ideas]]
 +
* [[Project_ideas#Cleanup_projects|Cleanup ideas]]
 +
* [[Project_ideas#Userspace_tools_projects|Userspace tools projects]]
 +
</div>
 +
 +
<!-- Wiki Block -->
 +
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px">
 +
 +
== 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 [[#Project_information.2FContact|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.
 +
</div>
  
=== Benchmarks ===
+
|}
* '''2012-10''' [http://www.ilsistemista.net/index.php/linux-a-unix/36-btrfs-mount-options-and-virtual-machines-an-in-depth-look.html BTRFS, mount options and virtual machines: an in-depth look] (Ilsistemista.net)
+
* '''2012-06''' [http://www.ilsistemista.net/index.php/linux-a-unix/34-btrfs-ext3-ext4-xfs-and-kvm-virtual-machine-a-host-side-filesystem-comparison.html BTRFS EXT3 EXT4 XFS and KVM virtual machine: a host-side filesystem comparison] (Ilsistemista.net)
+
* '''2012-06''' [http://www.ilsistemista.net/index.php/linux-a-unix/33-btrfs-vs-ext3-vs-ext4-vs-xfs-performance-on-fedora-17.html BTRFS vs EXT3 vs EXT4 vs XFS performance on Fedora 17] (Ilsistemista.net)
+
* '''2012-05''' [http://www.phoronix.com/scan.php?page=article&item=linux_34_fs&num=1 XFS, Btrfs, EXT4 Battle It Out On Linux 3.4] (Phoronix.com)
+
* '''2012-05''' [http://cd34.com/blog/scalability/ext4-xfs-and-btrfs-benchmark-redux/ Ext4, XFS and Btrfs benchmark redux]
+
* '''2012-03''' [http://www.phoronix.com/scan.php?page=article&item=linux_btrfs_options&num=1 Testing Out The Btrfs Mount Options On Linux 3.2] (Phoronix.com)
+
* '''2012-03''' [http://www.phoronix.com/scan.php?page=article&item=ubuntu_1204_fs&num=1 Ubuntu 12.04 LTS - Benchmarking All The Linux File-Systems] (Phoronix.com)
+
* '''2011-12''' [http://btrfs.boxacle.net Btrfs Performance Analysis]
+
* '''2011-11''' [http://www.phoronix.com/vr.php?view=16773 Testing The "Pretty Beefy" Btrfs Changes In Linux 3.2] (Phoronix.com)
+
* '''2011-10''' [http://www.ilsistemista.net/index.php/linux-a-unix/21-ext3-ext4-xfs-and-btrfs-filesystems-comparison-on-linux-kernel-300.html EXT3 vs EXT4 vs XFS vs BTRFS - filesystems comparison on Linux kernel 3.0.0] (Ilsistemista.net)
+
* '''2011-09''' [http://www.phoronix.com/scan.php?page=article&item=btrfs_linux31_ssd&num=1 Testing EXT4 & Btrfs On A Serial ATA 3.0 SSD] (Phoronix.com)
+
* '''2011-05''' [http://www.phoronix.com/scan.php?page=article&item=linux_2639_fs&num=1 Linux 2.6.39: XFS Speeds-Up, EXT4 &amp; Btrfs Unchanged] (Phoronix.com)
+
* '''2011-03''' [http://www.phoronix.com/scan.php?page=article&item=btrfs_lzo_2638&num=1 Btrfs LZO Compression Performance] (Phoronix.com)
+
* '''2010-12''' [http://www.phoronix.com/scan.php?page=article&item=btrfs_space_cache&num=1 Benchmarks Of The Btrfs Space Cache Option] (Phoronix.com) Comparing the performance of Btrfs using the default mount options, using the space_cache mount option, using the compress mount option for Btrfs file compression, and lastly using both the space_cache and compression mount options to benefit from the free space caching and Zlib compression.
+
* '''2010''' [http://www.mayrhofer.eu.org/ssd-linux-benchmark SSD Linux benchmarking: Comparing filesystems and encryption method]
+
* '''2010-11''' [http://www.ilsistemista.net/index.php/linux-a-unix/6-linux-filesystems-benchmarked-ext3-vs-ext4-vs-xfs-vs-btrfs.html EXT3 vs EXT4 vs XFS vs BTRFS linux filesystems benchmark] (Ilsistemista.net)
+
* '''2010-11''' [http://www.phoronix.com/scan.php?page=article&item=linux_2637_ext4btrfs&num=1 Phoronix: The Linux 2.6.37 Kernel With EXT4 &amp; Btrfs] (Phoronix.com) Comparison between Btrfs and Ext4.
+
* '''2010-10''' [http://www.linux-mag.com/id/7876 One Billion Files] Btrfs performs well in comparison to other filesystems, when there are a billion files in the filesystem.
+
* '''2009-05''' [http://www.phoronix.com/scan.php?page=article&item=btrfs_ssd_mode&num=1 Phoronix Test With SSD Mode] (Phoronix.com) This test show that btrfs is slower with ssd option activated. Ssd code has been updated during 2.6.30-rc and is expected to be faster.
+
* '''2009-04''' [http://www.phoronix.com/scan.php?page=article&item=btrfs_benchmarks&num=1 Phoronix Performance Test on Fedora 11 Preview] (Phoronix.com) The phoronix workload is mostly CPU based, but they do have a few filesystem benchmarks. Btrfs performs well, but you can see the checksumming and metadata duplication show up on their single disk streaming write workload. dbench in general measures lots of different caching effects, and is not a great measure of everyday performance.
+
* '''2008-10''' [http://btrfs.boxacle.net Btrfs performance analysis by Steven Pratt and IBM] The benchmarks from IBM demonstrate some bottlenecks we have in the extent recording on large workloads. We're working on fixes for these.
+
* '''2008-04''' [[Multi-device Benchmarks]]
+

Latest revision as of 09:38, 17 June 2021

btrfs

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.

[edit] 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.

[edit] Features

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.

[edit] 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)

[edit] Features by kernel version

As part of the changelog you can also review

[edit] Features Currently in Development or Planned for Future Implementation

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

[edit] Documentation

[edit] Guides and usage information

[edit] External Btrfs Documentation / Guides

Links to Btrfs documentation of various Linux distributions:

[edit] Manual pages

  • Original wiki documentation (obsolete, will be removed)

[edit] 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

[edit] News

IRC channel is moving to libera.chat

Due to changes in ownership of freenode.net, there's a new #btrfs channel at libera.chat.

btrfs-progs v5.12.1 (May 2021)

  • build: fix missing symbols in libbtrfs
  • mkfs: check for minimal number of zones
  • check: fix warning about cache generation when free space tree is enabled
  • fix superblock write in zoned mode on 16K pages


btrfs-progs v5.12 (May 2021)

  • libbtrfsutil: relicensed to LGPL v2.1+
  • mkfs: zoned mode support (kernel 5.12+)
  • fi df: show zone_unusable per profile type in zoned mode
  • fi usage: show total amount of zone_unusable
  • fi resize: fix message for exact size
  • image: fix warning and enlarge output file if necessary
  • core
    • refactor chunk allocator for more modes
    • implement zoned mode support: allocation and writes, sb log
    • crypto/hash refactoring and cleanups
    • refactoring and cleanups
  • other
    • test updates
    • CI updates
        • travis-ci integration disabled
        • docker images updated, more coverage
      • incomplete build support for Android removed
  • doc updates
    • chattr mode m for 'NOCOMPRESS"
    • swapfile used from fstab
    • how to add a new export to libbtrfsutil
    • update status of mount options since 5.9

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)

[edit] Source code download

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

[edit] Articles, presentations, podcasts

[edit] Historical resources

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

[edit] Articles, presentations, podcasts

[edit] Project information/Contact

[edit] 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