LinuxCommandLibrary

btrfs-scrub

Verify data integrity on btrfs filesystems

TLDR

Start scrub

$ sudo btrfs scrub start path/to/mount
copy
Show status
$ sudo btrfs scrub status path/to/mount
copy
Cancel scrub
$ sudo btrfs scrub cancel path/to/mount
copy
Resume scrub
$ sudo btrfs scrub resume path/to/mount
copy
Start in foreground
$ sudo btrfs scrub start -B path/to/mount
copy
Start in quiet mode
$ sudo btrfs scrub start -q path/to/mount
copy

SYNOPSIS

btrfs scrub command [OPTIONS] path

DESCRIPTION

btrfs scrub verifies data integrity on btrfs filesystems by reading all data and metadata blocks and checking their checksums. It is recommended to run a scrub monthly to detect and potentially repair corrupted data.

PARAMETERS

start

Start a scrub operation
status
Show status of running or last completed scrub
cancel
Cancel a running scrub
resume
Resume a cancelled scrub
-B
Do not run in background (foreground mode)
-q, --quiet
Suppress errors and statistics output
-r
Read-only mode - do not attempt repairs

CAVEATS

Scrub can be I/O intensive and may impact system performance. On RAID configurations, scrub can repair errors from redundant copies. Single-disk setups can detect but not repair errors.

HISTORY

btrfs scrub is part of the btrfs-progs package, providing data integrity verification for btrfs filesystems.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community