Differences between revisions 24 and 25
Revision 24 as of 2016-03-11 23:05:43
Size: 8194
Comment: complete todo-citations
Revision 25 as of 2016-03-11 23:14:06
Size: 8196
Comment: update official status link and add missing parentheses
Deletions are marked like this. Additions are marked like this.
Line 12: Line 12:
As of linux-4.4.3 the official status of btrfs is "Btrfs is under heavy development, and is not suitable for
any uses other than benchmarking and review" [[https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/filesystems/btrfs.txt?id=refs/tags/v4.4.3|git.kernel.org]]. In a ''linux-btrfs'' thread where a user is unable to rebalance his btrfs volume due to out of space errors, there is a discussion about changing this to "you should have backups and be prepared to use them if you're using btrfs, and...it's not suitable for production systems yet" (Duncan, 2016-03-06, [[https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg51348.html|linux-btrfs]]).
As of linux-4.4.5 the official status of btrfs is "Btrfs is under heavy development, and is not suitable for
any uses other than benchmarking and review" ([[https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/filesystems/btrfs.txt?id=refs/tags/v4.4.5|git.kernel.org]]). In a ''linux-btrfs'' thread where a user is unable to rebalance his btrfs volume due to out of space errors, there is a discussion about changing this to "you should have backups and be prepared to use them if you're using btrfs, and...it's not suitable for production systems yet" (Duncan, 2016-03-06, [[https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg51348.html|linux-btrfs]]).

Translation(s): English - Русский


FileSystem > Btrfs

Btrfs is intended to address the lack of pooling, snapshots, checksums, and integral multi-device spanning in Linux file systems, these features being crucial as the use of Linux scales upward into larger storage configurations. Btrfs is designed to be a multipurpose filesystem, scaling well on very large block devices.

Even though Btrfs has been in the kernel since 2.6.29, the developers state that "as of 2.6.31, we only plan to make forward compatible disk format changes". The developers still want to improve the user/management tools to make them easier to use. For more information about Btrfs, follow the links in See also section.

Ext2/3/4 filesystems should be upgradable to Btrfs, but this is not recommended because members of linux-btrfs have noted that a number of issues have been linked to conversions, and that the convert utility needs further work (Btrfs Wiki, Conversion from Ext3).

As of linux-4.4.5 the official status of btrfs is "Btrfs is under heavy development, and is not suitable for any uses other than benchmarking and review" (git.kernel.org). In a linux-btrfs thread where a user is unable to rebalance his btrfs volume due to out of space errors, there is a discussion about changing this to "you should have backups and be prepared to use them if you're using btrfs, and...it's not suitable for production systems yet" (Duncan, 2016-03-06, linux-btrfs).

In the near future this wiki article will be updated with recommendations on how to limit your risk when testing btrfs, along with workarounds for common issues. For example, you are substantially less likely to run into issues with a simple two disk mirror mounted noatime than an n-disk RAID6 mounted with compress=lzo and autodefrag. Many people have reported years of btrfs usage without issue, and this wiki will soon contain recommended configuration parameters for achieving this end. eg: the number of snapshots per volume and per subvolume must be carefully monitored and/or automatically pruned, because too many snapshots can wedge the filesystem into an out of space condition or gravely degrade performance (Duncan, 2016-02-16, linux-btrfs). There are also reports that IO becomes sluggish and lags with far fewer snapshots, eg: only 86/subvolume on linux-4.0.4; this might be fixed in a newer kernel (Pete, 2016-03-11, linux-btrfs).

Status

DebianSqueeze and later support Btrfs. This means that they include a compatible kernel and tools.

A Btrfs volume created on a raw partition can be used to boot.

The DebianInstaller can format and install to single-disk Btrfs volumes. The way that Btrfs combines multiple disks to create a single volume is not compatible with the data model of the current installer (#686097). Various people have described ways of installing Debian onto a RAID1 Btrfs without too much trouble. It is also possible to install normally, then add another disk, then rebalance as RAID1 (Btrfs Wiki, "Converting to RAID").

WARNING

  • Subvolumes cannot currently, as of linux-4.4.5, be mounted with different btrfs-specific options; the first btrfs line for a given volume in /etc/fstab takes effect. eg: you cannot mount / with noatime and /var with nodatacow,compress=lzo (Btrfs Wiki, "Mount options").

FAQ

Which package contains the tools?

btrfs-tools (in DebianSqueeze and above). You MUST install this package if you use Btrfs.

Does it support SSD optimizations?

Yes, Debian Jessie and later automatically detect non-rotational hard disks and ssd is added to the btrfs mount options. For more details on using SSDs with Debian, refer to SSDOptimization.

What are the recommended options for installing on a pendrive, a SD card or a slow SSD drive?

When installing, use manual partitioning and select btrfs as file system. In the first boot, edit /etc/fstab with this options, so you can expect a very good speed and responsiveness improvement:

/dev/sdaX / btrfs x-systemd.device-timeout=0,noatime,compress=lzo,commit=0,ssd_spread,autodefrag 0 0
Does it support compression?

Yes, by adding compress=lzo or compress=zlib (depending on the level of compression or speed, lzo being faster and zlib having more compression):

/dev/sdaX /  btrfs defaults,compress=lzo 0 1
But if what you want is to just compress the files in a directory?

You can do this by applying the following two commands (for example for /var):

btrfs filesystem defragment -r -v -clzo /var
chattr +c /var

By adding the +c attribute you ensure that any new file created inside the folder is compressed.

Changing /dev/sdaX with your actual root device (if Debian detected an UUID use it). If fact, there are many other more options you can add, just look at here. (Remember: all fstab mount options must be comma separated but NOT space separated, so do not insert a space after the comma or the equal symbol).

In order to check if you have written the options correctly before rebooting and therefore before being in trouble, run this command as root:

mount -o remount /

If no error is reported, everything is OK. Never try to boot with a troubled options fstab file or you'll have to manually try to recover it, a procedure that is more complicated.

What are the recommended options for a rotational hard disk?

In fstab :

UUID=<the_device_uuid> /mount/point/ btrfs noauto,compress=lzo,noatime,autodefrag 0 0

The noauto option will prevent the system to freeze at boot in the case of a non system and (likely) un-plugged device/partition.

Can I encrypt a btrfs installation?

Yes, you can by selecting manual partitioning and creating an encryption volume and then a btrfs file system on top of that. For the moment, btrfs does not support direct encryption so the installer uses cryptsetup, but is a planned feature.

Does it work on RaspberryPi?

Yes, improving filesystem I/O responsiveness a lot. You may have to convert the filesystem to btrfs first from a PC and change the /etc/fstab type of filesystem from ext4 to btrfs (just by changing the name) before the first boot. Look above for recommended sdcard options in /etc/fstab.

See also: Btrfs wiki: FAQ Btrfs wiki: Documentation

Documentation

See also

Contact


CategoryKernel