{
    "mode": "man",
    "parameter": "thin_check",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/thin_check/8/json",
    "generated": "2026-06-16T01:00:34Z",
    "synopsis": "thincheck [options] {device|file}",
    "sections": {
        "NAME": {
            "content": "thincheck - validates thin provisioning metadata on a device or file\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "thincheck [options] {device|file}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "thincheck  checks  thin provisioning metadata created by the device-mapper thin provisioning\ntarget on a device or file.\n\nThe tool cannot be run on live metadata unless the --metadata-snapshot option is used.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-q, --quiet",
                    "content": "Suppress output messages, return only exit code.\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "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": "--super-block-only",
                    "content": "Only check the superblock.\n",
                    "long": "--super-block-only"
                },
                {
                    "name": "--skip-mappings",
                    "content": "Skip checking of the block mappings which make up the bulk of the metadata.\n",
                    "long": "--skip-mappings"
                },
                {
                    "name": "--ignore-non-fatal-errors",
                    "content": "Will only return a non-zero exit code if it finds a fatal error.\n\nAn example of a nonfatal error is an incorrect data block reference count\ncausing a block to be considered allocated when it in fact isn't.  Ignoring\nerrors for a long time is not advised, you really should be using\nthinrepair to fix them.\n\n",
                    "long": "--ignore-non-fatal-errors"
                },
                {
                    "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 thinrepair run\nis needed to fix any issues. After thinrepair succeeded, you may run\nthincheck again.\n\n",
                    "long": "--clear-needs-check-flag"
                },
                {
                    "name": "--metadata-snapshot, -m",
                    "content": "Check the metadata snapshot.\n\nThis will check the devices tree and mappings in a metadata snapshot.\nThe snap does not contain space maps, so these will not be checked.  This\nmay be used on live metadata.\n\n",
                    "flag": "-m",
                    "long": "--metadata-snapshot"
                },
                {
                    "name": "--auto-repair",
                    "content": "Automatically repair any trivial issues found with the metadata.\n\nCurrently only fixes metadata leaks.\n\n",
                    "long": "--auto-repair"
                },
                {
                    "name": "--override-mapping-root <block>",
                    "content": "Specify a mapping root to use.\n\nDon't use this.  This overrides what's specified in the superblock.  Only\nuse this if you really understand the metadata format and are trying to\nrecover damaged metadata.\n\n",
                    "long": "--override-mapping-root",
                    "arg": "<block>"
                }
            ]
        },
        "EXAMPLE": {
            "content": "Analyses thin provisioning metadata on logical volume /dev/vg/metadata:\n\n$ thincheck /dev/vg/metadata\n\nThe device must not be actively used by the target when running.\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "thincheck returns an exit code of 0 for success or 1 for error.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "thindump(8), thinrepair(8), thinrestore(8), thinrmap(8), thinmetadatasize(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                           thincheck(8)",
            "subsections": []
        }
    },
    "summary": "thincheck - validates thin provisioning metadata on a device or file",
    "flags": [
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": "Suppress output messages, return only exit code."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print help and exit."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Output version information and exit."
        },
        {
            "flag": "",
            "long": "--super-block-only",
            "arg": null,
            "description": "Only check the superblock."
        },
        {
            "flag": "",
            "long": "--skip-mappings",
            "arg": null,
            "description": "Skip checking of the block mappings which make up the bulk of the metadata."
        },
        {
            "flag": "",
            "long": "--ignore-non-fatal-errors",
            "arg": null,
            "description": "Will only return a non-zero exit code if it finds a fatal error. An example of a nonfatal error is an incorrect data block reference count causing a block to be considered allocated when it in fact isn't. Ignoring errors for a long time is not advised, you really should be using thinrepair to fix them."
        },
        {
            "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 thinrepair run is needed to fix any issues. After thinrepair succeeded, you may run thincheck again."
        },
        {
            "flag": "-m",
            "long": "--metadata-snapshot",
            "arg": null,
            "description": "Check the metadata snapshot. This will check the devices tree and mappings in a metadata snapshot. The snap does not contain space maps, so these will not be checked. This may be used on live metadata."
        },
        {
            "flag": "",
            "long": "--auto-repair",
            "arg": null,
            "description": "Automatically repair any trivial issues found with the metadata. Currently only fixes metadata leaks."
        },
        {
            "flag": "",
            "long": "--override-mapping-root",
            "arg": "<block>",
            "description": "Specify a mapping root to use. Don't use this. This overrides what's specified in the superblock. Only use this if you really understand the metadata format and are trying to recover damaged metadata."
        }
    ],
    "examples": [
        "Analyses thin provisioning metadata on logical volume /dev/vg/metadata:",
        "$ thincheck /dev/vg/metadata",
        "The device must not be actively used by the target when running."
    ],
    "see_also": [
        {
            "name": "thindump",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/thindump/8/json"
        },
        {
            "name": "thinrepair",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/thinrepair/8/json"
        },
        {
            "name": "thinrestore",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/thinrestore/8/json"
        },
        {
            "name": "thinrmap",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/thinrmap/8/json"
        },
        {
            "name": "thinmetadatasize",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/thinmetadatasize/8/json"
        }
    ]
}