MKFS.BTRFS(8)MKFS.BTRFS(8)NAME
mkfs.btrfs - create a btrfs filesystem
SYNOPSIS
mkfs.btrfs [ -A alloc-start ] [ -b byte-count ] [ -d data-profile ] [
-f ] [ -l leafsize ] [ -L label ] [ -m metadata profile ] [ -M mixed
data+metadata ] [ -n nodesize ] [ -s sectorsize ] [ -r rootdir ] [ -K ]
[ -h ] [ -V ]
device [ device ... ]
DESCRIPTION
mkfs.btrfs is used to create a btrfs filesystem (usually in a disk par‐
tition, or an array of disk partitions). device is the special file
corresponding to the device (e.g /dev/sdXX ). If multiple devices
are specified, btrfs is created spanning across the specified devices.
OPTIONS-A, --alloc-start offset
Specify the offset from the start of the device to start the
btrfs filesystem. The default value is zero, or the start of the
device.
-b, --byte-count size
Specify the size of the resultant filesystem. If this option is
not used, mkfs.btrfs uses all the available storage for the
filesystem.
-d, --data type
Specify how the data must be spanned across the devices speci‐
fied. Valid values are raid0, raid1, raid5, raid6, raid10 or
single.
-f, --force
Force overwrite when an existing filesystem is detected on the
device. By default, mkfs.btrfs will not write to the device if
it suspects that there is a filesystem or partition table on the
device already.
-l, --leafsize size
Specify the leaf size, the least data item in which btrfs stores
data. The default value is the page size.
-L, --label name
Specify a label for the filesystem.
-m, --metadata profile
Specify how metadata must be spanned across the devices speci‐
fied. Valid values are raid0, raid1, raid5, raid6, raid10, sin‐
gle or dup. Single device will have dup set by default except
in the case of SSDs which will default to single. This is
because SSDs can remap blocks internally so duplicate blocks
could end up in the same erase block which negates the benefits
of doing metadata duplication.
-M, --mixed
Mix data and metadata chunks together for more efficient space
utilization. This feature incurs a performance penalty in
larger filesystems. It is recommended for use with filesystems
of 1 GiB or smaller.
-n, --nodesize size
Specify the nodesize. By default the value is set to the page‐
size.
-s, --sectorsize size
Specify the sectorsize, the minimum block allocation.
-r, --rootdir rootdir
Specify a directory to copy into the newly created fs.
-K, --nodiscard
Do not perform whole device TRIM operation by default.
-V, --version
Print the mkfs.btrfs version and exit.
UNIT
As default the unit is the byte, however it is possible to append a
suffix to the arguments like k for KBytes, m for MBytes...
AVAILABILITY
mkfs.btrfs is part of btrfs-progs. Btrfs is currently under heavy
development, and not suitable for any uses other than benchmarking and
review. Please refer to the btrfs wiki http://btrfs.wiki.kernel.org
for further details.
SEE ALSObtrfsck(8)MKFS.BTRFS(8)