xfs_copy
xfs_copy copies an XFS filesystem to one or more targets in parallel. The first (source) argument must be the pathname of the device or file containing the XFS filesystem. The remaining arguments specify one or more target devices or file names. If the pathnames specify devices, a copy of the source XFS filesystem is created on each device. The target can also be the name of a regular file, in which case an image of the source XFS filesystem is created in that file. If the file does not exist, xfs_copy creates the file. The length of the resulting file is equal to the size of the source filesystem. However, if the file is created on an XFS filesystem, the file consumes roughly the amount of space actually used in the source filesystem by the filesystem and the XFS log. The space saving is because xfs_copy seeks over free blocks instead of copying them and the XFS filesystem supports sparse files efficiently.[1]
xfs_copy should only be used to copy unmounted filesystems, read-only mounted filesystems, or frozen filesystems (see xfs_freeze). Otherwise, the generated filesystem(s) would be inconsistent or corrupt.[1]
Documentation
- man 8 'xfs_copy' [EN]
Syntax
xfs_copy [PARAMETER ...] SOURCE TARGET1 [TARGET2 ...]
Parameters
- -b
- The buffered option can be used to ensure direct IO is not attempted to any of the target files. This is useful when the filesystem holding the target file does not support direct IO.
- -d
- Create a duplicate (true clone) filesystem. This should be done only if the new filesystem will be used as a replacement for the original filesystem (such as in the case of disk replacement).
- -L FILE
- Specifies the location of the log FILE if the default location of /var/tmp/xfs_copy.log.XXXXXX is not desired.