{
    "mode": "man",
    "parameter": "btrfs-rescue",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/btrfs-rescue/8/json",
    "generated": "2026-09-17T04:42:07Z",
    "synopsis": "btrfs rescue <subcommand> <args>",
    "sections": {
        "NAME": {
            "content": "btrfs-rescue - recover a damaged btrfs filesystem\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "btrfs rescue <subcommand> <args>\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "btrfs rescue is used to try to recover a damaged btrfs filesystem.\n",
            "subsections": []
        },
        "SUBCOMMAND": {
            "content": "",
            "subsections": [
                {
                    "name": "chunk-recover [options] <device>",
                    "content": "Recover the chunk tree by scanning the devices\n\nOptions\n\n-y     assume an answer of yes to all questions.\n\n-h     help.\n"
                },
                {
                    "name": "-v     (deprecated)",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "NOTE:",
                    "content": "Since  chunk-recover  will scan the whole device, it will be very slow especially executed\non a large device.\n"
                },
                {
                    "name": "fix-device-size <device>",
                    "content": "fix device size and super block total bytes values that do not match\n\nKernel 4.11 starts to check the device size more strictly and this might mismatch  the\nstored  value  of  total  bytes. See the exact error message below.  Newer kernel will\nrefuse to mount the filesystem where the values do not match.  This error is not fatal\nand can be fixed.  This command will fix the device size values if possible.\n\nBTRFS error (device sdb): supertotalbytes 92017859088384 mismatch with fsdevices totalrwbytes 92017859094528\n\nThe mismatch may also exhibit as a kernel warning:\n\nWARNING: CPU: 3 PID: 439 at fs/btrfs/ctree.h:1559 btrfsupdatedevice+0x1c5/0x1d0 [btrfs]\n"
                },
                {
                    "name": "clear-ino-cache <device>",
                    "content": "Remove leftover items pertaining to the deprecated inode cache feature.\n\nThe inode cache feature (enabled by mount option \"inodecache\")  has  been  completely\nremoved in 5.11 kernel.\n"
                },
                {
                    "name": "clear-space-cache <v1|v2> <device>",
                    "content": "Completely remove the on-disk data of free space cache of given version.\n\nEspecially  for  v1  free  space cache, clearcache mount option would only remove the\ncache for updated block groups, the remaining would not be removed.  Thus this command\nis provided to manually clear the free space cache.\n"
                },
                {
                    "name": "clear-uuid-tree <device>",
                    "content": "Clear UUID tree, so that kernel can re-generate it at next read-write mount.\n\nSince kernel v4.16 there are more sanity check performed, and  sometimes  non-critical\ntrees  like UUID tree can cause problems and reject the mount.  In such case, clearing\nUUID tree may make the filesystem to be mountable again  without  much  risk  as  it's\nbuilt from other trees.\n"
                },
                {
                    "name": "super-recover [options] <device>",
                    "content": "Recover bad superblocks from good copies.\n\nOptions\n\n-y     assume an answer of yes to all questions.\n"
                },
                {
                    "name": "-v     (deprecated)",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "zero-log <device>",
                    "content": "clear the filesystem log tree\n\nThis  command will clear the filesystem log tree. This may fix a specific set of prob‐\nlem when the filesystem mount fails due to the log replay. See below for sample  stack\ntraces that may show up in system log.\n\nThe  common  case where this happens was fixed a long time ago, so it is unlikely that\nyou will see this particular problem, but the command is kept around.\n\nNOTE:\nClearing the log may lead to loss of changes that were made since the last transac‐\ntion commit. This may be up to 30 seconds (default commit period) or  less  if  the\ncommit was implied by other filesystem activity.\n\nOne can determine whether zero-log is needed according to the kernel backtrace:\n\n? replayonediritem+0xb5/0xb5 [btrfs]\n? walklogtree+0x9c/0x19d [btrfs]\n? btrfsreadfsrootnoradix+0x169/0x1a1 [btrfs]\n? btrfsrecoverlogtrees+0x195/0x29c [btrfs]\n? replayonediritem+0xb5/0xb5 [btrfs]\n? btreereadextentbufferpages+0x76/0xbc [btrfs]\n? openctree+0xff6/0x132c [btrfs]\n\nIf  the  errors  are like above, then zero-log should be used to clear the log and the\nfilesystem may be mounted normally again. The keywords to look  for  are  'openctree'\nwhich  says  that it's during mount and function names that contain replay, recover or\nlogtree.\n"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "btrfs rescue 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": "btrfs-check(8), btrfs-scrub(8), mkfs.btrfs(8)\n\n\n6.6.3                                       Mar 31, 2024                             BTRFS-RESCUE(8)",
            "subsections": []
        }
    },
    "summary": "btrfs-rescue - recover a damaged btrfs filesystem",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "btrfs-check",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/btrfs-check/8/json"
        },
        {
            "name": "btrfs-scrub",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/btrfs-scrub/8/json"
        },
        {
            "name": "mkfs.btrfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/json"
        },
        {
            "name": "BTRFS-RESCUE",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/BTRFS-RESCUE/8/json"
        }
    ]
}