btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table
[platform/upstream/btrfs-progs.git] / man / mkfs.btrfs.8.in
1 .TH MKFS.BTRFS 8
2 .SH NAME
3 mkfs.btrfs \- create a btrfs filesystem
4 .SH SYNOPSIS
5 .B mkfs.btrfs
6 [ \fB\-A\fP\fI alloc-start\fP ]
7 [ \fB\-b\fP\fI byte-count\fP ]
8 [ \fB\-d\fP\fI data-profile\fP ]
9 [ \fB\-f\fP\fI ]
10 [ \fB\-l\fP\fI leafsize\fP ]
11 [ \fB\-L\fP\fI label\fP ]
12 [ \fB\-m\fP\fI metadata profile\fP ]
13 [ \fB\-M\fP\fI mixed data+metadata\fP ]
14 [ \fB\-n\fP\fI nodesize\fP ]
15 [ \fB\-s\fP\fI sectorsize\fP ]
16 [ \fB\-r\fP\fI rootdir\fP ]
17 [ \fB\-K\fP ]
18 [ \fB\-h\fP ]
19 [ \fB\-V\fP ]
20 \fI device\fP [ \fIdevice ...\fP ]
21 .SH DESCRIPTION
22 .B mkfs.btrfs
23 is used to create a btrfs filesystem (usually in a disk partition, or an array
24 of disk partitions).
25 .I device
26 is the special file corresponding to the device (e.g \fI/dev/sdXX\fP ).
27 If multiple \fI devices \fP are specified, btrfs is created
28 spanning across the specified \fI devices\fP.
29 .SH OPTIONS
30 .TP
31 \fB\-A\fR, \fB\-\-alloc\-start \fIoffset\fR
32 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.
33 .TP
34 \fB\-b\fR, \fB\-\-byte\-count \fIsize\fR
35 Specify the size of the resultant filesystem. If this option is not used,
36 mkfs.btrfs uses all the available storage for the filesystem.
37 .TP
38 \fB\-d\fR, \fB\-\-data \fItype\fR
39 Specify how the data must be spanned across the devices specified. Valid
40 values are raid0, raid1, raid10 or single.
41 .TP
42 \fB\-f\fR
43 Force overwrite when an existing filesystem is detected on the device.
44 By default, mkfs.btrfs will not write to the device if it suspects that 
45 there is a filesystem or partition table on the device already.
46 .TP
47 \fB\-l\fR, \fB\-\-leafsize \fIsize\fR
48 Specify the leaf size, the least data item in which btrfs stores data. The
49 default value is the page size.
50 .TP
51 \fB\-L\fR, \fB\-\-label \fIname\fR
52 Specify a label for the filesystem.
53 .TP
54 \fB\-m\fR, \fB\-\-metadata \fIprofile\fR
55 Specify how metadata must be spanned across the devices specified. Valid
56 values are raid0, raid1, raid10, single or dup.  Single device will have dup
57 set by default except in the case of SSDs which will default to single.  This is
58 because SSDs can remap blocks internally so duplicate blocks could end up in the
59 same erase block which negates the benefits of doing metadata duplication.
60 .TP
61 \fB\-M\fR, \fB\-\-mixed\fR
62 Mix data and metadata chunks together for more efficient space 
63 utilization.  This feature incurs a performance penalty in
64 larger filesystems.  It is recommended for use with filesystems
65 of 1 GiB or smaller.
66 .TP
67 \fB\-n\fR, \fB\-\-nodesize \fIsize\fR
68 Specify the nodesize. By default the value is set to the pagesize.
69 .TP
70 \fB\-s\fR, \fB\-\-sectorsize \fIsize\fR
71 Specify the sectorsize, the minimum block allocation.
72 .TP
73 \fB\-r\fR, \fB\-\-rootdir \fIrootdir\fR
74 Specify a directory to copy into the newly created fs.
75 .TP
76 \fB\-K\fR, \fB\-\-nodiscard \fR
77 Do not perform whole device TRIM operation by default.
78 .TP
79 \fB\-V\fR, \fB\-\-version\fR
80 Print the \fBmkfs.btrfs\fP version and exit.
81 .SH UNIT
82 As default the unit is the byte, however it is possible to append a suffix
83 to the arguments like \fBk\fP for KBytes, \fBm\fP for MBytes...
84 .SH AVAILABILITY
85 .B mkfs.btrfs
86 is part of btrfs-progs. Btrfs is currently under heavy development,
87 and not suitable for any uses other than benchmarking and review.
88 Please refer to the btrfs wiki
89 http://btrfs.wiki.kernel.org for further details.
90 .SH SEE ALSO
91 .BR btrfsck (8)