OS Manuals

/usr/bin/mkfs.erofs

userspace utilities for erofs filesystem

From erofs-utils 1.9.4-r2 (os), captured 2026-11-05 by running mkfs.erofs --help (exit 0). permalink

Usage: /usr/bin/mkfs.erofs [OPTIONS] FILE SOURCE(s)
Generate EROFS image (FILE) from SOURCE(s).

General options:
 -V, --version         print the version number of mkfs.erofs and exit
 -h, --help            display this help and exit

 -b#                   set block size to # (# = page size by default)
 -d<0-9>               set output verbosity; 0=quiet, 9=verbose (default=2)
 -x#                   set xattr tolerance to # (< 0, disable xattrs; default 2)
 -zX[,level=Y]         X=compressor (Y=compression level, Z=dictionary size, optional)
    [,dictsize=Z]      alternative compressors can be separated by colons(:)
    [:...]             supported compressors and their option ranges are:
                         lz4
                         lz4hc
                           [,level=<0-12>]		(default=9)
                         deflate
                           [,level=<0-9>]		(default=1)
                           [,dictsize=<dictsize>]	(default=32768, max=32768)
                         zstd
                           [,level=<0-22>]		(default=3)
                           [,dictsize=<dictsize>]	(default=<auto>, max=1048576)
 -C#                    specify the size of compress physical cluster in bytes
 -EX[,...]              X=extended options
 -L volume-label        set the volume label (maximum 15 bytes)
 -m#[:X]                enable metadata compression (# = physical cluster size in bytes;
                                                     X = another compression algorithm for metadata)
 -T#                    specify a fixed UNIX timestamp # as build time
    --all-time          the timestamp is also applied to all files (default)
    --mkfs-time         the timestamp is applied as build time only
 -UX                    use a given filesystem UUID
 --zD[=<0|1>]           specify directory compression: 0=disable [default], 1=enable
 --MZ[=<0|[id]>]        put inode metadata ('i') and/or directory data ('d') into the separate metadata zone.
 --all-root             make all files owned by root
 --async-queue-limit=#  specify the maximum number of entries in the multi-threaded job queue
 --blobdev=X            specify an extra device X to store chunked data
 --chunksize=#          generate chunk-based files with #-byte chunks
 --clean=X              run full clean build (default) or:
 --incremental=X        run incremental build
                        X = data|rvsp|0 (data: full data, rvsp: space fallocated
                                         0: inodes zeroed)
 --compress-hints=X     specify a file to configure per-file compression strategy
 --dsunit=#             align all data block addresses to multiples of #
 --exclude-path=X       avoid including file X (X = exact literal path)
 --exclude-regex=X      avoid including files that match X (X = regular expression)
 --force-uid=#          set all file uids to # (# = UID)
 --force-gid=#          set all file gids to # (# = GID)
 --fsalignblks=#        specify the alignment of the primary device size in blocks
 --uid-offset=#         add offset # to all file uids (# = id offset)
 --gid-offset=#         add offset # to all file gids (# = id offset)
 --hard-dereference     dereference hardlinks, add links as separate inodes
 --ignore-mtime         use build time instead of strict per-file modification time
 --max-extent-bytes=#   set maximum decompressed extent size # in bytes
 --mount-point=X        X=prefix of target fs path (default: /)
 --preserve-mtime       keep per-file modification time strictly
 --offset=#             skip # bytes at the beginning of IMAGE.
 --root-xattr-isize=#   ensure the inline xattr size of the root directory is # bytes at least
 --aufs                 replace aufs special files with overlayfs metadata
 --sort=<path,none>     data sorting order for tarballs as input (default: path)
 --tar=X                generate a full or index-only image from a tarball(-ish) source
                        (X = f|i|headerball; f=full mode, i=index mode,
                                             headerball=file data is omitted in the source stream)
 --ovlfs-strip=<0,1>    strip overlayfs metadata in the target image (e.g. whiteouts)
 --quiet                quiet execution (do not write anything to standard output.)
 --ungzip[=X]           try to filter the tarball stream through gzip
                        (and optionally dump the raw stream to X together)
 --gzinfo[=X]           generate AWS SOCI-compatible zinfo in order to support random gzip access
 --vmdk-desc=X          generate a VMDK descriptor file to merge sub-filesystems
 --workers=#            set the number of worker threads to # (default: 64)
 --xattr-inode-digest=X specify extended attribute name X ("erofs.fingerprint.v1" if omitted) to record inode digests
 --xattr-prefix=X       X=extra xattr name prefix
 --zfeature-bits=#      toggle filesystem compression features according to given bits #
