Skip to content

Commit 60ac4be

Browse files
committed
btrfs-progs: docs: update documentation
Signed-off-by: David Sterba <[email protected]>
1 parent abad680 commit 60ac4be

File tree

2 files changed

+62
-38
lines changed

2 files changed

+62
-38
lines changed

Documentation/btrfs-rescue.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ clear-space-cache <v1|v2> <device>
6565
remove the cache for updated block groups, the remaining would not be removed.
6666
Thus this command is provided to manually clear the free space cache.
6767

68+
.. _man-rescue-clear-uuid-tree:
69+
6870
clear-uuid-tree <device>
69-
Clear UUID tree, so that kernel can re-generate it at next read-write
71+
Clear the UUID tree, so that kernel can regenerate it at next read-write
7072
mount.
7173

7274
Since kernel v4.16 there are more sanity check performed, and sometimes
7375
non-critical trees like UUID tree can cause problems and reject the mount.
7476
In such case, clearing UUID tree may make the filesystem to be mountable again
7577
without much risk as it's built from other trees.
78+
See also :docref:`mount option rescan_uuid_tree <btrfs-man5:mount-option-rescan-uuid-tree>`.
7679

7780
super-recover [options] <device>
7881
Recover bad superblocks from good copies.

Documentation/ch-mount-options.rst

+58-37
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ BTRFS SPECIFIC MOUNT OPTIONS
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
This section describes mount options specific to BTRFS. For the generic mount
5-
options please refer to :manref:`mount(8)` manual page. The options are sorted alphabetically
6-
(discarding the *no* prefix).
5+
options please refer to :manref:`mount(8)` manual page and also see the section
6+
with BTRFS specifics :ref:`below<mount-options-generic>`. The options are
7+
sorted alphabetically (discarding the *no* prefix).
78

89
.. note::
910
Most mount options apply to the whole filesystem and only options in the
@@ -69,27 +70,6 @@ barrier, nobarrier
6970
option will not lead to filesystem corruption as the pending blocks are
7071
supposed to make it to the permanent storage.
7172

72-
check_int, check_int_data, check_int_print_mask=<value>
73-
(since: 3.0, default: off)
74-
75-
These debugging options control the behavior of the integrity checking
76-
module (the BTRFS_FS_CHECK_INTEGRITY config option required). The main goal is
77-
to verify that all blocks from a given transaction period are properly linked.
78-
79-
*check_int* enables the integrity checker module, which examines all
80-
block write requests to ensure on-disk consistency, at a large
81-
memory and CPU cost.
82-
83-
*check_int_data* includes extent data in the integrity checks, and
84-
implies the *check_int* option.
85-
86-
*check_int_print_mask* takes a bitmask of BTRFSIC_PRINT_MASK_* values
87-
as defined in *fs/btrfs/check-integrity.c*, to control the integrity
88-
checker module behavior.
89-
90-
See comments at the top of *fs/btrfs/check-integrity.c*
91-
for more information.
92-
9373
clear_cache
9474
Force clearing and rebuilding of the free space cache if something
9575
has gone wrong.
@@ -110,9 +90,14 @@ commit=<seconds>
11090

11191
Set the interval of periodic transaction commit when data are synchronized
11292
to permanent storage. Higher interval values lead to larger amount of unwritten
113-
data, which has obvious consequences when the system crashes.
114-
The upper bound is not forced, but a warning is printed if it's more than 300
115-
seconds (5 minutes). Use with care.
93+
data to accumulate in memory, which has obvious consequences when the
94+
system crashes. The upper bound is not forced, but a warning is
95+
printed if it's more than 300 seconds (5 minutes). Use with care.
96+
97+
The periodic commit is not the only mechanism to do the transaction commit,
98+
this can also happen by explicit :command:`sync` or indirectly by other
99+
commands that affect the global filesystem state or internal kernel
100+
mechanisms that flush based on various thresholds or policies (e.g. cgroups).
116101

117102
compress, compress=<type[:level]>, compress-force, compress-force=<type[:level]>
118103
(default: off, level support since: 5.1)
@@ -210,14 +195,14 @@ device=<devicepath>
210195
discard, discard=sync, discard=async, nodiscard
211196
(default: async when devices support it since 6.2, async support since: 5.6)
212197

213-
Enable discarding of freed file blocks. This is useful for SSD devices, thinly
214-
provisioned LUNs, or virtual machine images; however, every storage layer must
215-
support discard for it to work.
198+
Enable discarding of freed file blocks. This is useful for SSD/NVMe
199+
devices, thinly provisioned LUNs, or virtual machine images; however,
200+
every storage layer must support discard for it to work.
216201

217202
In the synchronous mode (*sync* or without option value), lack of asynchronous
218203
queued TRIM on the backing device TRIM can severely degrade performance,
219204
because a synchronous TRIM operation will be attempted instead. Queued TRIM
220-
requires newer than SATA revision 3.1 chipsets and devices.
205+
requires SATA devices with chipsets revision newer than 3.1 and devices.
221206

222207
The asynchronous mode (*async*) gathers extents in larger chunks before sending
223208
them to the devices for TRIM. The overhead and performance impact should be
@@ -319,24 +304,30 @@ norecovery
319304
and avoids other write operations. Note that this option is the same as
320305
*nologreplay*.
321306

