{
    "mode": "man",
    "parameter": "cache_check",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/cache_check/8/json",
    "generated": "2026-06-12T02:35:08Z",
    "synopsis": "cachecheck [options] {device|file}",
    "sections": {
        "NAME": {
            "content": "cachecheck - validates cache metadata on a device or file.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "cachecheck [options] {device|file}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "cachecheck  checks  cache  metadata created by the device-mapper cache target on a device or\nfile.\n\nThis tool cannot be run on live metadata.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h, --help",
                    "content": "Print help and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V, --version",
                    "content": "Output version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-q, --quiet",
                    "content": "Suppress output messages, return only exit code.\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "--super-block-only",
                    "content": "Only check the superblock.\n",
                    "long": "--super-block-only"
                },
                {
                    "name": "--skip-hints",
                    "content": "Skip checking of the policy hint values metadata.\n",
                    "long": "--skip-hints"
                },
                {
                    "name": "--skip-discards",
                    "content": "Skip checking of the discard bits in the metadata.\n",
                    "long": "--skip-discards"
                },
                {
                    "name": "--clear-needs-check-flag",
                    "content": "Clears the 'needscheck' flag in the superblock.\n\nThe kernel may set a flag to force the pool to be checked before it's next\nactivated.  Set this switch to clear the flag if the check is successful.\nIf the metadata check failed, the flag is not cleared and a cacherepair run\nis needed to fix any issues. After cacherepair succeeded, you may run\ncachecheck again.\n\n",
                    "long": "--clear-needs-check-flag"
                }
            ]
        },
        "EXAMPLE": {
            "content": "Analyses and repairs cache metadata on logical volume /dev/vg/metadata:\n\n$ cachecheck /dev/vg/metadata\n\nThe device may not be actively used by the target when running.\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "cachecheck returns an exit code of 0 for success or 1 for error.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "cachedump(8), cacherepair(8), cacherestore(8)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Joe Thornber <ejt@redhat.com>, Heinz Mauelshagen <HeinzM@RedHat.com>\n\n\n\nSystem Manager's Manual                  Device Mapper Tools                          cachecheck(8)",
            "subsections": []
        }
    },
    "summary": "cachecheck - validates cache metadata on a device or file.",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print help and exit."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Output version information and exit."
        },
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": "Suppress output messages, return only exit code."
        },
        {
            "flag": "",
            "long": "--super-block-only",
            "arg": null,
            "description": "Only check the superblock."
        },
        {
            "flag": "",
            "long": "--skip-hints",
            "arg": null,
            "description": "Skip checking of the policy hint values metadata."
        },
        {
            "flag": "",
            "long": "--skip-discards",
            "arg": null,
            "description": "Skip checking of the discard bits in the metadata."
        },
        {
            "flag": "",
            "long": "--clear-needs-check-flag",
            "arg": null,
            "description": "Clears the 'needscheck' flag in the superblock. The kernel may set a flag to force the pool to be checked before it's next activated. Set this switch to clear the flag if the check is successful. If the metadata check failed, the flag is not cleared and a cacherepair run is needed to fix any issues. After cacherepair succeeded, you may run cachecheck again."
        }
    ],
    "examples": [
        "Analyses and repairs cache metadata on logical volume /dev/vg/metadata:",
        "$ cachecheck /dev/vg/metadata",
        "The device may not be actively used by the target when running."
    ],
    "see_also": [
        {
            "name": "cachedump",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/cachedump/8/json"
        },
        {
            "name": "cacherepair",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/cacherepair/8/json"
        },
        {
            "name": "cacherestore",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/cacherestore/8/json"
        }
    ]
}