2014-04-02 08:29:17 +00:00
|
|
|
btrfs-scrub(8)
|
|
|
|
==============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2016-05-06 10:42:21 +00:00
|
|
|
btrfs-scrub - scrub btrfs filesystem, verify block checksums
|
2014-04-02 08:29:17 +00:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2014-05-19 15:49:35 +00:00
|
|
|
*btrfs scrub* <subcommand> <args>
|
2014-04-02 08:29:17 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2015-02-21 11:12:42 +00:00
|
|
|
*btrfs scrub* is used to scrub a btrfs filesystem, which will read all data
|
2016-07-14 21:35:26 +00:00
|
|
|
and metadata blocks from all devices and verify checksums. Automatically repair
|
2016-05-06 10:42:21 +00:00
|
|
|
corrupted blocks if there's a correct copy available.
|
2014-04-02 08:29:17 +00:00
|
|
|
|
2016-07-14 21:35:26 +00:00
|
|
|
NOTE: Scrub is not a filesystem checker (fsck) and does not verify nor repair
|
|
|
|
structural damage in the filesystem.
|
|
|
|
|
|
|
|
The user is supposed to run it manually or via a periodic system service. The
|
|
|
|
recommended period is a month but could be less. The estimated device bandwidth
|
2016-09-25 01:26:41 +00:00
|
|
|
utilization is about 80% on an idle filesystem. The IO priority class is by
|
2017-12-07 20:26:09 +00:00
|
|
|
default 'idle' so background scrub should not significantly interfere with
|
|
|
|
normal filesystem operation.
|
2016-07-14 21:35:26 +00:00
|
|
|
|
|
|
|
The scrubbing status is recorded in '/var/lib/btrfs/' in textual files named
|
2017-02-21 23:14:38 +00:00
|
|
|
'scrub.status.UUID' for a filesystem identified by the given UUID. (Progress
|
|
|
|
state is communicated through a named pipe in file 'scrub.progress.UUID' in the
|
|
|
|
same directory.) The status file is updated every 5 seconds. A resumed scrub
|
|
|
|
will continue from the last saved position.
|
2016-07-14 21:35:26 +00:00
|
|
|
|
2014-04-02 08:29:17 +00:00
|
|
|
SUBCOMMAND
|
|
|
|
----------
|
2015-01-03 01:22:10 +00:00
|
|
|
*cancel* <path>|<device>::
|
2016-11-18 13:51:15 +00:00
|
|
|
If a scrub is running on the filesystem identified by 'path' cancel it.
|
2015-01-03 01:22:10 +00:00
|
|
|
+
|
2016-05-06 10:42:21 +00:00
|
|
|
If a 'device' is specified, the corresponding filesystem is found and
|
|
|
|
*btrfs scrub cancel* behaves as if it was called on that filesystem.
|
2015-01-03 01:22:10 +00:00
|
|
|
|
|
|
|
*resume* [-BdqrR] [-c <ioprio_class> -n <ioprio_classdata>] <path>|<device>::
|
2016-05-06 10:42:21 +00:00
|
|
|
Resume a cancelled or interrupted scrub on the filesystem identified by
|
|
|
|
'path' or on a given 'device'.
|
2015-01-03 01:22:10 +00:00
|
|
|
+
|
|
|
|
Does not start a new scrub if the last scrub finished successfully.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
see *scrub start*.
|
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*start* [-BdqrRf] [-c <ioprio_class> -n <ioprio_classdata>] <path>|<device>::
|
2016-05-06 10:42:21 +00:00
|
|
|
Start a scrub on all devices of the filesystem identified by 'path' or on
|
|
|
|
a single 'device'. If a scrub is already running, the new one fails.
|
2014-04-02 08:29:17 +00:00
|
|
|
+
|
|
|
|
Without options, scrub is started as a background process.
|
|
|
|
+
|
|
|
|
The default IO priority of scrub is the idle class. The priority can be
|
|
|
|
configured similar to the `ionice`(1) syntax using '-c' and '-n' options.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-B::::
|
2016-05-06 10:42:21 +00:00
|
|
|
do not background and print scrub statistics when finished
|
2014-04-02 08:29:17 +00:00
|
|
|
-d::::
|
2016-07-14 21:35:26 +00:00
|
|
|
print separate statistics for each device of the filesystem ('-B' only) at the end
|
2014-04-02 08:29:17 +00:00
|
|
|
-q::::
|
2016-05-06 10:42:21 +00:00
|
|
|
be quiet, omit error messages and statistics
|
2014-04-02 08:29:17 +00:00
|
|
|
-r::::
|
2016-07-14 21:35:26 +00:00
|
|
|
run in read-only mode, do not attempt to correct anything, can be run on a read-only
|
2016-05-06 10:42:21 +00:00
|
|
|
filesystem
|
2014-04-02 08:29:17 +00:00
|
|
|
-R::::
|
2018-09-03 03:07:07 +00:00
|
|
|
raw print mode, print full data instead of summary
|
2014-05-19 15:08:56 +00:00
|
|
|
-c <ioprio_class>::::
|
2016-05-06 10:42:21 +00:00
|
|
|
set IO priority class (see `ionice`(1) manpage)
|
2014-05-19 15:08:56 +00:00
|
|
|
-n <ioprio_classdata>::::
|
2016-05-06 10:42:21 +00:00
|
|
|
set IO priority classdata (see `ionice`(1) manpage)
|
2014-04-02 08:29:17 +00:00
|
|
|
-f::::
|
2016-05-06 10:42:21 +00:00
|
|
|
force starting new scrub even if a scrub is already running,
|
2016-07-14 21:35:26 +00:00
|
|
|
this can useful when scrub status file is damaged and reports a running
|
|
|
|
scrub although it is not, but should not normally be necessary
|
2014-04-02 08:29:17 +00:00
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*status* [-d] <path>|<device>::
|
2016-05-06 10:42:21 +00:00
|
|
|
Show status of a running scrub for the filesystem identified by 'path' or
|
|
|
|
for the specified 'device'.
|
2014-04-02 08:29:17 +00:00
|
|
|
+
|
2016-03-14 13:10:16 +00:00
|
|
|
If no scrub is running, show statistics of the last finished or cancelled scrub
|
2014-04-02 08:29:17 +00:00
|
|
|
for that filesystem or device.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-d::::
|
2016-05-06 10:42:21 +00:00
|
|
|
print separate statistics for each device of the filesystem
|
2014-04-02 08:29:17 +00:00
|
|
|
|
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
2014-09-19 01:49:59 +00:00
|
|
|
*btrfs scrub* returns a zero exit status if it succeeds. Non zero is
|
2016-09-23 21:51:57 +00:00
|
|
|
returned in case of failure:
|
|
|
|
|
|
|
|
1::::
|
|
|
|
scrub couldn't be performed
|
|
|
|
2::::
|
|
|
|
there is nothing to resume
|
|
|
|
3::::
|
|
|
|
scrub found uncorrectable errors
|
2014-04-02 08:29:17 +00:00
|
|
|
|
|
|
|
AVAILABILITY
|
|
|
|
------------
|
2014-05-19 16:04:26 +00:00
|
|
|
*btrfs* is part of btrfs-progs.
|
2014-04-02 08:29:17 +00:00
|
|
|
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
|
|
|
|
further details.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
`mkfs.btrfs`(8),
|
2016-07-14 21:35:26 +00:00
|
|
|
`ionice`(1)
|