# xfs_metadump - man(8) - [phpMan]

[_xfs_metadump_(8)](https://www.chedong.com/phpMan.php/man/xfsmetadump/8/markdown)                        System Manager's Manual                       [_xfs_metadump_(8)](https://www.chedong.com/phpMan.php/man/xfsmetadump/8/markdown)

## NAME
       xfs_metadump - copy XFS filesystem metadata to a file

## SYNOPSIS
       **xfs_metadump **[ **-aefFgow **] [ **-m _**max_extents_ ] [ **-l _**logdev_ ] [ **-v _**version_ ] _source_ _target_
### xfs_metadump -V

## DESCRIPTION
       **xfs_metadump  **is  a debugging tool that copies the metadata from an XFS filesystem to a file.
       The _source_ argument must be the pathname of the device or file containing the XFS  filesystem
       and the _target_ argument specifies the destination file name.  If _target_ is -, then the output
       is  sent to stdout. This allows the output to be redirected to another program such as a com‐
       pression application.

       **xfs_metadump **may only be used to copy unmounted filesystems, or  read-only  mounted  filesys‐
       tems.

       **xfs_metadump  **does not alter the source filesystem in any way. The _target_ image is a contigu‐
       ous (non-sparse) file containing all the filesystem's  metadata  and  indexes  to  where  the
       blocks were copied from.

       By  default,  **xfs_metadump  **obfuscates  most file (regular file, directory and symbolic link)
       names and extended attribute names to allow the dumps to be sent without revealing  confiden‐
       tial information. Extended attribute values are zeroed and no data is copied. The only excep‐
       tions  are  file  or attribute names that are 4 or less characters in length. Also file names
       that span extents (this can only occur with the [**mkfs.xfs**(8)](https://www.chedong.com/phpMan.php/man/mkfs.xfs/8/markdown) options where **-n _**size_ > **-b  _**size_)
       are  not obfuscated. Names between 5 and 8 characters in length inclusively are partially ob‐
       fuscated.

       **xfs_metadump **cannot obfuscate metadata in the filesystem log.  Log recovery of an  obfuscated
       metadump  image  may expose clear-text metadata and/or cause filesystem corruption in the re‐
       stored image.  It is recommended that the source filesystem first be mounted  and  unmounted,
       if  possible,  to ensure that the log is clean.  A subsequent invocation of **xfs_metadump **will
       capture a clean log and obfuscate all metadata correctly.

       If a metadump must be produced from a filesystem with a dirty log, it is recommended that ob‐
       fuscation be turned off with -o option, if metadata such as filenames is not considered  sen‐
       sitive.  If obfuscation is required on a metadump with a dirty log, please inform the recipi‐
       ent of the metadump image about this situation.

       The contents of an external log device can be dumped only when using the v2 format.  Metadump
       in  v2 format can be generated by passing the "-v 2" option.  Metadump in v2 format is gener‐
       ated by default if the filesystem has an external log and the metadump version to use is  not
       explicitly mentioned.

       **xfs_metadump  **should  not  be  used  for  any purposes other than for debugging and reporting
       filesystem problems. The most common usage scenario for this tool is when [**xfs_repair**(8)](https://www.chedong.com/phpMan.php/man/xfsrepair/8/markdown) fails
       to repair a filesystem and a metadump image can be sent for analysis.

       The file generated by **xfs_metadump **can be restored to filesystem image (minus the data) using
       the [**xfs_mdrestore**(8)](https://www.chedong.com/phpMan.php/man/xfsmdrestore/8/markdown) tool.

## OPTIONS
### -a     
              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.

### -e     
              metadata that is accessible.

### -f     
              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 [**xfs_copy**(8)](https://www.chedong.com/phpMan.php/man/xfscopy/8/markdown).

### -F     
              the  source  is  truly not an XFS filesystem, the resulting image will be useless, and
              xfs_metadump may crash.

### -g     
              the _target_ is stdout.

### -l _
              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.

### -m     
              are likely to be corrupt, and will be skipped if they exceed this value.  The  default
              size is 2097151 blocks.

### -o     

### -v     
              fault metadump format is 1.

### -w     
              copied.

### -V     

## DIAGNOSTICS
       **xfs_metadump  **returns  an exit code of 0 if all readable metadata is successfully copied or 1
       if a write error occurs or a read error occurs and the **-e **option used.

## NOTES
       As **xfs_metadump **copies metadata only, it does not matter if the _source_ filesystem has a real‐
       time section or not. If the filesystem has an external log, it is not copied.  Internal  logs
       are copied and any outstanding log transactions are not obfuscated if they contain names.

       **xfs_metadump **is a shell wrapper around the [**xfs_db**(8)](https://www.chedong.com/phpMan.php/man/xfsdb/8/markdown) **metadump **command.

## SEE ALSO
       [**xfs_repair**(8)](https://www.chedong.com/phpMan.php/man/xfsrepair/8/markdown), [**xfs_mdrestore**(8)](https://www.chedong.com/phpMan.php/man/xfsmdrestore/8/markdown), [**xfs_freeze**(8)](https://www.chedong.com/phpMan.php/man/xfsfreeze/8/markdown), [**xfs_db**(8)](https://www.chedong.com/phpMan.php/man/xfsdb/8/markdown), [**xfs_copy**(8)](https://www.chedong.com/phpMan.php/man/xfscopy/8/markdown), [**xfs**(5)](https://www.chedong.com/phpMan.php/man/xfs/5/markdown)

## BUGS
       Email bug reports to **<linux-xfs@vger.kernel.org>**.

                                                                                     [_xfs_metadump_(8)](https://www.chedong.com/phpMan.php/man/xfsmetadump/8/markdown)
