Main Page

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(News and Changelog: Achtung! Achtung!)
(News and Changelog: linux 5.5)
 
(47 intermediate revisions by 5 users not shown)
Line 26: Line 26:
 
* 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, LZO, ZSTD), heuristics
 
* [[Compression]] (zlib, LZO, ZSTD), heuristics
 
* Integrated [[Multiple_Device_Support|multiple device support]]
 
* Integrated [[Multiple_Device_Support|multiple device support]]
Line 44: Line 44:
 
** 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]] for extra robustness
  
 
=== Features by kernel version ===
 
=== Features by kernel version ===
Line 54: Line 56:
 
* Online filesystem check
 
* Online filesystem check
 
* Object-level mirroring and striping
 
* Object-level mirroring and striping
* Alternative checksum algorithms
+
* In-band deduplication (happens during writes)
* In-band deduplication (happes during writes)
+
** [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]
+
 
* Hot data tracking and moving to faster devices (or provided on the generic VFS layer)
 
* Hot data tracking and moving to faster devices (or provided on the generic VFS layer)
* SMR support
+
* 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 65: Line 64:
 
== News and Changelog ==
 
== News and Changelog ==
  
<b>WARNING:</b> kernels <b>4.14.25 - 4.14.27</b> and <b>4.15.8 - 4.15.9</b> on <b>big endian</b> machines
+
''' linux v5.5 (Jan 2020) '''
will damage a filesystem after first umount. Little endian machines are unaffected. Please contact upstream developers if your filesystems were affected, the problem can be manually fixed and is only in the superblock, not data or regular metadata.
+
  
''' btrfs-progs v4.15.1 (Feb 2018) '''
+
* new block group profiles: RAID1 with 3- and 4- copies                                                                                                                                                           
* build
+
** RAID1 in btrfs has always 2 copies, now add support for 3 and 4                                                                                                                                               
** fix build on musl
+
** this is an incompat feature (named RAID1C34)                                                                                                                                                                   
** support asciidoctor for doc generation
+
** recommended use of RAID1C3 is replacement of RAID6 profile on metadata, this brings a more reliable resiliency against 2 device loss/damage                                                                   
* cleanups
+
* support for new checksums                                                                                                                                                                                       
** sync some code with kernel
+
** per-filesystem, set at mkfs time                                                                                                                                                                               
** check: move code to own directory, split to more files
+
** fast hash (crc32c successor): xxhash, 64bit digest                                                                                                                                                             
* tests
+
** strong hashes (both 256bit): sha256 (slower, FIPS), blake2b (faster)                                                                                                                                           
** more build tests in travis
+
* speed up lseek, don't take inode locks unnecessarily, this can speed up parallel SEEK_CUR/SEEK_SET/SEEK_END by 80%                                                                                             
** tests now pass with asan and ubsan
+
* send:                                                                                                                                                                                                           
** testsuite can be exported and used separately
+
** allow clone operations within the same file                                                                                                                                                                   
 +
** limit maximum number of sent clone references to avoid slow backref walking                                                                                                                                   
 +
* error message improvements: device scan prints process name and PID                                                                                                                                             
 +
* new tree-checker sanity tests (INODE_ITEM, DIR_ITEM, DIR_INDEX, INODE_REF, XATTR)
 +
