Section: Maintenance Commands (8)
xfs_copy - copy the contents of an XFS filesystem
copies an XFS filesystem to one or more targets in parallel (see
argument must be the pathname of the device or file containing the
XFS filesystem. The remaining arguments specify one or more
devices or file names. If the pathnames specify devices, a
copy of the source XFS filesystem is created on each device. The
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,
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
seeks over free blocks instead of copying them and the XFS filesystem
supports sparse files efficiently.
should only be used to copy unmounted filesystems, read-only mounted
filesystems, or frozen filesystems (see
Otherwise, the generated filesystem(s) would be inconsistent or corrupt.
does not alter the source filesystem in any way. Each new (target)
filesystem is identical to the original filesystem except that new
filesystems each have a new unique filesystem identifier (UUID).
Therefore, if both the old and new filesystems will be used as
separate distinct filesystems,
should be used to generate the new filesystem(s) instead of
or other programs that do block-by-block disk copying.
uses synchronous writes to ensure that write errors are
to perform simultaneous parallel writes.
creates one additional thread for each target to be written.
All threads die if
terminates or aborts.
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).
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.
- -L log
Specifies the location of the
if the default location of
is not desired.
Prints the version number and exits.
reports errors to both
and in more detailed form to a generated log file whose name is of the form
or a log file specified by the
detects a write error on a target, the copy of that one target is aborted
and an error message is issued to both stderr and the log file, but
the rest of the copies continue. When
terminates, all aborted targets are reported to both
and the log file.
If all targets abort or if there is an error reading the source filesystem,
returns an exit code of 0 if all targets are successfully
copied and an exit code of 1 if any target fails.
When moving filesystems from one disk to another, if the original
filesystem is significantly smaller than the new filesystem, and will
be made larger, we recommend that
(8) and xfsdump
be used instead of using
The filesystem layout resulting from using
is almost always worse than the result of using
but in the case of small filesystems, the differences can have a
significant performance impact. This is due to the way
works, and not due to any shortcoming in
does not copy XFS filesystems that have a real-time section
or XFS filesystems with external logs. In both cases,
aborts with an error message.