{
    "mode": "man",
    "parameter": "xfs_metadump",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/xfs_metadump/8/json",
    "generated": "2026-10-07T19:24:54Z",
    "synopsis": "xfsmetadump [ -aefFgow ] [ -m maxextents ] [ -l logdev ] [ -v version ] source target",
    "sections": {
        "NAME": {
            "content": "xfsmetadump - copy XFS filesystem metadata to a file\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "xfsmetadump [ -aefFgow ] [ -m maxextents ] [ -l logdev ] [ -v version ] source target",
            "subsections": [
                {
                    "name": "xfs_metadump -V",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "xfsmetadump  is  a debugging tool that copies the metadata from an XFS filesystem to a file.\nThe source argument must be the pathname of the device or file containing the XFS  filesystem\nand the target argument specifies the destination file name.  If target is -, then the output\nis  sent to stdout. This allows the output to be redirected to another program such as a com‐\npression application.\n\nxfsmetadump may only be used to copy unmounted filesystems, or  read-only  mounted  filesys‐\ntems.\n\nxfsmetadump  does not alter the source filesystem in any way. The target image is a contigu‐\nous (non-sparse) file containing all the filesystem's  metadata  and  indexes  to  where  the\nblocks were copied from.\n\nBy  default,  xfsmetadump  obfuscates  most file (regular file, directory and symbolic link)\nnames and extended attribute names to allow the dumps to be sent without revealing  confiden‐\ntial information. Extended attribute values are zeroed and no data is copied. The only excep‐\ntions  are  file  or attribute names that are 4 or less characters in length. Also file names\nthat span extents (this can only occur with the mkfs.xfs(8) options where -n size > -b  size)\nare  not obfuscated. Names between 5 and 8 characters in length inclusively are partially ob‐\nfuscated.\n\nxfsmetadump cannot obfuscate metadata in the filesystem log.  Log recovery of an  obfuscated\nmetadump  image  may expose clear-text metadata and/or cause filesystem corruption in the re‐\nstored image.  It is recommended that the source filesystem first be mounted  and  unmounted,\nif  possible,  to ensure that the log is clean.  A subsequent invocation of xfsmetadump will\ncapture a clean log and obfuscate all metadata correctly.\n\nIf a metadump must be produced from a filesystem with a dirty log, it is recommended that ob‐\nfuscation be turned off with -o option, if metadata such as filenames is not considered  sen‐\nsitive.  If obfuscation is required on a metadump with a dirty log, please inform the recipi‐\nent of the metadump image about this situation.\n\nThe contents of an external log device can be dumped only when using the v2 format.  Metadump\nin  v2 format can be generated by passing the \"-v 2\" option.  Metadump in v2 format is gener‐\nated by default if the filesystem has an external log and the metadump version to use is  not\nexplicitly mentioned.\n\nxfsmetadump  should  not  be  used  for  any purposes other than for debugging and reporting\nfilesystem problems. The most common usage scenario for this tool is when xfsrepair(8) fails\nto repair a filesystem and a metadump image can be sent for analysis.\n\nThe file generated by xfsmetadump can be restored to filesystem image (minus the data) using\nthe xfsmdrestore(8) tool.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a",
                    "content": "terspersed  with  in-use  metadata.   Use this option to copy full metadata blocks, to\nprovide more debugging information for a corrupted filesystem.  Note  that  the  extra\ndata will be unobfuscated.\n",
                    "flag": "-a"
                },
                {
                    "name": "-e",
                    "content": "metadata that is accessible.\n",
                    "flag": "-e"
                },
                {
                    "name": "-f",
                    "content": "the  mkfs.xfs  -d  file option). This can also happen if an image copy of a filesystem\nhas been made into an ordinary file with xfscopy(8).\n",
                    "flag": "-f"
                },
                {
                    "name": "-F",
                    "content": "the  source  is  truly not an XFS filesystem, the resulting image will be useless, and\nxfsmetadump may crash.\n",
                    "flag": "-F"
                },
                {
                    "name": "-g",
                    "content": "the target is stdout.\n",
                    "flag": "-g"
                },
                {
                    "name": "-l _",
                    "content": "For  filesystems which use an external log, this specifies the device where the exter‐\nnal log resides.  If the v2 metadump format is selected, the contents of the  external\nlog will be copied to the metadump.  The v2 metadump format will be selected automati‐\ncally if this option is specified.\n",
                    "flag": "-l"
                },
                {
                    "name": "-m",
                    "content": "are likely to be corrupt, and will be skipped if they exceed this value.  The  default\nsize is 2097151 blocks.\n",
                    "flag": "-m"
                },
                {
                    "name": "-o",
                    "content": "",
                    "flag": "-o"
                },
                {
                    "name": "-v",
                    "content": "fault metadump format is 1.\n",
                    "flag": "-v"
                },
                {
                    "name": "-w",
                    "content": "copied.\n",
                    "flag": "-w"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "xfsmetadump  returns  an exit code of 0 if all readable metadata is successfully copied or 1\nif a write error occurs or a read error occurs and the -e option used.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "As xfsmetadump copies metadata only, it does not matter if the source filesystem has a real‐\ntime section or not. If the filesystem has an external log, it is not copied.  Internal  logs\nare copied and any outstanding log transactions are not obfuscated if they contain names.\n\nxfsmetadump is a shell wrapper around the xfsdb(8) metadump command.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "xfsrepair(8), xfsmdrestore(8), xfsfreeze(8), xfsdb(8), xfscopy(8), xfs(5)\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Email bug reports to linux-xfs@vger.kernel.org.\n\nxfsmetadump(8)",
            "subsections": []
        }
    },
    "summary": "xfsmetadump - copy XFS filesystem metadata to a file",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "terspersed with in-use metadata. Use this option to copy full metadata blocks, to provide more debugging information for a corrupted filesystem. Note that the extra data will be unobfuscated."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "metadata that is accessible."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "the mkfs.xfs -d file option). This can also happen if an image copy of a filesystem has been made into an ordinary file with xfscopy(8)."
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "the source is truly not an XFS filesystem, the resulting image will be useless, and xfsmetadump may crash."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "the target is stdout."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "For filesystems which use an external log, this specifies the device where the exter‐ nal log resides. If the v2 metadump format is selected, the contents of the external log will be copied to the metadump. The v2 metadump format will be selected automati‐ cally if this option is specified."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "are likely to be corrupt, and will be skipped if they exceed this value. The default size is 2097151 blocks."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "fault metadump format is 1."
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": "copied."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "xfsrepair",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsrepair/8/json"
        },
        {
            "name": "xfsmdrestore",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsmdrestore/8/json"
        },
        {
            "name": "xfsfreeze",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsfreeze/8/json"
        },
        {
            "name": "xfsdb",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsdb/8/json"
        },
        {
            "name": "xfscopy",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfscopy/8/json"
        },
        {
            "name": "xfs",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/xfs/5/json"
        }
    ]
}