* more in the [https://git.kernel.org/linus/97d0bf96a0d0986f466c3ff59f2ace801e33dc69 pull request]
  
''' Linux v4.15 (Jan 2018) '''
+
''' btrfs-progs v5.4.1 (Jan 2020) '''
* new features
+
* build: fix docbook5 build                                                                                                                                                                               
** extend mount options to specify zlib compression level, <i>-o compress=zlib:9</i>
+
* check: do extra verification of extent items, inode items and chunks                                                                                                                                     
** v2 of ioctl "extent to inode mapping"
+
* qgroup: return ENOTCONN if quotas not running (needs updated kernel)                                                                                                                                    
** populate compression heuristics logic
+
* other: various test fixups
** enable indexing for btrfs as lower filesystem in overlayfs
+
** speedup page cache readahead during send on large files
+
* internal changes
+
** more sanity checks of b-tree items when reading them from disk
+
** more EINVAL/EUCLEAN fixups, missing BLK_STS_* conversion, other errno or error handling fixes
+
** remove some homegrown IO-related logic, that's been obsoleted by core block layer changes (batching, plug/unplug, own counters)
+
** add ref-verify, optional debugging feature to verify extent reference accounting
+
** simplify code handling outstanding extents, make it more clear where and how the accounting is done
+
** make delalloc reservations per-inode, simplify the code and make the logic more straightforward
+
** extensive cleanup of delayed refs code
+
* fix send ioctl on 32bit with 64bit kernel
+
  
 
Read about past releases in the [[Changelog]]
 
Read about past releases in the [[Changelog]]
Line 133: Line 124:
 
* [[Changelog]] — history of changes in linux kernel wrt btrfs
 
* [[Changelog]] — history of changes in linux kernel wrt btrfs
 
** [[Changelog#By_feature | features added by release]]
 
** [[Changelog#By_feature | features added by release]]
* [[Contributors#Statistics|Development statistics]] — contributors, commits, lines
+
* [[Contributors#Statistics_for_5.x_series|Development statistics]] — contributors, commits, lines
 
* [[Glossary]]
 
* [[Glossary]]
 
* Contact information:
 
* Contact information:
 
** [[Btrfs mailing list]]
 
** [[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]
 
** [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''.
+
** 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]]
 
* [[Project_ideas#Cleanup_projects|Cleanup ideas]]
 
* [[Project_ideas#Cleanup_projects|Cleanup ideas]]
Line 190: Line 184:
  
 
== Articles, presentations, podcasts ==
 
== Articles, presentations, podcasts ==
 +
* '''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 203: Line 200:
 
== Benchmarking ==
 
== Benchmarking ==
 
-->
 
-->
 
  
 
== Historical resources ==
 
== Historical resources ==
Line 225: Line 221:
  
 
=== Benchmarks ===
 
=== Benchmarks ===
 +
* '''2019-12''' [https://www.phoronix.com/scan.php?page=article&item=linux54-hdd-raid&num=1 Linux 5.4 EXT4 / XFS / Btrfs RAID Performance On Four HDDs]
 
* '''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-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://cd34.com/blog/scalability/ext4-xfs-and-btrfs-benchmark-redux/ Ext4, XFS and Btrfs benchmark redux]
 
* '''2011-12''' [http://btrfs.boxacle.net Btrfs Performance Analysis]
 
* '''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)
 
* '''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-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.
 
* '''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.
* '''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.
 

Latest revision as of 17:45, 27 January 2020

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 multiple companies, Btrfs is licensed under the GPL and open for contribution from anyone. 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 page.

Contents

[edit] Stability status

For a feature status and stability please refer to the Status page. The filesystem 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.

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.

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.

As with all software, newly added features may need a few releases to stabilize.

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 for extra robustness

[edit] Features by kernel version

As part of the changelog you can also review

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

  • Online filesystem check
  • Object-level mirroring and striping
  • In-band deduplication (happens during writes)
  • Hot data tracking and moving to faster devices (or provided on the generic VFS layer)
  • SMR (zoned block device) support
  • DAX/persistent memory support
  • The file/directory -level encryption support (fscrypt)

[edit] News and Changelog

linux v5.5 (Jan 2020)

  • new block group profiles: RAID1 with 3- and 4- copies
    • RAID1 in btrfs has always 2 copies, now add support for 3 and 4
    • this is an incompat feature (named RAID1C34)
    • recommended use of RAID1C3 is replacement of RAID6 profile on metadata, this brings a more reliable resiliency against 2 device loss/damage
  • support for new checksums
    • per-filesystem, set at mkfs time
    • fast hash (crc32c successor): xxhash, 64bit digest
    • strong hashes (both 256bit): sha256 (slower, FIPS), blake2b (faster)
  • speed up lseek, don't take inode locks unnecessarily, this can speed up parallel SEEK_CUR/SEEK_SET/SEEK_END by 80%
  • send:
    • allow clone operations within the same file
    • limit maximum number of sent clone references to avoid slow backref walking
  • error message improvements: device scan prints process name and PID
  • new tree-checker sanity tests (INODE_ITEM, DIR_ITEM, DIR_INDEX, INODE_REF, XATTR)
  • more in the pull request

btrfs-progs v5.4.1 (Jan 2020)

  • build: fix docbook5 build
  • check: do extra verification of extent items, inode items and chunks
  • qgroup: return ENOTCONN if quotas not running (needs updated kernel)
  • other: various test fixups

Read about past releases in the Changelog

[edit] Documentation

[edit] Guides and usage information

[edit] External Btrfs Documentation / Guides

Links to Btrfs documentation of various Linux distributions:

[edit] Project information/Contact

[edit] Manual pages

  • Original wiki documentation (obsolete, will be removed)

[edit] Developer documentation

  • 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)
  • Code documentation — trees, source files, sample code for manipulating trees
  • Data Structures — detailed on-disk data structures
  • Trees — detailed in-tree representation of files and directories
  • 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] Source code download

[edit] Wiki editing

The wiki contributions are welcome! Please create an account and wait for approval (this is a necessary spam protection). You can try to catch some of the wiki admins on IRC and expedite the account creation.

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

Personal tools