2021-01-07 11:06:18 +00:00
|
|
|
# btrfs scrub
|
|
|
|
|
|
|
|
> Scrub btrfs filesystems to verify data integrity.
|
|
|
|
> It is recommended to run a scrub once a month.
|
2022-11-15 11:50:15 +00:00
|
|
|
> More information: <https://btrfs.readthedocs.io/en/latest/btrfs-scrub.html>.
|
2021-01-07 11:06:18 +00:00
|
|
|
|
|
|
|
- Start a scrub:
|
|
|
|
|
2025-07-20 01:28:02 +03:00
|
|
|
`sudo btrfs {{[sc|scrub]}} start {{path/to/btrfs_mount}}`
|
2021-01-07 11:06:18 +00:00
|
|
|
|
|
|
|
- Show the status of an ongoing or last completed scrub:
|
|
|
|
|
2025-07-20 01:28:02 +03:00
|
|
|
`sudo btrfs {{[sc|scrub]}} status {{path/to/btrfs_mount}}`
|
2021-01-07 11:06:18 +00:00
|
|
|
|
|
|
|
- Cancel an ongoing scrub:
|
|
|
|
|
2025-07-20 01:28:02 +03:00
|
|
|
`sudo btrfs {{[sc|scrub]}} {{[c|cancel]}} {{path/to/btrfs_mount}}`
|
2021-01-07 11:06:18 +00:00
|
|
|
|
|
|
|
- Resume a previously cancelled scrub:
|
|
|
|
|
2025-07-20 01:28:02 +03:00
|
|
|
`sudo btrfs {{[sc|scrub]}} {{[r|resume]}} {{path/to/btrfs_mount}}`
|
2021-01-07 11:06:18 +00:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
- Start a scrub, but do not put the program in the [B]ackground:
|
2021-01-07 11:06:18 +00:00
|
|
|
|
2025-07-20 01:28:02 +03:00
|
|
|
`sudo btrfs {{[sc|scrub]}} start -B {{path/to/btrfs_mount}}`
|
2021-01-07 11:06:18 +00:00
|
|
|
|
|
|
|
- Start a scrub in quiet mode (does not print errors or statistics):
|
|
|
|
|
2025-07-20 01:28:02 +03:00
|
|
|
`sudo btrfs {{[sc|scrub]}} start {{[-q|--quiet]}} {{path/to/btrfs_mount}}`
|