{
    "mode": "man",
    "parameter": "BTRFS-CHECK",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/BTRFS-CHECK/8/json",
    "generated": "2026-09-10T08:26:33Z",
    "synopsis": "btrfs check [options] <device>",
    "sections": {
        "NAME": {
            "content": "btrfs-check - check or repair a btrfs filesystem\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "btrfs check [options] <device>\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  filesystem checker is used to verify structural integrity of a filesystem and attempt to\nrepair it if requested.  It is recommended to unmount the filesystem  prior  to  running  the\ncheck, but it is possible to start checking a mounted filesystem (see --force).\n\nBy  default,  btrfs  check will not modify the device but you can reaffirm that by the option\n--readonly.\n\nbtrfsck is an alias of btrfs check command and is now deprecated.\n",
            "subsections": [
                {
                    "name": "WARNING:",
                    "content": "Do not use --repair unless you are advised to do so by a developer or an experienced user,\nand then only after having accepted that no fsck successfully repair all types of filesys‐\ntem corruption. E.g. some other software or hardware bugs can fatally damage a volume.\n\nThe structural integrity check verifies if internal filesystem  objects  or  data  structures\nsatisfy the constraints, point to the right objects or are correctly connected together.\n\nThere  are  several  cross  checks  that can detect wrong reference counts of shared extents,\nbackreferences, missing extents of inodes, directory and inode connectivity etc.\n\nThe amount of memory required can be high, depending on the size of the filesystem, similarly\nthe run time. Check the modes that can also affect that.\n"
                }
            ]
        },
        "SAFE OR ADVISORY OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-b|--backup",
                    "content": "use the first valid set of backup roots stored in the superblock\n\nThis can be combined with --super if some of the superblocks are damaged.\n"
                },
                {
                    "name": "--check-data-csum",
                    "content": "verify checksums of data blocks\n\nThis expects that the filesystem is otherwise OK, and is basically  an  offline  scrub\nthat does not repair data from spare copies.\n\n--chunk-root <bytenr>\nuse the given offset bytenr for the chunk tree root\n",
                    "long": "--check-data-csum"
                },
                {
                    "name": "-E|--subvol-extents <subvolid>",
                    "content": "show extent state for the given subvolume\n\n--mode <MODE>\nselect mode of operation regarding memory and IO\n\nThe MODE can be one of:\n\noriginal\nThe  metadata are read into memory and verified, thus the requirements are high\non large filesystems and can even lead to out-of-memory conditions.  The possi‐\nble workaround is to export the block device over network  to  a  machine  with\nenough memory.\n\nlowmem This mode is supposed to address the high memory consumption at the cost of in‐\ncreased IO when it needs to re-read blocks.  This may increase run time.\n"
                },
                {
                    "name": "-p|--progress",
                    "content": "indicate progress at various checking phases\n"
                },
                {
                    "name": "-Q|--qgroup-report",
                    "content": "verify qgroup accounting and compare against filesystem accounting\n"
                },
                {
                    "name": "-r|--tree-root <bytenr>",
                    "content": "use the given offset 'bytenr' for the tree root\n"
                },
                {
                    "name": "--readonly",
                    "content": "(default) run in read-only mode, this option exists to calm potential panic when users\nare going to run the checker\n",
                    "long": "--readonly"
                },
                {
                    "name": "-s|--super <N>",
                    "content": "use  Nth superblock copy, valid values are 0, 1 or 2 if the respective superblock off‐\nset is within the device size\n\nThis can be used to use a different starting point if some of the  primary  superblock\nis damaged.\n"
                },
                {
                    "name": "--clear-space-cache v1|v2",
                    "content": "completely remove the free space cache of the given version\n\nSee also the clearcache mount option.\n\nWARNING:\nThis  option is deprecated, please use btrfs rescue clear-space-cache instead, this\noption would be removed in the future eventually.\n",
                    "long": "--clear-space-cache"
                }
            ]
        },
        "DANGEROUS OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--repair",
                    "content": "enable the repair mode and attempt to fix problems where possible\n\nNOTE:\nThere's a warning and 10 second delay when this option is run  without  --force  to\ngive  users a chance to think twice before running repair, the warnings in documen‐\ntation have shown to be insufficient.\n",
                    "long": "--repair"
                },
                {
                    "name": "--init-csum-tree",
                    "content": "create a new checksum tree and recalculate checksums in all files\n\nWARNING:\nDo not blindly use this option to fix checksum mismatch problems.\n",
                    "long": "--init-csum-tree"
                },
                {
                    "name": "--init-extent-tree",
                    "content": "build the extent tree from scratch\n\nWARNING:\nDo not use unless you know what you're doing.\n",
                    "long": "--init-extent-tree"
                },
                {
                    "name": "--force",
                    "content": "allow work on a mounted filesystem and skip mount checks. Note that this  should  work\nfine  on  a  quiescent  or read-only mounted filesystem but may crash if the device is\nchanged externally, e.g. by the kernel module.\n\nNOTE:\nIt is possible to run with --repair but on a  mounted  filesystem  that  will  most\nlikely lead to a corruption unless the filesystem is in a quiescent state which may\nnot be possible to guarantee.\n\nThis option also skips the delay and warning in the repair mode (see --repair).\n",
                    "long": "--force"
                }
            ]
        },
        "DEPRECATED OR MOVED OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--clear-ino-cache",
                    "content": "(removed: 6.7)\n\nremove  leftover  items  pertaining  to the deprecated inode cache feature, please use\nbtrfs rescue clear-ino-cache instead\n",
                    "long": "--clear-ino-cache"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "btrfs check returns a zero exit status if it succeeds. Non zero is returned in case of  fail‐\nure.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "btrfs    is    part    of    btrfs-progs.     Please    refer   to   the   documentation   at\nhttps://btrfs.readthedocs.io.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "mkfs.btrfs(8), btrfs-scrub(8), btrfs-rescue(8)\n\n\n6.6.3                                       Mar 31, 2024                              BTRFS-CHECK(8)",
            "subsections": []
        }
    },
    "summary": "btrfs-check - check or repair a btrfs filesystem",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "mkfs.btrfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/json"
        },
        {
            "name": "btrfs-scrub",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/btrfs-scrub/8/json"
        },
        {
            "name": "btrfs-rescue",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/btrfs-rescue/8/json"
        }
    ]
}