6 btrfs-check - check or repair an unmounted btrfs filesystem
10 *btrfs check* [options] <device>
15 The filesystem checker is used to verify structural integrity of a filesystem
16 and attempt to repair it if requested. The filesystem must be unmounted.
18 By default, *btrfs check* will not modify the device but you can reaffirm that
19 by the option '--readonly'.
21 *btrfsck* is an alias of *btrfs check* command and is now deprecated.
23 WARNING: Do not use '--repair' unless you are adviced to by a developer, an
24 experienced user or accept the fact that 'fsck' cannot possibly fix all sorts
25 of damage that could happen to a filesystem because of software and hardware
28 The structural integrity check verifies if internal filesystem objects or
29 data structures satisfy the constraints, point to the right objects or are
30 correctly connected together.
32 There are several cross checks that can detect wrong reference counts of shared
33 extents, backrefrences, missing extents of inodes, directory and inode
36 The amount of memory required can be high, depending on the size of the
37 filesystem, smililarly the run time.
39 SAFE OR ADVISORY OPTIONS
40 ------------------------
43 use the first valid set of backup roots stored in the superblock
45 This can be combined with '--super' if some of the superblocks are damaged.
48 verify checksums of data blocks
50 This expects that the filesystem is otherwise
51 OK, so this is basically and offline 'scrub' but does not repair data from
54 --chunk-root <bytenr>::
55 use the given offset 'bytenr' for the chunk tree root
57 -E|--subvol-extents <subvolid>::
58 show extent state for the given subvolume
61 indicate progress at various checking phases
64 verify qgroup accounting and compare against filesystem accounting
66 -r|--tree-root <bytenr>::
67 use the given offset 'bytenr' for the tree root
71 run in read-only mode, this option exists to calm potential panic when users
72 are going to run the checker
74 -s|--super <superblock>::
75 use 'superblock'th superblock copy, valid values are 0, 1 or 2 if the
76 respective superblock offset is within the device size
78 This can be used to use a different starting point if some of the primary
79 superblock is damaged.
85 enable the repair mode and attempt to fix problems where possible
87 create a new checksum tree and recalculate checksums in all files
89 NOTE: Do not blindly use this option to fix checksum mismatch problems.
92 build the extent tree from scratch
94 NOTE: Do not use unless you know what you're doing.
98 *btrfs check* returns a zero exit status if it succeeds. Non zero is
99 returned in case of failure.
103 *btrfs* is part of btrfs-progs.
104 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for