Options (57)
OptionDescriptionSource
-V, --versionprint the version number of mkfs.erofs and exithelp + man
-h, --helpDisplay help string and exit.help + man
-b#set block size to # (# = page size by default)help
-d 0-9Specify the level of debugging messages.help + man
-x#set xattr tolerance to # (< 0, disable xattrs;help
-zXX=compressor (Y=compression level, Z=dictionary size, optional) [,dictsize=Z] alternative compressors can be separated by colons(:) [:...] supported compressors and their option ranges are: lz4 lz4hc…help
-C#specify the size of compress physical cluster in byteshelp
-EXX=extended optionshelp
-L volume-labelSet the volume label for the filesystem to volume-label.help + man
-m# :Xenable metadata compression (# = physical cluster size in bytes;help
-T#specify a fixed UNIX timestamp # as build timehelp
--all-time(used together with -T) set all files to the fixed timestamp.help + man
--mkfs-time(used together with -T) the given timestamp is only applied to the build time.help + man
-UXuse a given filesystem UUIDhelp
--zD 0|1specify directory compression: 0=disable [default], 1=enablehelp
--MZ 0|[idput inode metadata ('i') and/or directory data ('d') into the separate metadata zone.help
--all-rootMake all files owned by root.help + man
--async-queue-limit #Specify the maximum number of entries in the multi-threaded job queue.help + man
--blobdev XSpecify an extra blob device to store chunk-based data.help + man
--chunksize #Generate chunk-based files with #-byte chunks.help + man
--clean XRun full clean build with the given MODE, which could be one of data, rvsp, or 0.help + man
--incremental XRun an incremental build where DESTINATION is an existing EROFS image, and the data specified by SOURCE will be incrementally appended to the image.help + man
--compress-hints Xspecify a file to configure per-file compression strategyhelp + man
--dsunit #Align all data block addresses to multiples of #.help + man
--exclude-path XIgnore file that matches the exact literal path.help + man
--exclude-regex XIgnore files that match the given extended regular expression.help + man
--force-uid #set all file uids to # (# = UID)help + man
--force-gid #set all file gids to # (# = GID)help + man
--fsalignblks #Specify the alignment of the primary device size (usually the filesystem size) in blocks.help + man
--uid-offset #add offset # to all file uids (# = id offset)help + man
--gid-offset #add offset # to all file gids (# = id offset)help + man
--hard-dereferenceDereference hardlinks and add links as separate inodes.help + man
--ignore-mtimeIgnore the file modification time whenever it would cause mkfs.erofs to use extended inodes over compact inodes.help + man
--max-extent-bytes #Specify maximum decompressed extent size in bytes.help + man
--mount-point XSpecify the prefix of target filesystem path (default: /).help + man
--preserve-mtimeUse extended inodes instead of compact inodes if the file modification time would overflow compact inodes.help + man
--offset #Skip # bytes at the beginning of the image.help + man
--root-xattr-isize #Ensure the inline xattr size of the root directory is # bytes at least.help + man
--aufsReplace aufs special files with overlayfs metadata.help + man
--sort pathdata sorting order for tarballs as input (default: path)help + man
--tar Xgenerate a full or index-only image from a tarball(-ish) source (X = f|i|headerball;help + man
--ovlfs-strip 0strip overlayfs metadata in the target image (e.g. whiteouts)help
--quietquiet execution (do not write anything to standard output.)help + man
--ungzip Xtry to filter the tarball stream through gzip (and optionally dump the raw stream to X together)help
--gzinfo Xgenerate AWS SOCI-compatible zinfo in order to support random gzip accesshelp
--vmdk-desc XGenerate a VMDK descriptor file to merge sub-filesystems, which can be used for tar index or rebuild mode.help + man
--workers #Set the number of worker threads to # (default: number of CPUs).help + man
--xattr-prefix XSpecify a customized extended attribute namespace prefix for space saving, e.g. "trusted.overlay.".help + man
--zfeature-bits #Toggle filesystem compression features according to given bits #.help + man
-b block-sizeSet the fundamental block size of the filesystem in bytes. (in the manual page but not in --help)man
-C max-pcluster-sizeSpecify the maximum size of compress physical cluster in bytes. (in the manual page but not in --help)man
-x #Limit how many xattrs will be inlined. (in the manual page but not in --help)man
-T #Specify a UNIX timestamp for image creation time for reproducible builds. (in the manual page but not in --help)man
-U UUIDSet the universally unique identifier (UUID) of the filesystem to UUID. (in the manual page but not in --help)man
--file-contexts fileRead SELinux label configuration/overrides from file in the selinux_file(5) format. (in the manual page but not in --help)man
--s3 endpointGenerate an image from S3-compatible object store. (in the manual page but not in --help)man
--xattr-inode-digest nameSpecify extended attribute name to record inode digests. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.