btrfs-progs: mkfs: update compression help and documentation

Move the option documentation next to --rootdir, reword documentation.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2025-01-22 20:34:20 +01:00
parent 52379d2dcd
commit 4f4b173269
2 changed files with 10 additions and 10 deletions

View File

@ -155,6 +155,15 @@ OPTIONS
contain the files from *rootdir*. Since version 4.14.1 the filesystem size is
not minimized. Please see option *--shrink* if you need that functionality.
--compress <algo>[:<level>]
Try to compress files when using *--rootdir*. Supported values for *algo* are
*no* (the default), *zstd*, *lzo* or *zlib*. The optional value *level* is a
compression level, 1..15 for *zstd*, 1..9 for *zlib*.
As with the kernel, :command:`mkfs.btrfs` won't write compressed extents when
they would be larger than the uncompressed versions, and will set file attribute
*NOCOMPRESS* if its beginning is found to be incompressible.
-u|--subvol <type>:<subdir>
Specify that *subdir* is to be created as a subvolume rather than a regular
directory. The option *--rootdir* must also be specified, and *subdir* must be an
@ -212,15 +221,6 @@ OPTIONS
$ mkfs.btrfs -O list-all
--compress <algo>[:<level>]
Try to compress files when using *--rootdir*. Supported values for *algo* are
*no* (the default), *zlib*, *lzo*, and *zstd*. The optional value *level* is a
compression level, from 1 to 9 for ZLIB and from 1 to 15 for ZSTD.
As with the kernel, :command:`mkfs.btrfs` won't write compressed extents when
they would be larger than the uncompressed versions, and will mark a file as
`nocompress` if its beginning is found to be incompressible.
-f|--force
Forcibly overwrite the block devices when an existing filesystem is detected.
By default, :command:`mkfs.btrfs` will utilize *libblkid* to check for any known

View File

@ -441,10 +441,10 @@ static const char * const mkfs_usage[] = {
"Creation:",
OPTLINE("-b|--byte-count SIZE", "set size of each device to SIZE (filesystem size is sum of all device sizes)"),
OPTLINE("-r|--rootdir DIR", "copy files from DIR to the image root directory"),
OPTLINE("--compress ALGO[:LEVEL]", "compress files by algorithm and level, ALGO can be 'no' (default), zstd, lzo, zlib"),
OPTLINE("-u|--subvol TYPE:SUBDIR", "create SUBDIR as subvolume rather than normal directory, can be specified multiple times"),
OPTLINE("--shrink", "(with --rootdir) shrink the filled filesystem to minimal size"),
OPTLINE("-K|--nodiscard", "do not perform whole device TRIM"),
OPTLINE("--compress ALGO[:LEVEL]", "compression algorithm and level to use; ALGO can be no (default), zlib, lzo, zstd"),
OPTLINE("-f|--force", "force overwrite of existing filesystem"),
"",
"General:",