'\" t
.\" Title: btrfs-scrub
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1
.\" Date: 11/22/2014
.\" Manual: Btrfs Manual
.\" Source: Btrfs v3.17
.\" Language: English
.\"
.TH "BTRFS\-SCRUB" "8" "11/22/2014" "Btrfs v3\&.17" "Btrfs Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
btrfs-scrub \- scrub btrfs filesystem
.SH "SYNOPSIS"
.sp
\fBbtrfs scrub\fR \fI\fR \fI\fR
.SH "DESCRIPTION"
.sp
\fBbtrfs scrub\fR is used to scrub a btrfs filesystem, which will reading all data from all disks and verifying checksums\&.
.SH "SUBCOMMAND"
.PP
\fBstart\fR [\-BdqrRf] [\-c \fI\fR \-n \fI\fR] \fI\fR|\fI\fR
.RS 4
Start a scrub on all devices of the filesystem identified by
\fI\fR
or on a single
\fI\fR\&. If a scrub is already running, the new one fails\&.
.sp
Without options, scrub is started as a background process\&. Progress can be obtained with the
\fBscrub status\fR
command\&. Scrubbing involves reading all data from all disks and verifying checksums\&. Errors are corrected along the way if possible\&.
.sp
The default IO priority of scrub is the idle class\&. The priority can be configured similar to the
\fBionice\fR(1) syntax using
\fI\-c\fR
and
\fI\-n\fR
options\&.
.sp
\fBOptions\fR
.PP
\-B
.RS 4
Do not background and print scrub statistics when finished\&.
.RE
.PP
\-d
.RS 4
Print separate statistics for each device of the filesystem (\-B only)\&.
.RE
.PP
\-q
.RS 4
Quiet\&. Omit error messages and statistics\&.
.RE
.PP
\-r
.RS 4
Read only mode\&. Do not attempt to correct anything\&.
.RE
.PP
\-R
.RS 4
Raw print mode\&. Print full data instead of summary\&.
.RE
.PP
\-c \fI\fR
.RS 4
Set IO priority class (see ionice (1) manpage)\&.
.RE
.PP
\-n \fI\fR
.RS 4
Set IO priority classdata (see
\fBionice\fR(1) manpage)\&.
.RE
.PP
\-f
.RS 4
Force starting new scrub even if a scrub is already running\&. This is useful when scrub stat record file is damaged\&.
.RE
.RE
.PP
\fBcancel\fR \fI\fR|\fI\fR
.RS 4
If a scrub is running on the filesystem identified by
\fI\fR, cancel it\&.
.sp
Progress is saved in the scrub progress file and scrubbing can be resumed later using the scrub resume command\&. If a
\fI\fR
is given, the corresponding filesystem is found and scrub cancel behaves as if it was called on that filesystem\&.
.RE
.PP
\fBresume\fR [\-BdqrR] [\-c \fI\fR \-n \fI\fR] \fI\fR|\fI\fR
.RS 4
Resume a canceled or interrupted scrub cycle on the filesystem identified by
\fI\fR
or on a given
\fI\fR\&.
.sp
Does not start a new scrub if the last scrub finished successfully\&.
.sp
\fBOptions\fR
.sp
see
\fBscrub start\fR\&.
.RE
.PP
\fBstatus\fR [\-d] \fI\fR|\fI\fR
.RS 4
Show status of a running scrub for the filesystem identified by
\fI\fR
or for the specified
\fI\fR\&.
.sp
If no scrub is running, show statistics of the last finished or canceled scrub for that filesystem or device\&.
.sp
\fBOptions\fR
.PP
\-d
.RS 4
Print separate statistics for each device of the filesystem\&.
.RE
.RE
.SH "EXIT STATUS"
.sp
\fBbtrfs scrub\fR returns a zero exit status if it succeeds\&. Non zero is returned in case of failure\&.
.SH "AVAILABILITY"
.sp
\fBbtrfs\fR is part of btrfs\-progs\&. Please refer to the btrfs wiki \m[blue]\fBhttp://btrfs\&.wiki\&.kernel\&.org\fR\m[] for further details\&.
.SH "SEE ALSO"
.sp
\fBmkfs\&.btrfs\fR(8),