btrfs-progs: doc: link btrfsck to btrfs-check
[platform/upstream/btrfs-progs.git] / Documentation / mkfs.btrfs.txt
1 mkfs.btrfs(8)
2 =============
3
4 NAME
5 ----
6 mkfs.btrfs - create a btrfs filesystem
7
8 SYNOPSIS
9 --------
10 'mkfs.btrfs'
11 $$[-A|--alloc-start <alloc-start>]$$
12 $$[-b|--byte-count <byte-count>]$$
13 $$[-d|--data <data-profile>]$$
14 $$[-f|--force]$$
15 $$[-n|--nodesize <nodesize>]$$
16 $$[-l|--leafsize <leafsize>]$$
17 $$[-L|--label <label>]$$
18 $$[-m|--metadata <metadata profile>]$$
19 $$[-M|--mixed]$$
20 $$[-s|--sectorsize <sectorsize>]$$
21 $$[-r|--rootdir <rootdir>]$$
22 $$[-K|--nodiscard]$$
23 $$[-O|--features <feature1>[<,feature2...>]]$$
24 $$[-h]$$
25 $$[-V|--version]$$
26 $$<device> [<device>...]$$
27
28 DESCRIPTION
29 -----------
30 'mkfs.btrfs'
31 is used to create a btrfs filesystem (usually in a disk partition, or an array
32 of disk partitions).
33
34 <device>
35 is the special file corresponding to the device (e.g /dev/sdXX ).
36 If multiple devices are specified, btrfs is created
37 spanning across the specified  devices.
38
39 OPTIONS
40 -------
41 -A|--alloc-start <offset>::
42 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.
43
44 -b|--byte-count <size>::
45 Specify the size of the resultant filesystem. If this option is not used,
46 mkfs.btrfs uses all the available storage for the filesystem.
47
48 -d|--data <type>::
49 Specify how the data must be spanned across the devices specified. Valid
50 values are 'raid0', 'raid1', 'raid5', 'raid6', 'raid10' or 'single'.
51
52 -f|--force::
53 Force overwrite when an existing filesystem is detected on the device.
54 By default, mkfs.btrfs will not write to the device if it suspects that 
55 there is a filesystem or partition table on the device already.
56
57 -n|--nodesize <size>
58 +
59 -l|--leafsize <size>::
60 Specify the nodesize, the tree block size in which btrfs stores
61 data. The default value is 16KB (16384) or the page size, whichever is
62 bigger. Must be a multiple of the sectorsize, but not larger than
63 65536. Leafsize always equals nodesize and the options are aliases.
64
65 -L|--label <name>::
66 Specify a label for the filesystem.
67 +
68 NOTE: <name> should be less than 256 characters.
69
70
71 -m|--metadata <profile>::
72 Specify how metadata must be spanned across the devices specified. Valid
73 values are 'raid0', 'raid1', 'raid5', 'raid6', 'raid10', 'single' or 'dup'.
74 +
75 Single device
76 will have dup set by default except in the case of SSDs which will default to
77 single. This is because SSDs can remap blocks internally so duplicate blocks
78 could end up in the same erase block which negates the benefits of doing
79 metadata duplication.
80
81 -M|--mixed::
82 Mix data and metadata chunks together for more efficient space 
83 utilization.  This feature incurs a performance penalty in
84 larger filesystems.  It is recommended for use with filesystems
85 of 1 GiB or smaller.
86
87 -s|--sectorsize <size>::
88 Specify the sectorsize, the minimum data block allocation unit.
89 +
90 The default
91 value is the page size. If the sectorsize differs from the page size, the
92 created filesystem may not be mountable by current kernel. Therefore it is not
93 recommended to use this option unless you are going to mount it on a system
94 with the appropriate page size.
95
96 -r|--rootdir <rootdir>::
97 Specify a directory to copy into the newly created btrfs filesystem.
98 +
99 NOTE: '-r' option is done completely in userland, and don't need root
100 privilege to mount the filesystem.
101
102 -K|--nodiscard::
103 Do not perform whole device TRIM operation by default.
104
105 -O|--features <feature1>[,<feature2>...]::
106 A list of filesystem features turned on at mkfs time. Not all features are
107 supported by old kernels.
108 +
109 To see all features run::::
110 mkfs.btrfs -O list-all
111
112 -V|--version::
113 Print the 'mkfs.btrfs' version and exit.
114
115 -h::
116 Print help.
117
118 UNIT
119 ----
120 As default the unit is the byte, however it is possible to append a suffix
121 to the arguments like 'k' for KBytes, 'm' for MBytes...
122
123 AVAILABILITY
124 ------------
125 'btrfs' is part of btrfs-progs. Btrfs filesystem is currently under heavy
126 development,
127 and not suitable for any uses other than benchmarking and review.
128 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
129 further details.
130
131 SEE ALSO
132 --------
133 `btrfs`(8)