1MKFS.F2FS(8) System Manager's Manual MKFS.F2FS(8)
2
3
4
6 mkfs.f2fs - create an F2FS file system
7
9 mkfs.f2fs [ -a heap-based-allocation ] [ -c device-list ] [ -d debug-
10 level ] [ -e extension-list ] [ -E extension-list ] [ -f ] [ -g de‐
11 fault-options ] [ -i ] [ -l volume-label ] [ -m ] [ -o overprovision-
12 ratio-percentage ] [ -O feature-list ] [ -C encoding:flags ] [ -q ] [
13 -r ] [ -R root_owner ] [ -s #-of-segments-per-section ] [ -S ] [ -t
14 nodiscard/discard ] [ -T timestamp ] [ -w wanted-sector-size ] [ -z
15 #-of-sections-per-zone ] [ -V ] device [sectors]
16
18 mkfs.f2fs is used to create a f2fs file system (usually in a disk par‐
19 tition). device is the special file corresponding to the device (e.g.
20 /dev/sdXX). sectors is optionally given for specifying the filesystem
21 size.
22
23 The exit code returned by mkfs.f2fs is 0 on success and 1 on failure.
24
26 -a heap-based-allocation
27 Specify 1 or 0 to enable/disable heap based block allocation
28 policy. If the value is equal to 1, each of active log areas
29 are initially assigned separately according to the whole volume
30 size. The default value is 1.
31
32 -c device-list
33 Build f2fs with these additional comma separated devices, so
34 that the user can see all the devices as one big volume. Sup‐
35 ports up to 7 devices except meta device.
36
37 -d debug-level
38 Specify the level of debugging options. The default number is
39 0, which shows basic debugging messages.
40
41 -e extension-list
42 Specify a list of file extensions that f2fs will treat as cold
43 files. The data of files with those extensions will be stored
44 in the cold log. The default list includes most of the multime‐
45 dia file extensions such as jpg, gif, mpeg, mkv, and so on.
46
47 -E extension-list
48 Specify a list of file extensions that f2fs will treat as hot
49 files. The data of files with those extensions will be stored
50 in the hot log. The default list includes database file exten‐
51 sions, such as db.
52
53 -f Force overwrite when an existing filesystem is detected on the
54 device. By default, mkfs.f2fs will not write to the device if
55 it suspects that there is a filesystem or partition table on the
56 device already.
57
58 -g default-options
59 Use a default set of options. The following values are sup‐
60 ported:
61
62 android Use default options for Android having "-d1 -f
63 -w 4096 -R 0:0 -O encrypt -O project_quota,ex‐
64 tra_attr,{quota} -O verity".
65
66 -i Enable extended node bitmap.
67
68 -l volume-label
69 Specify the volume label to the partition mounted as F2FS.
70
71 -m Specify f2fs filesystem to supports the block zoned feature.
72 Without it, the filesystem doesn't support the feature.
73
74 -o overprovision-ratio-percentage
75 Specify the percentage of the volume that will be used as over‐
76 provision area. This area is hidden to users, and utilized by
77 F2FS cleaner. If not specified, the best number will be assigned
78 automatically according to the partition size.
79
80 -O feature-list
81 Set additional features for the filesystem. Features are comma
82 separated, and the flag can be repeated. The following features
83 are supported:
84
85 encrypt Enable support for filesystem level encryption.
86
87 extra_attr Enable extra attr feature, required for some of
88 the other features.
89
90 project_quota
91 Enable project ID tracking. This is used for
92 projet quota accounting. Requires extra attr.
93
94 inode_checksum
95 Enable inode checksum. Requires extra attr.
96
97 flexible_inline_xattr
98 Enable flexible inline xattr. Requires extra
99 attr.
100
101 quota Enable quotas.
102
103 inode_crtime
104 Enable inode creation time feature. Requires
105 extra attr.
106
107 lost_found Enable lost+found feature.
108
109 verity Enable support for verity protected files
110 (a.k.a. fs-verity).
111
112 sb_checksum Enable superblock checksum.
113
114 casefold Enable casefolding support in the filesystem.
115 Optional flags can be passed with -C
116
117 compression Enable support for filesystem level compres‐
118 sion. Requires extra attr.
119
120 -C encoding:flags
121 Support casefolding with a specific encoding, with optional
122 comma separated flags.
123
124 encoding:
125
126 utf8 Use UTF-8 for casefolding.
127 flags:
128
129 strict This flag specifies that invalid
130 strings should be rejected by the
131 filesystem. Default is disabled.
132
133 -q Quiet mode. With it, mkfs.f2fs does not show any messages, in‐
134 cluding the basic messages.
135
136 -r Sets the checkpointing srand seed to 0.
137
138 -R Give root_owner option for initial uid/gid assignment. Default
139 is set by getuid()/getgid(), and assigned by "-R $uid:$gid".
140
141 -s #-of-segments-per-section
142 Specify the number of segments per section. A section consists
143 of multiple consecutive segments, and is the unit of garbage
144 collection. The default number is 1, which means one segment is
145 assigned to a section.
146
147 -S Enable sparse mode.
148
149 -t 1/0 Specify 1 or 0 to enable or disable discard policy, respec‐
150 tively. The default value is 1.
151
152 -T timestamp
153 Set inodes times to a given timestamp. By default, the current
154 time will be used. This behaviour corresponds to the value -1.
155
156 -w wanted-sector-size
157 Specify the sector size in bytes. Without it, the sectors will
158 be calculated by device sector size.
159
160 -z #-of-sections-per-zone
161 Specify the number of sections per zone. A zone consists of mul‐
162 tiple sections. F2FS allocates segments for active logs with
163 separated zones as much as possible. The default number is 1,
164 which means a zone consists of one section.
165
166 sectors
167 Number of sectors. Default is determined by device size.
168
169 -V Print the version number and exit.
170
171 -h, --help
172 Print usage and exit.
173
175 This version of mkfs.f2fs has been written by Jaegeuk Kim
176 <jaegeuk.kim@samsung.com>.
177
179 mkfs.f2fs is available from git://git.kernel.org/pub/scm/linux/ker‐
180 nel/git/jaegeuk/f2fs-tools.git.
181
183 mkfs(8), fsck.f2fs(8), dump.f2fs(8), defrag.f2fs(8), resize.f2fs(8),
184 sload.f2fs(8).
185
186
187
188 MKFS.F2FS(8)