From Fedora Project Wiki

(minor reorganizing)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Btrfs filesystem **DRAFT** =
{{autolang|base=yes}}


== Summary ==
===Btrfs: the b-tree filesystem===
Btrfs is a new copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Initially developed by Oracle, Btrfs is licensed under the GPL and open for contribution from anyone.
Btrfs is a copy-on-write filesystem for Linux aimed at implementing advanced features including error detection, fault tolerance, recovery, transparent compression, cheap snapshots, integrated volume management, and easy administration. It provides multiple device storage pooling, RAID-like functionality, fast snapshot creation, and checksumming of data and metadata. Contributors include Facebook, Fujitsu, (open)SUSE, Oracle, and Western Digital. Btrfs is licensed under the GPL and open for contribution from anyone.


For more detailed information can be found at the [http://btrfs.wiki.kernel.org Btrfs homepage].
===Default filesystem, on the desktop===
* Btrfs is the default file system for desktops, starting with Fedora 33. See the [https://fedoraproject.org/wiki/Changes/BtrfsByDefault Change Proposal]
* [https://fedoramagazine.org/btrfs-coming-to-fedora-33/ Fedora Magazine: Btrfs Coming to Fedora 33]


== Purpose ==
===Reporting bugs===
The purpose of this page is not to duplicate information that can be found on other sites both internal and external but to consolidate and organize information and to make it Fedora specific where appropriate.
* Bugs related to <code>btrfs</code> user-space commands should be filed against the <span style="color: blue">btrfs-progs</span> component.
* All other bugs should be filed against the <span style="color: blue">kernel</span> component. Following submission of the bug, please set the Assignee field to: <span style="color: blue">fedora-kernel-btrfs@fedoraproject.org</span> and Save the change.


== Btrfs support in Fedora ==
===Installer support===
* Btrfs has been available for testing as early as Fedora 11 but required a special boot parameter to be passed to [[Anaconda]] during installation.
* The Fedora installer, Anaconda, uses Btrfs by default in desktop editions and spins; and as an option in Manual Partitioning for Server, Cloud, and IoT editions. Fedora CoreOS installer, Ignition, also supports Btrfs as an option.
* In Fedora 15 it is available without a special boot parameter.
* The Btrfs partition scheme preset creates an ext4 /boot, and a Btrfs pool. Two subvolumes, root and home, are created from that pool and mounted at / and /home respectively.
* As of Fedora 16 it is slated to be the default filesystem.
* Additional mount points using Btrfs will also have corresponding subvolumes created based on the Name field. Subvolumes do not have a size, so the Desired Capacity field when creating new mount points is ignored and can be left blank.


== Installing ==
===Recommended reading for users===
Filesystem support is built into the kernel but you'll probably want to install the userspace programs using [[dnf|DNF]]:
====Basics====
<pre>
* `man 5 btrfs` — info about btrfs itself: mount options, features, limits, swapfile support, the case of multiple block group profiles
dnf install btrfs-progs
* `man btrfs` — btrfs user space commands overview
</pre>
* `man btrfs <command>` — man page for this specific btrfs command, e.g. `man btrfs device`. NOTE: Any command name can be shortened so long as the shortened form is unambiguous, e.g. `btrfs fi us` is equivalent to `btrfs filesystem usage`.
* `man mkfs.btrfs` — man page for the mkfs command, includes info on block groups, chunks, raid, multiple device layouts, profiles, redundancy, space utilization, and minimum devices.
====Intermediate====
* [https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Layout Btrfs Sysadmin Guide: Subvolume layouts]
* [https://fedoraproject.org/wiki/User:Chrismurphy/lvm2btrfs Chart of LVM commands and their Btrfs approximates]
====Advanced====
* [https://raid.wiki.kernel.org/index.php/Timeout_Mismatch linux-raid@ list: Timeout Mismatch]
* [https://lore.kernel.org/linux-btrfs/20200627032414.GX10769@hungrycats.org/ linux-btrfs@ list: How to use btrfs raid5 successfully(ish)]
====Developers====
* [https://github.com/btrfs/btrfs-dev-docs Collection of documents that describe internals of the BTRFS filesystem.]
* [https://btrfs.wiki.kernel.org/index.php/Developer%27s_FAQ Btrfs Wiki: Developer's FAQ, contributing to Btrfs.]


Or with YUM:
===Conversion from Ext3/Ext4 volumes to Btrfs (and back!)===
<pre>
{{admon/important|Btrfs has it's own volume management capability. If you are using ext4 on LVM, converting the volume to Btrfs does not remove LVM. It also doesn't create the subvolume layout that we're using in Anaconda and image builders.}}
yum install btrfs-progs
* Btrfs Wiki has more information on [https://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3 conversion and rollback.]
</pre>


== Conversions from Ext3/Ext4 volumes to Btrfs (and back!) ==
===Upstream Development===
{{admon/important|Although Btrfs does not need LVM, if you already are using it then converting your volume does not remove LVM.}}
* [https://btrfs.wiki.kernel.org/index.php/Changelog Btrfs Changelog].
* It is possible to convert back to Ext3/Ext4 as the metadata is stored as a subvolume. Once you delete the subvolume the conversion is permanent.
* [https://btrfs.wiki.kernel.org/index.php/Status Stability status].
* Some generic instructions can be found [http://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3 here].
* [https://btrfs.wiki.kernel.org/index.php/Btrfs_mailing_list Mailing list information].
* Some untested (by me) instructions on fedoraforum.org are [http://www.fedoraforum.org/forum/showthread.php?t=246520 here].


== Frequently Asked Question(s) ==
* Why use (or not use) Btrfs?
** The subvolume capability negates the need for LVM.
** Filesystem based [http://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices RAID 0/1/10].
** Online resizing and addition/removal of disks.
** Btrfs currently has limited fsck capability so make sure you backup your data!


[[Category:btrfs|btrfs]]
[[Category:btrfs|btrfs]]

Latest revision as of 01:53, 26 October 2020

Btrfs: the b-tree filesystem

Btrfs is a copy-on-write filesystem for Linux aimed at implementing advanced features including error detection, fault tolerance, recovery, transparent compression, cheap snapshots, integrated volume management, and easy administration. It provides multiple device storage pooling, RAID-like functionality, fast snapshot creation, and checksumming of data and metadata. Contributors include Facebook, Fujitsu, (open)SUSE, Oracle, and Western Digital. Btrfs is licensed under the GPL and open for contribution from anyone.

Default filesystem, on the desktop

Reporting bugs

  • Bugs related to btrfs user-space commands should be filed against the btrfs-progs component.
  • All other bugs should be filed against the kernel component. Following submission of the bug, please set the Assignee field to: fedora-kernel-btrfs@fedoraproject.org and Save the change.

Installer support

  • The Fedora installer, Anaconda, uses Btrfs by default in desktop editions and spins; and as an option in Manual Partitioning for Server, Cloud, and IoT editions. Fedora CoreOS installer, Ignition, also supports Btrfs as an option.
  • The Btrfs partition scheme preset creates an ext4 /boot, and a Btrfs pool. Two subvolumes, root and home, are created from that pool and mounted at / and /home respectively.
  • Additional mount points using Btrfs will also have corresponding subvolumes created based on the Name field. Subvolumes do not have a size, so the Desired Capacity field when creating new mount points is ignored and can be left blank.

Recommended reading for users

Basics

  • man 5 btrfs — info about btrfs itself: mount options, features, limits, swapfile support, the case of multiple block group profiles
  • man btrfs — btrfs user space commands overview
  • man btrfs <command> — man page for this specific btrfs command, e.g. man btrfs device. NOTE: Any command name can be shortened so long as the shortened form is unambiguous, e.g. btrfs fi us is equivalent to btrfs filesystem usage.
  • man mkfs.btrfs — man page for the mkfs command, includes info on block groups, chunks, raid, multiple device layouts, profiles, redundancy, space utilization, and minimum devices.

Intermediate

Advanced

Developers

Conversion from Ext3/Ext4 volumes to Btrfs (and back!)

Important.png
Btrfs has it's own volume management capability. If you are using ext4 on LVM, converting the volume to Btrfs does not remove LVM. It also doesn't create the subvolume layout that we're using in Anaconda and image builders.

Upstream Development