1MKFS.EROFS(1) General Commands Manual MKFS.EROFS(1)
2
3
4
6 mkfs.erofs - tool to create an EROFS filesystem
7
9 mkfs.erofs [OPTIONS] DESTINATION SOURCE
10
12 EROFS is a new enhanced lightweight linux read-only filesystem with
13 modern designs (eg. no buffer head, reduced metadata, inline xat‐
14 trs/data, etc.) for scenarios which need high-performance read-only re‐
15 quirements, e.g. Android OS for smartphones and LIVECDs.
16
17 It also provides fixed-sized output compression support, which improves
18 storage density, keeps relatively higher compression ratios, which is
19 more useful to achieve high performance for embedded devices with lim‐
20 ited memory since it has unnoticable memory overhead and page cache
21 thrashing.
22
23 mkfs.erofs is used to create such EROFS filesystem DESTINATION image
24 file from SOURCE directory.
25
27 -z compression-algorithm[,#][:...]
28 Set a primary algorithm for data compression, which can be set
29 with an optional compression level (1 to 12 for LZ4HC, 0 to 9
30 for LZMA and 100 to 109 for LZMA extreme compression) separated
31 by a comma. Alternative algorithms could be specified and sepa‐
32 rated by colons.
33
34 -b block-size
35 Set the fundamental block size of the filesystem in bytes. In
36 other words, specify the smallest amount of data that can be ac‐
37 cessed at a time. The default is the system page size. It can‐
38 not be less than 512 bytes.
39
40 -C max-pcluster-size
41 Specify the maximum size of compress physical cluster in bytes.
42 This may cause the big pcluster feature to be enabled (Linux
43 v5.13+).
44
45 -d # Specify the level of debugging messages. The default is 2, which
46 shows basic warning messages.
47
48 -x # Limit how many xattrs will be inlined. The default is 2. Dis‐
49 ables storing xattrs if < 0.
50
51 -E extended-option[,...]
52 Set extended options for the filesystem. Extended options are
53 comma separated, and may take an extra argument using the equals
54 ('=') sign. The following extended options are supported:
55
56 all-fragments
57 Forcely record the whole files into a special inode
58 for better compression and it may take an argument
59 as the pcluster size of the packed inode in bytes.
60 (Linux v6.1+)
61
62 dedupe Enable global compressed data deduplication to mini‐
63 mize duplicated data in the filesystem. May further
64 reduce image size when used with -E fragments.
65 (Linux v6.1+)
66
67 force-inode-compact
68 Force generation of compact (32-byte) inodes.
69
70 force-inode-extended
71 Force generation of extended (64-byte) inodes.
72
73 force-inode-blockmap
74 Force generation of inode chunk format as a 4-byte
75 block address array.
76
77 force-chunk-indexes
78 Forcely generate inode chunk format as an 8-byte
79 chunk index (with device ID).
80
81 fragments[=size]
82 Pack the tail part (pcluster) of compressed files,
83 or entire files, into a special inode for smaller
84 image sizes, and it may take an argument as the
85 pcluster size of the packed inode in bytes. (Linux
86 v6.1+)
87
88 legacy-compress
89 Disable "inplace decompression" and "compacted in‐
90 dexes", for compatibility with Linux pre-v5.4.
91
92 noinline_data
93 Don't inline regular files to enable FSDAX for these
94 files (Linux v5.15+).
95
96 ^xattr-name-filter
97 Turn off/on xattr name filter to optimize negative
98 xattr lookups (Linux v6.6+).
99
100 ztailpacking
101 Pack the tail part (pcluster) of compressed files
102 into its metadata to save more space and the tail
103 part I/O. (Linux v5.17+)
104
105 -L volume-label
106 Set the volume label for the filesystem to volume-label. The
107 maximum length of the volume label is 16 bytes.
108
109 -T # Set all files to the given UNIX timestamp. Reproducible builds
110 require setting all to a specific one. By default, the source
111 file's modification time is used.
112
113 -U UUID
114 Set the universally unique identifier (UUID) of the filesystem
115 to UUID. The format of the UUID is a series of hex digits sepa‐
116 rated by hyphens, like this:
117 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
118
119 --all-root
120 Make all files owned by root.
121
122 --blobdev file
123 Specify an extra blob device to store chunk-based data.
124
125 --chunksize #
126 Generate chunk-based files with #-byte chunks.
127
128 --compress-hints file
129 Apply a per-file compression strategy. Each line in file is de‐
130 fined by tokens separated by spaces in the following form. Op‐
131 tionally, instead of the given primary algorithm, alternative
132 algorithms can be specified with algorithm-index explicitly:
133 <pcluster-size-in-bytes> [algorithm-index] <match-pattern>
134 match-patterns are extended regular expressions, matched against abso‐
135 lute paths within the output filesystem, with no leading /.
136
137 --exclude-path=path
138 Ignore file that matches the exact literal path. You may give
139 multiple --exclude-path options.
140
141 --exclude-regex=regex
142 Ignore files that match the given extended regular expression.
143 You may give multiple --exclude-regex options.
144
145 --file-contexts=file
146 Read SELinux label configuration/overrides from file in the
147 selinux_file(5) format.
148
149 --force-uid=UID
150 Set all file UIDs to UID.
151
152 --force-gid=GID
153 Set all file GIDs to GID.
154
155 --gid-offset=GIDOFFSET
156 Add GIDOFFSET to all file GIDs. When this option is used to‐
157 gether with --force-gid, the final file gids are set to GID +
158 GID-OFFSET.
159
160 --gzip Filter tarball streams through gzip.
161
162 --help Display help string and exit.
163
164 --ignore-mtime
165 Ignore the file modification time whenever it would cause
166 mkfs.erofs to use extended inodes over compact inodes. When not
167 using a fixed timestamp, this can reduce total metadata size.
168 Implied by -E force-inode-compact.
169
170 --max-extent-bytes #
171 Specify maximum decompressed extent size in bytes.
172
173 --preserve-mtime
174 Use extended inodes instead of compact inodes if the file modi‐
175 fication time would overflow compact inodes. This is the de‐
176 fault. Overrides --ignore-mtime.
177
178 --tar=f
179 Generate a full EROFS image from a tarball.
180
181 --tar=i
182 Generate an meta-only EROFS image from a tarball.
183
184 --uid-offset=UIDOFFSET
185 Add UIDOFFSET to all file UIDs. When this option is used to‐
186 gether with --force-uid, the final file uids are set to UID +
187 UIDOFFSET.
188
189 --xattr-prefix=PREFIX
190 Specify a customized extended attribute namespace prefix for
191 space saving, e.g. "trusted.overlay.". You may give multiple
192 --xattr-prefix options (Linux v6.4+).
193
195 This version of mkfs.erofs is written by Li Guifu <blucer‐
196 lee@gmail.com>, Miao Xie <miaoxie@huawei.com> and Gao Xiang <xiang@ker‐
197 nel.org> with continuously improvements from others.
198
199 This manual page was written by Gao Xiang <xiang@kernel.org>.
200
202 mkfs.erofs is part of erofs-utils package and is available from
203 git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git.
204
206 mkfs(8).
207
208
209
210 MKFS.EROFS(1)