btrfs-check(8) check or repair an unmounted btrfs filesystem

SYNOPSIS

btrfs check [options] <device>

DESCRIPTION

btrfs check is used to check or repair an unmounted btrfs filesystem.


Note

Since btrfs is under development, the btrfs check capabilities are continuously enhanced. It's highly recommended to read the following btrfs wiki before executing btrfs check with --repair option: m[blue]https://btrfs.wiki.kernel.org/index.php/Btrfsckm[]

btrfsck is an alias of btrfs check command and is now deprecated.

OPTIONS

-s|--super <superblock>

use <superblock>th superblock copy, valid values are 0 up to 2 if the respective superblock offset is within the filesystem

-b|--backup

use the first backup roots stored in the superblock that is valid

--repair

try to repair the filesystem

--readonly

run in read-only mode (default)

--init-csum-tree

create a new CRC tree and recalculate all checksums

--init-extent-tree

create a new extent tree

--check-data-csum

verify checksums of data blocks

-p|--progress

indicate progress at various checking phases

--qgroup-report

verify qgroup accounting and compare against filesystem accounting

-E|--subvol-extents <subvolid>

show extent state for the given subvolume

-r|--tree-root <bytenr>

use the given bytenr for the tree root

--chunk-root <bytenr>

use the given bytenr for the chunk tree root

EXIT STATUS

btrfs check returns a zero exit status if it succeeds. Non zero is returned in case of failure.

AVAILABILITY

btrfs is part of btrfs-progs. Please refer to the btrfs wiki m[blue]http://btrfs.wiki.kernel.orgm[] for further details.