{
    "mode": "info",
    "parameter": "btrfs-scrub",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/btrfs-scrub/json",
    "generated": "2026-07-05T11:49:06Z",
    "synopsis": "btrfs scrub <subcommand> <args>",
    "sections": {
        "NAME": {
            "content": "btrfs-scrub - scrub btrfs filesystem, verify block checksums\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "btrfs scrub <subcommand> <args>\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "btrfs scrub is used to scrub a mounted btrfs filesystem, which will\nread all data and metadata blocks from all devices and verify\nchecksums. Automatically repair corrupted blocks if there's a correct\ncopy available.\n\nNote\nScrub is not a filesystem checker (fsck) and does not verify nor\nrepair structural damage in the filesystem. It really only checks\nchecksums of data and tree blocks, it doesn't ensure the content of\ntree blocks is valid and consistent. There's some validation\nperformed when metadata blocks are read from disk but it's not\nextensive and cannot substitute full btrfs check run.\n\nThe user is supposed to run it manually or via a periodic system\nservice. The recommended period is a month but could be less. The\nestimated device bandwidth utilization is about 80% on an idle\nfilesystem. The IO priority class is by default idle so background\nscrub should not significantly interfere with normal filesystem\noperation. The IO scheduler set for the device(s) might not support the\npriority classes though.\n\nThe scrubbing status is recorded in /var/lib/btrfs/ in textual files\nnamed scrub.status.UUID for a filesystem identified by the given UUID.\n(Progress state is communicated through a named pipe in file\nscrub.progress.UUID in the same directory.) The status file is updated\nevery 5 seconds. A resumed scrub will continue from the last saved\nposition.\n\nScrub can be started only on a mounted filesystem, though it's possible\nto scrub only a selected device. See scrub start for more.\n",
            "subsections": []
        },
        "SUBCOMMAND": {
            "content": "cancel <path>|<device>\nIf a scrub is running on the filesystem identified by path or\ndevice, cancel it.\n\nIf a device is specified, the corresponding filesystem is found and\nbtrfs scrub cancel behaves as if it was called on that filesystem.\nThe progress is saved in the status file so btrfs scrub resume can\ncontinue from the last position.\n\nresume [-BdqrR] [-c <ioprioclass> -n <ioprioclassdata>]\n<path>|<device>\nResume a cancelled or interrupted scrub on the filesystem\nidentified by path or on a given device. The starting point is read\nfrom the status file if it exists.\n\nThis does not start a new scrub if the last scrub finished\nsuccessfully.\n\nOptions\n\nsee scrub start.\n\nstart [-BdqrRf] [-c <ioprioclass> -n <ioprioclassdata>]\n<path>|<device>\nStart a scrub on all devices of the mounted filesystem identified\nby path or on a single device. If a scrub is already running, the\nnew one will not start. A device of an unmounted filesystem cannot\nbe scrubbed this way.\n\nWithout options, scrub is started as a background process. The\nautomatic repairs of damaged copies is performed by default for\nblock group profiles with redundancy.\n\nThe default IO priority of scrub is the idle class. The priority\ncan be configured similar to the ionice(1) syntax using -c and -n\noptions. Note that not all IO schedulers honor the ionice settings.\n\nOptions\n\n-B\ndo not background and print scrub statistics when finished\n\n-d\nprint separate statistics for each device of the filesystem (-B\nonly) at the end\n\n-r\nrun in read-only mode, do not attempt to correct anything, can\nbe run on a read-only filesystem\n\n-R\nraw print mode, print full data instead of summary\n\n-c <ioprioclass>\nset IO priority class (see ionice(1) manpage)\n\n-n <ioprioclassdata>\nset IO priority classdata (see ionice(1) manpage)\n\n-f\nforce starting new scrub even if a scrub is already running,\nthis can useful when scrub status file is damaged and reports a\nrunning scrub although it is not, but should not normally be\nnecessary\n\n-q\n(deprecated) alias for global -q option\n\nstatus [options] <path>|<device>\nShow status of a running scrub for the filesystem identified by\npath or for the specified device.\n\nIf no scrub is running, show statistics of the last finished or\ncancelled scrub for that filesystem or device.\n\nOptions\n\n-d\nprint separate statistics for each device of the filesystem\n\n-R\nprint all raw statistics without postprocessing as returned by\nthe status ioctl\n\n--raw\nprint all numbers raw values in bytes without the B suffix\n\n--human-readable\nprint human friendly numbers, base 1024, this is the default\n\n--iec\nselect the 1024 base for the following options, according to\nthe IEC standard\n\n--si\nselect the 1000 base for the following options, according to\nthe SI standard\n\n--kbytes\nshow sizes in KiB, or kB with --si\n\n--mbytes\nshow sizes in MiB, or MB with --si\n\n--gbytes\nshow sizes in GiB, or GB with --si\n\n--tbytes\nshow sizes in TiB, or TB with --si\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "btrfs scrub returns a zero exit status if it succeeds. Non zero is\nreturned in case of failure:\n\n1\nscrub couldn't be performed\n\n2\nthere is nothing to resume\n\n3\nscrub found uncorrectable errors\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "btrfs is part of btrfs-progs. Please refer to the btrfs wiki\nhttp://btrfs.wiki.kernel.org for further details.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "mkfs.btrfs(8), ionice(1)\n\nBtrfs v5.16.2                     02/16/2022                    BTRFS-SCRUB(8)",
            "subsections": []
        }
    },
    "summary": "btrfs-scrub - scrub btrfs filesystem, verify block checksums",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "mkfs.btrfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/json"
        },
        {
            "name": "ionice",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ionice/1/json"
        },
        {
            "name": "BTRFS-SCRUB",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/BTRFS-SCRUB/8/json"
        }
    ]
}