322-
323307
.. note::
324308
The opposite option *recovery* used to have different meaning but was
325309
changed for consistency with other filesystems, where *norecovery* is used for
326310
skipping log replay. BTRFS does the same and in general will try to avoid any
327311
write operations.
328312

313+
.. duplabel:: mount-option-rescan-uuid-tree
314+
329315
rescan_uuid_tree
330316
(since: 3.12, default: off)
331317

332318
Force check and rebuild procedure of the UUID tree. This should not
333-
normally be needed.
319+
normally be needed. Alternatively the tree can be cleared from
320+
userspace by command :ref:`btrfs rescue clear-uuid-tree<man-rescue-uuid-tree>`
321+
and then it will be automatically rebuilt in kernel (the mount option
322+
is not needed in that case).
334323

335324
rescue
336325
(since: 5.9)
337326

338327
Modes allowing mount with damaged filesystem structures, all requires
339328
the filesystem to be mounted read-only and doesn't allow remount to read-write.
329+
This is supposed to provide unified and more fine grained tuning of
330+
errors that affect filesystem operation.
340331

341332
* *usebackuproot* (since 5.9)
342333

@@ -370,7 +361,7 @@ skip_balance
370361
Skip automatic resume of an interrupted balance operation. The operation can
371362
later be resumed with :command:`btrfs balance resume`, or the paused state can be
372363
removed with :command:`btrfs balance cancel`. The default behaviour is to resume an
373-
interrupted balance immediately after a volume is mounted.
364+
interrupted balance immediately after the filesystem is mounted.
374365

375366
space_cache, space_cache=<version>, nospace_cache
376367
(*nospace_cache* since: 3.2, *space_cache=v1* and *space_cache=v2* since 4.5, default: *space_cache=v2*)
@@ -408,8 +399,9 @@ ssd, ssd_spread, nossd, nossd_spread
408399
Options to control SSD allocation schemes. By default, BTRFS will
409400
enable or disable SSD optimizations depending on status of a device with
410401
respect to rotational or non-rotational type. This is determined by the
411-
contents of */sys/block/DEV/queue/rotational*). If it is 0, the *ssd* option is
412-
turned on. The option *nossd* will disable the autodetection.
402+
contents of :file:`/sys/block/DEV/queue/rotational`). If it is 0, the
403+
*ssd* option is turned on. The option *nossd* will disable the
404+
autodetection.
413405

414406
The optimizations make use of the absence of the seek penalty that's inherent
415407
for the rotational devices. The blocks can be typically written faster and
@@ -476,7 +468,7 @@ usebackuproot
476468
use the first readable. This can be used with read-only mounts as well.
477469

478470
.. note::
479-
This option has replaced *recovery*.
471+
This option has replaced *recovery* which has been deprecated.
480472

481473
user_subvol_rm_allowed
482474
(default: off)
@@ -513,13 +505,42 @@ inode_cache, noinode_cache
513505
previous use of the *inode_cache* option can be removed by
514506
:ref:`btrfs rescue clear-ino-cache<man-rescue-clear-ino-cache>`.
515507

508+
check_int, check_int_data, check_int_print_mask=<value>
509+
(removed in: 6.7, since: 3.0, default: off)
510+
511+
These debugging options control the behavior of the integrity checking
512+
module (the BTRFS_FS_CHECK_INTEGRITY config option required). The main goal is
513+
to verify that all blocks from a given transaction period are properly linked.
514+
515+
*check_int* enables the integrity checker module, which examines all
516+
block write requests to ensure on-disk consistency, at a large
517+
memory and CPU cost.
518+
519+
*check_int_data* includes extent data in the integrity checks, and
520+
implies the *check_int* option.
521+
522+
*check_int_print_mask* takes a bit mask of BTRFSIC_PRINT_MASK_* values
523+
as defined in *fs/btrfs/check-integrity.c*, to control the integrity
524+
checker module behavior.
525+
526+
See comments at the top of *fs/btrfs/check-integrity.c*
527+
for more information.
528+
516529

517530
NOTES ON GENERIC MOUNT OPTIONS
518531
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
519532

520533
Some of the general mount options from :manref:`mount(8)` that affect BTRFS and are
521534
worth mentioning.
522535

536+
.. _mount-options-generic:
537+
538+
context
539+
The context refers to the SELinux contexts and policy definitions passed
540+
as mount options. This works properly since version v6.8 (because the
541+
mount option parser of BTRFS was ported to new API that also understood
542+
the options).
543+
523544
noatime
524545
under read intensive work-loads, specifying *noatime* significantly improves
525546
performance because no new access time information needs to be written. Without
@@ -531,5 +552,5 @@ noatime
531552
https://lwn.net/Articles/499293/ - *Atime and btrfs: a bad combination? (LWN, 2012-05-31)*.
532553

533554
Note that *noatime* may break applications that rely on atime uptimes like
534-
the venerable Mutt (unless you use maildir mailboxes).
555+
the venerable Mutt (unless you use *maildir* mailboxes).
535556

0 commit comments

Comments
 (0)