Skip to content

Commit 8f580ad

Browse files
committed
btrfs-progs: docs: update mkfs.btrfs manual page
Fix missing or wrong formatting, enhance descriptions or add more references. Signed-off-by: David Sterba <[email protected]>
1 parent b34ba84 commit 8f580ad

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Documentation/mkfs.btrfs.rst

+16-7
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ OPTIONS
150150
Populate the toplevel subvolume with files from *rootdir*. This does not
151151
require root permissions to write the new files or to mount the filesystem.
152152

153+
Directories can be created as subvolumes, see also option *--subvol*.
154+
Hardlinks are detected and created in the filesystem image.
155+
153156
.. note::
154157
This option may enlarge the image or file to ensure it's big enough to
155158
contain the files from *rootdir*. Since version 4.14.1 the filesystem size is
@@ -160,6 +163,10 @@ OPTIONS
160163
*no* (the default), *zstd*, *lzo* or *zlib*. The optional value *level* is a
161164
compression level, 1..15 for *zstd*, 1..9 for *zlib*.
162165

166+
It is recommended to use the highest level to achieve maximum space savings.
167+
Compression at mkfs time is not as constrained as in kernel where it's
168+
desirable to use the less CPU load. Otherwise the default level is 3.
169+
163170
As with the kernel, :command:`mkfs.btrfs` won't write compressed extents when
164171
they would be larger than the uncompressed versions, and will set file attribute
165172
*NOCOMPRESS* if its beginning is found to be incompressible.
@@ -173,7 +180,7 @@ OPTIONS
173180
directory. The option *--rootdir* must also be specified, and *subdir* must be an
174181
existing subdirectory within it. This option can be specified multiple times.
175182

176-
*type* is an optional additional modifier. Valid choices are:
183+
The *type* is an optional additional modifier. Valid choices are:
177184

178185
* *default*: create as default subvolume
179186
* *ro*: create as read-only subvolume
@@ -183,24 +190,26 @@ OPTIONS
183190
Only one of *default* and *default-ro* may be specified.
184191

185192
If you wish to create a subvolume with a name containing a colon and you don't
186-
want this to be parsed as containing a modifier, you can prefix the path with `./`:
193+
want this to be parsed as containing a modifier, you can prefix the path with :file:`./`:
187194

188195
.. code-block:: bash
189196
190197
$ mkfs.btrfs --rootdir dir --subvol ./ro:subdir /dev/loop0
191198
192-
If there are hard links inside *rootdir* and *subdir* will split the
193-
subvolumes, like the following case::
199+
If there are hardlinks inside *rootdir* and *subdir* will split the
200+
subvolumes, like the following case:
201+
202+
.. code-block:: none
194203
195204
rootdir/
196205
|- hardlink1
197206
|- hardlink2
198207
|- subdir/ <- will be a subvolume
199208
|- hardlink3
200209

201-
In that case we cannot create `hardlink3` as hardlinks of
202-
`hardlink1` and `hardlink2` because hardlink3 will be inside a new
203-
subvolume.
210+
In that case we cannot create :file:`hardlink3` as hardlinks of
211+
:file:`hardlink1` and :file:`hardlink2` because :file:`hardlink3` will
212+
be inside a new subvolume.
204213

205214
--shrink
206215
Shrink the filesystem to its minimal size, only works with *--rootdir* option.

0 commit comments

Comments
 (0)