BTRFS-CHECK(8)
π btrfs-check(8) β the vibe check for your filesystem π
okay bestie, so this is btrfs-check from section 8 of the manuals (that's the sysadmin-y one, iykyk). Buckle up, she's thorough. π¦
β¨ NAME β¨
btrfs-check β check or repair a btrfs filesystem. literally the structural integrity inspector of the btrfs world π
πΈ SYNOPSIS πΈ
btrfs check [options] <device>
π DESCRIPTION π
The filesystem checker is that girl who walks around verifying the structural integrity of a filesystem and, if you ask her nicely, attempts to repair it. It is recommended that you unmount the filesystem before running the check, but lowkey it is possible to start checking a mounted filesystem (see --force β she's got receipts).
By default, btrfs check will not modify the device, but you can reaffirm that whole situation with the option --readonly, because sometimes we need reassurance and that's valid. π«Ά
btrfsck is an alias of the btrfs check command, and it is now deprecated. rip bestie, she had a good run. π
Note: Even though the filesystem checker requires a device argument, it scans for all devices belonging to the same filesystem, so it should not cause a difference using different devices of the same filesystem. Furthermore btrfs-check(8) will automatically choose the good mirror, so as long as there is a good copy for metadata, it will not report such case as an error. she's merciful like that β¨
Warning: Do not use --repair unless you are advised to do so by a developer or an experienced user, and then only after having accepted that no fsck successfully repairs all types of filesystem corruption. E.g. some other software or hardware bugs can fatally damage a volume. no cap, this is the real deal π
The structural integrity check verifies if internal filesystem objects or data structures satisfy the constraints, point to the right objects, or are correctly connected together. it's giving group project attendance check, but for data structures.
There are several cross checks that can detect wrong reference counts of shared extents, backreferences, missing extents of inodes, directory and inode connectivity etc. so many little checks, all obsessed with accuracy π
The amount of memory required can be high, depending on the size of the filesystem, and similarly the run time. Check the modes β those can also affect that. plan your snack break accordingly. π
π SAFE OR ADVISORY OPTIONS π
-b,--backupβ use the first valid set of backup roots stored in the superblock. this can be combined with--superif some of the superblocks are damaged. teamwork makes the dream work π«Ά--check-data-csumβ verify checksums of data blocks. this expects that the filesystem is otherwise OK, and is basically an offline scrub that does not repair data from spare copies. icon behaviour, zero drama.--skip-qgroup-accountingβ skip verification of qgroup referenced/exclusive accounting. qgroup status, info and relation items are still loaded from the quota tree. this option cannot be used with--repairor--qgroup-report. this can significantly reduce runtime on filesystems with many snapshots or reflinked files, as full qgroup accounting verification can require extensive backref walks. it's giving shortcut but make it legit β¨--chunk-root <bytenr>β use the given offset bytenr for the chunk tree root.-E,--subvol-extents <subvolid>β show extent state for the given subvolume. cute lil peek behind the curtain π--mode <MODE>β select mode of operation regarding memory and IO. the MODE can be one of:originalβ the metadata are read into memory and verified, thus the requirements are high on large filesystems and can even lead to out-of-memory conditions. the possible workaround is to export the block device over network to a machine with enough memory. girl needs her RAM, ok?? πlowmemβ this mode is supposed to address the high memory consumption at the cost of increased IO when it needs to re-read blocks. this may increase run time. trade-offs are so real.
-p,--progressβ indicate progress at various checking phases. we love a loading bar, the anticipation is everything π-Q,--qgroup-reportβ verify qgroup accounting and compare against filesystem accounting. receipts vs receipts π-r,--tree-root <bytenr>β use the given offsetbytenrfor the tree root.--readonlyβ (default) run in read-only mode. this option exists to calm potential panic when users are going to run the checker. it's the emotional support flag, honestly. π«Ά-s,--super <N>β use the *N*th superblock copy. valid values are0,1or2if the respective superblock offset is within the device size. this can be used to use a different starting point if some of the primary superblock is damaged. backups saving the day, as per usual β
π₯ DANGEROUS OPTIONS π₯
okay this is the section where I need you to hold my hand and read carefully. these are not a joke. π
--repairβ enable the repair mode and attempt to fix problems where possible.
Note: There's a warning and 10 second delay when this option is run without --force to give users a chance to think twice before running repair β the warnings in documentation have shown to be insufficient. ten whole seconds to reconsider your life choices. use them. π
Note: Please finish/cancel the runningreplace/balancebefore using this command. do not multitask here, bestie, it will not end well.
--init-csum-treeβ create a new checksum tree and recalculate checksums in all files.
Warning: Do not blindly use this option to fix checksum mismatch problems. read first, click later π
--init-extent-treeβ build the extent tree from scratch.
Warning: Do not use unless you know what you're doing. and "I skimmed the manpage" does not count as knowing what you're doing, respectfully.
--forceβ allow work on a mounted filesystem and skip mount checks. Note that this should work fine on a quiescent or read-only mounted filesystem but may crash if the device is changed externally, e.g. by the kernel module.
Note: It is possible to run with --repair but on a mounted filesystem β that will most likely lead to a corruption unless the filesystem is in a quiescent state, which may not be possible to guarantee. again: no cap.
This option also skips the delay and warning in the repair mode (see --repair). she skips the line AND the safety briefing, main character energy but make it risky π
π¦ DEPRECATED OR REMOVED OPTIONS π¦
--clear-space-cache v1|v2β completely remove the free space cache of the given version. see also theclear_cachemount option.
Warning: This option is deprecated, please use btrfs rescue clear-space-cache instead β this option would be removed in the future eventually. she's on her way out, send her off gently π
π EXIT STATUS π
btrfs check returns a zero exit status if it succeeds. Non zero is returned in case of failure. so 0 = slay, anything else = we have a situation. π
β AVAILABILITY β
btrfs is part of btrfs-progs. Please refer to the documentation at <https://btrfs.readthedocs.io>. the docs are there, go read them, I believe in you π«Ά
πΈ SEE ALSO πΈ
mkfs.btrfs(8), btrfs-scrub(8), btrfs-rescue(8). the whole friend group, honestly. all iconic, all doing different jobs, all necessary π
and that's the whole page babes β¨ this was btrfs-check(8) from btrfs-progs version 7.3, dated Oct 24, 2026. go forth, check your filesystems, and please, please think twice before --repair. love u, bye ππ·
π¦ where this page comes from
- arch rolling: btrfs-progs 7.3-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms