SYNOPSIS
--------
-*mkfs.btrfs*
-$$[-A|--alloc-start <alloc-start>]$$
-$$[-b|--byte-count <byte-count>]$$
-$$[-d|--data <data-profile>]$$
-$$[-m|--metadata <metadata profile>]$$
-$$[-M|--mixed]$$
-$$[-l|--leafsize <leafsize>]$$
-$$[-n|--nodesize <nodesize>]$$
-$$[-s|--sectorsize <sectorsize>]$$
-$$[-L|--label <label>]$$
-$$[-K|--nodiscard]$$
-$$[-r|--rootdir <rootdir>]$$
-$$[-O|--features <feature1>[,<feature2>...]]$$
-$$[-U|--uuid <UUID>]$$
-$$[-f|--force]$$
-$$[-q|--quiet]$$
-$$[--help]$$
-$$[-V|--version]$$
-$$<device> [<device>...]$$
+*mkfs.btrfs* [options] <device> [<device>...]
DESCRIPTION
-----------
OPTIONS
-------
-*-A|--alloc-start <offset>*::
-(An option to help debugging chunk allocator.)
-Specify the (physical) offset from the start of the device at which allocations
-start. The default value is zero.
-
*-b|--byte-count <size>*::
-Specify the size of the filesystem. If this option is not used,
+Specify the size of the filesystem. If this option is not used, then
mkfs.btrfs uses the entire device space for the filesystem.
*-d|--data <profile>*::
*-n|--nodesize <size>*::
Specify the nodesize, the tree block size in which btrfs stores metadata. The
default value is 16KiB (16384) or the page size, whichever is bigger. Must be a
-multiple of the sectorsize, but not larger than 64KiB (65536). Leafsize always
-equals nodesize and the options are aliases.
+multiple of the sectorsize and a power of 2, but not larger than 64KiB (65536).
+Leafsize always equals nodesize and the options are aliases.
+
-Smaller node size increases fragmentation but lead to higher b-trees which in
+Smaller node size increases fragmentation but leads to taller b-trees which in
turn leads to lower locking contention. Higher node sizes give better packing
and less fragmentation at the cost of more expensive memory operations while
updating the metadata blocks.
*-K|--nodiscard*::
Do not perform whole device TRIM operation on devices that are capable of that.
+This does not affect discard/trim operation when the filesystem is mounted.
+Please see the mount option 'discard' for that in `btrfs`(5).
*-r|--rootdir <rootdir>*::
Populate the toplevel subvolume with files from 'rootdir'. This does not
*--help*::
Print help.
+*-A|--alloc-start <offset>*::
+*deprecated, will be removed*
+(An option to help debugging chunk allocator.)
+Specify the (physical) offset from the start of the device at which allocations
+start. The default value is zero.
+
SIZE UNITS
----------
The default unit is 'byte'. All size parameters accept suffixes in the 1024
before all block devices are discovered. The waiting is usually done on the
initramfs/initrd systems.
+As of kernel 4.14, RAID5/6 is still considered experimental and shouldn't be
+employed for production use.
+
FILESYSTEM FEATURES
-------------------
+Features that can be enabled during creation time. See also `btrfs`(5) section
+'FILESYSTEM FEATURES'.
+
*mixed-bg*::
+(kernel support since 2.6.37)
++
mixed data and metadata block groups, also set by option '--mixed'
*extref*::
sizes that can be stored into one metadata block
*raid56*::
+(kernel support since 3.9)
++
extended format for RAID5/6, also enabled if raid5 or raid6 block groups
are selected
reduced-size metadata for extent references, saves a few percent of metadata
*no-holes*::
+(kernel support since 3.14)
++
improved representation of file extents where holes are not explicitly
stored as an extent, saves a few percent of metadata if sparse files are used
.2+^.<h| Profile 3+^.^h| Redundancy .2+^.<h| Min/max devices
^.^h| Copies ^.^h| Parity ^.<h| Striping
| single | 1 | | | 1/any
-| DUP | 2 / 1 device | | | 1/any ^(see note)^
+| DUP | 2 / 1 device | | | 1/any ^(see note 1)^
| RAID0 | | | 1 to N | 2/any
| RAID1 | 2 | | | 2/any
| RAID10 | 2 | | 1 to N | 4/any
-| RAID5 | 1 | 1 | 2 to N - 1 | 2/any
-| RAID6 | 1 | 2 | 3 to N - 2 | 3/any
+| RAID5 | 1 | 1 | 2 to N - 1 | 2/any ^(see note 2)^
+| RAID6 | 1 | 2 | 3 to N - 2 | 3/any ^(see note 3)^
|=============================================================
-'Note:' DUP may exist on more than 1 device if it starts on a single device and
+WARNING: It's not recommended to build btrfs with RAID0/1/10/5/6 profiles on
+partitions from the same device. Neither redundancy nor performance will be
+improved.
+
+'Note 1:' DUP may exist on more than 1 device if it starts on a single device and
another one is added. Since version 4.5.1, *mkfs.btrfs* will let you create DUP
on multiple devices.
+'Note 2:' It's not recommended to use 2 devices with RAID5. In that case,
+parity stripe will contain the same data as the data stripe, making RAID5
+degraded to RAID1 with more overhead.
+
+'Note 3:' It's also not recommended to use 3 devices with RAID6, unless you
+want to get effectively 3 copies in a RAID1-like manner (but not exactly that).
+N-copies RAID1 is not implemented.
+
DUP PROFILES ON A SINGLE DEVICE
-------------------------------
the logical blocks to 2 physical locations. Whether there are really 2
physical copies highly depends on the underlying device type.
-For example, a SSD drive can remap the blocks internally to a single copy thus
+For example, a SSD drive can remap the blocks internally to a single copy--thus
deduplicating them. This negates the purpose of increased redundancy and just
-wastes filesystem space without the expected level of redundancy.
+wastes filesystem space without providing the expected level of redundancy.
The duplicated data/metadata may still be useful to statistically improve the
chances on a device that might perform some internal optimizations. The actual
SEE ALSO
--------
-`btrfs`(8), `wipefs`(8)
+`btrfs`(5),
+`btrfs`(8),
+`wipefs`(8)