Btrfs-progs: fsck: add an option to check data csums
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-scrub.txt
1 btrfs-scrub(8)
2 ==============
3
4 NAME
5 ----
6 btrfs-scrub - scrub btrfs filesystem
7
8 SYNOPSIS
9 --------
10 *btrfs scrub* <subcommand> <args>
11
12 DESCRIPTION
13 -----------
14 *btrfs scrub* is used to scrub a btrfs filesystem, which will reading all data
15 from all disks and verifying checksums.
16
17 SUBCOMMAND
18 ----------
19 *start* [-BdqrRf] [-c <ioprio_class> -n <ioprio_classdata>] <path>|<device>::
20 Start a scrub on all devices of the filesystem identified by <path> or on
21 a single <device>.
22 +
23 Without options, scrub is started as a background process.
24 Progress can be obtained with the *scrub status* command. Scrubbing
25 involves reading all data from all disks and verifying checksums. Errors are
26 corrected along the way if possible.
27 +
28 The default IO priority of scrub is the idle class. The priority can be
29 configured similar to the `ionice`(1) syntax using '-c' and '-n' options.
30 +
31 `Options`
32 +
33 -B::::
34 Do not background and print scrub statistics when finished.
35 -d::::
36 Print separate statistics for each device of the filesystem (-B only).
37 -q::::
38 Quiet. Omit error messages and statistics.
39 -r::::
40 Read only mode. Do not attempt to correct anything.
41 -R::::
42 Raw print mode. Print full data instead of summary.
43 -c <ioprio_class>::::
44 Set IO priority class (see
45  ionice (1)
46 manpage).
47 -n <ioprio_classdata>::::
48 Set IO priority classdata (see `ionice`(1) manpage).
49 -f::::
50 force to check whether scrub has started or resumed in userspace.
51 this is useful when scrub stat record file is damaged.
52
53 *cancel* <path>|<device>::
54 If a scrub is running on the filesystem identified by <path>, cancel it.
55 +
56 Progress is saved in the scrub progress file and scrubbing can be resumed later
57 using the scrub resume command.
58 If a <device> is given, the corresponding filesystem is found and
59 scrub cancel behaves as if it was called on that filesystem.
60
61 *resume* [-BdqrR] [-c <ioprio_class> -n <ioprio_classdata>] <path>|<device>::
62 Resume a canceled or interrupted scrub cycle on the filesystem identified by
63 <path> or on a given <device>.
64 +
65 Does not start a new scrub if the last scrub finished successfully.
66 +
67 `Options`
68 +
69 see *scrub start*.
70
71 *status* [-d] <path>|<device>::
72 Show status of a running scrub for the filesystem identified by <path> or
73 for the specified <device>.
74 +
75 If no scrub is running, show statistics of the last finished or canceled scrub
76 for that filesystem or device.
77 +
78 `Options`
79 +
80 -d::::
81 Print separate statistics for each device of the filesystem.
82
83 EXIT STATUS
84 -----------
85 *btrfs scrub* returns a zero exist status if it succeeds. Non zero is
86 returned in case of failure.
87
88 AVAILABILITY
89 ------------
90 *btrfs* is part of btrfs-progs.
91 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
92 further details.
93
94 SEE ALSO
95 --------
96 `mkfs.btrfs`(8),