NAME
----
-btrfs-check - check or repair an unmounted btrfs filesystem
+btrfs-check - check or repair a btrfs filesystem
SYNOPSIS
--------
-----------
The filesystem checker is used to verify structural integrity of a filesystem
-and attempt to repair it if requested. The filesystem must be unmounted.
+and attempt to repair it if requested. It is recommended to unmount the
+filesystem prior to running the check, but it is possible to start checking a
+mounted filesystem (see '--force').
By default, *btrfs check* will not modify the device but you can reaffirm that
by the option '--readonly'.
*btrfsck* is an alias of *btrfs check* command and is now deprecated.
-WARNING: Do not use '--repair' unless you are advised to by a developer, an
-experienced user or accept the fact that 'fsck' cannot possibly fix all sorts
-of damage that could happen to a filesystem because of software and hardware
-bugs.
+WARNING: Do not use '--repair' unless you are advised to do so by a developer
+or an experienced user, and then only after having accepted that no 'fsck'
+successfully repair all types of filesystem corruption. Eg. some other software
+or hardware bugs can fatally damage a volume.
The structural integrity check verifies if internal filesystem objects or
data structures satisfy the constraints, point to the right objects or are
--check-data-csum::
verify checksums of data blocks
+
-This expects that the filesystem is otherwise
-OK, so this is basically and offline 'scrub' but does not repair data from
-spare copies.
+This expects that the filesystem is otherwise OK, and is basically and offline
+'scrub' but does not repair data from spare copies.
--chunk-root <bytenr>::
use the given offset 'bytenr' for the chunk tree root
mounted with that option. Thus, using this option with 'v1' makes it possible
to actually clear the entire free space cache.
+
-For free space cache 'v2', the 'clear_cache' kernel mount option does destroy
-the entire free space cache. This option with 'v2' provides an alternative
+For free space cache 'v2', the 'clear_cache' kernel mount option destroys
+the entire free space cache. This option, with 'v2' provides an alternative
method of clearing the free space cache that doesn't require mounting the
filesystem.
NOTE: 'lowmem' mode does not work with '--repair' yet, and is still considered
experimental.
+--force::
+allow work on a mounted filesystem. Note that this should work fine on a
+quiescent or read-only mounted filesystem but may crash if the device is
+changed externally, eg. by the kernel module. Repair without mount checks is
+not supported right now.
+
EXIT STATUS
-----------
*btrfs check* returns a zero exit status if it succeeds. Non zero is