blob: a3f150346cf8ed9b3b4c9208b84ccecb74958dc8 [file] [log] [blame]
mkfs.btrfs \- create a btrfs filesystem
.B mkfs.btrfs
[ \fB\-A\fP\fI alloc-start\fP ]
[ \fB\-b\fP\fI byte-count\fP ]
[ \fB\-d\fP\fI data-profile\fP ]
[ \fB\-f\fP ]
[ \fB\-l\fP\fI leafsize\fP ]
[ \fB\-L\fP\fI label\fP ]
[ \fB\-m\fP\fI metadata profile\fP ]
[ \fB\-M\fP\fI mixed data+metadata\fP ]
[ \fB\-n\fP\fI nodesize\fP ]
[ \fB\-s\fP\fI sectorsize\fP ]
[ \fB\-r\fP\fI rootdir\fP ]
[ \fB\-K\fP ]
[ \fB\-h\fP ]
[ \fB\-V\fP ]
\fI device\fP [ \fIdevice ...\fP ]
.B mkfs.btrfs
is used to create a btrfs filesystem (usually in a disk partition, or an array
of disk partitions).
.I device
is the special file corresponding to the device (e.g \fI/dev/sdXX\fP ).
If multiple \fI devices \fP are specified, btrfs is created
spanning across the specified \fI devices\fP.
\fB\-A\fR, \fB\-\-alloc\-start \fIoffset\fR
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.
\fB\-b\fR, \fB\-\-byte\-count \fIsize\fR
Specify the size of the resultant filesystem. If this option is not used,
mkfs.btrfs uses all the available storage for the filesystem.
\fB\-d\fR, \fB\-\-data \fItype\fR
Specify how the data must be spanned across the devices specified. Valid
values are raid0, raid1, raid5, raid6, raid10 or single.
\fB\-f\fR, \fB\-\-force\fR
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.
\fB\-l\fR, \fB\-\-leafsize \fIsize\fR
Specify the leaf size, the least data item in which btrfs stores data. The
default value is the page size.
\fB\-L\fR, \fB\-\-label \fIname\fR
Specify a label for the filesystem.
\fB\-m\fR, \fB\-\-metadata \fIprofile\fR
Specify how metadata must be spanned across the devices specified. Valid
values are raid0, raid1, raid5, raid6, raid10, single 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.
\fB\-M\fR, \fB\-\-mixed\fR
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.
\fB\-n\fR, \fB\-\-nodesize \fIsize\fR
Specify the nodesize. By default the value is set to the pagesize.
\fB\-s\fR, \fB\-\-sectorsize \fIsize\fR
Specify the sectorsize, the minimum block allocation.
\fB\-r\fR, \fB\-\-rootdir \fIrootdir\fR
Specify a directory to copy into the newly created fs.
\fB\-K\fR, \fB\-\-nodiscard \fR
Do not perform whole device TRIM operation by default.
\fB\-V\fR, \fB\-\-version\fR
Print the \fBmkfs.btrfs\fP version and exit.
As default the unit is the byte, however it is possible to append a suffix
to the arguments like \fBk\fP for KBytes, \fBm\fP for MBytes...
.B 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 for further details.
.BR btrfsck (8)