xfs_copy
Copy XFS files between XFS filesystems
SYNOPSIS
xfs_copy [options] source_device_or_file destination_device_or_file [destination_device_or_file ...]
PARAMETERS
-d
Enable debug messages.
-f
Force overwrite of the destination device or file. This is required if the destination already contains an XFS filesystem or if you are copying to a block device that is in use.
-i
Interactive mode. Prompt the user before overwriting an existing destination.
-L loglen
Specify the log length for the new XFS filesystem on the destination.
-P
Display a progress bar during the copy operation.
-r rtlen
Specify the real-time section length for the new XFS filesystem on the destination.
-s
Treat the source as a sparse file. This is useful when the source is an image file that might contain large blocks of zeros.
-V
Display version information for xfs_copy and exit.
source_device_or_file
The device or file containing the XFS filesystem to be copied. Examples include /dev/sda1 or a disk image file.
destination_device_or_file
The target device or file where the XFS filesystem will be copied. Multiple destinations can be specified for parallel copies.
DESCRIPTION
xfs_copy is a utility designed to perform a block-level copy of an entire XFS filesystem from a source device or file to one or more destination devices or files. Unlike file-level copy tools, it replicates the raw data and metadata structures of the XFS filesystem, making it suitable for tasks such as migrating an XFS volume, creating exact duplicates, or performing disaster recovery. A key feature is its ability to simultaneously copy to multiple destinations and to resize the filesystem during the copy operation, allowing the destination to be larger or smaller than the source (as long as it accommodates the used data). The destination must be an unmounted block device or a regular file of sufficient size. This command is an essential part of the xfsprogs suite, providing robust management capabilities for XFS.
CAVEATS
The destination must be an unmounted block device or a regular file.
The destination must be large enough to accommodate the data from the source, considering any resizing.
xfs_copy performs a block-level copy, meaning it duplicates the entire underlying structure of the XFS filesystem, including any unused space. For file-level backups, consider tools like rsync or tar.
Using -f will overwrite the destination without warning; use with caution.
EXIT STATUS
On success, xfs_copy returns 0. A non-zero exit status indicates an error.
PERFORMANCE
The command can copy to multiple destinations concurrently, potentially speeding up duplication tasks for large filesystems. Performance can be influenced by disk I/O capabilities and the specified block sizes.
HISTORY
xfs_copy is a component of the xfsprogs utilities, which manage the XFS filesystem. XFS was originally developed by Silicon Graphics, Inc. (SGI) for its IRIX operating system in the early 1990s. SGI open-sourced XFS in 2000, leading to its inclusion and continued development within the Linux kernel. xfs_copy has evolved as a stable and reliable tool for XFS migration and duplication, benefiting from the ongoing community and developer contributions to the xfsprogs project.
SEE ALSO
mkfs.xfs(8), xfs_growfs(8), xfs_admin(8), dd(1), rsync(1)