From ArchWiki
Revision as of 01:17, 18 November 2010 by Eigrad (talk | contribs)
Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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.

Linux has a wealth of filesystems to choose from, 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.

Btrfs is under heavy development, but every effort is being made to keep the filesystem stable and fast. As of 2.6.31, they only plan to make forward compatible disk format changes.

Note: Btrfs does not yet have a fsck tool that can fix errors. While Btrfs is stable on a stable machine, it is currently possible to corrupt a filesystem irrecoverably if your machine crashes or loses power on disks that don't handle flush requests correctly. This will be fixed when the fsck tool is ready.


To install:


If using btrfs as your root filesystem, you may also want to install mkinitcpio-btrfs from AUR

This package will install a mkinitcpio hook intended for those who wish to have a single or multi-drive BTRFS file system as their / (root). the hook will ensure that the chosen root device from the kernel command line is intact and safe to boot. If root is not a BTRFS device, the hook is quietly skipped

Basic Use

To format a device to btrfs

mkfs.btrfs [options] dev [dev ...]

You can select multiple devices to create a raid. Supported raids include raid1, raid0, and raid 10. By default, metadata is mirrored and data is striped.


One of the features of btrfs is the use of subvolumes. Subvolumes are basically a named btree that holds files and directories. They have inodes inside the tree of tree roots and can have non-root owners and groups. Subvolumes can be given a quota of blocks, and once this quota is reached no new writes are allowed. All of the blocks and file extents inside of subvolumes are reference counted to allow snapshotting. Similar to the dynamically expanding storage of a virtual machine that will only use as much space on a device as needed. Eliminating several half-filled partitions. You can also mount the subvolumes with different mount options giving more flexibility in security.

To create a subvolume:

btrfs subvolume create [<dest>/]

For flexibility, you should install your system INTO A DEDICATED SUBVOLUME, and use:

rootflags=subvol=<whatever you called the subvol>

in your kernel boot parameters. It makes system rollbacks possible.

If using for your root partition you'll want to add crc32c to the modules array in your Template:Filename as well as add Template:Filename to the HOOKS array.


To create a snapshot:

btrfs subvolume snapshot <source> [<dest>/]<name>

See also