{"id":3161,"date":"2022-12-20T16:43:40","date_gmt":"2022-12-20T19:43:40","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/xfs_copy-man8\/"},"modified":"2022-12-20T16:43:40","modified_gmt":"2022-12-20T19:43:40","slug":"xfs_copy-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/xfs_copy-man8\/","title":{"rendered":"xfs_copy (man8)"},"content":{"rendered":"<h1 align=\"center\">xfs_copy<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#DIAGNOSTICS\">DIAGNOSTICS<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#CAVEATS\">CAVEATS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">xfs_copy \u2212 copy the contents of an XFS filesystem<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> [ <b>\u2212bd<\/b> ] [ <b>\u2212L<\/b> <i>log<\/i> ] <i>source target1<\/i> [ <i>target2<\/i> &#8230; ] <b><br \/> xfs_copy \u2212V<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> copies an XFS filesystem to one or more targets in parallel (see <b>xfs<\/b>(5)). The first (<i>source<\/i>) argument must be the pathname of the device or file containing the XFS filesystem. The remaining arguments specify one or more <i>target<\/i> devices or file names. If the pathnames specify devices, a copy of the source XFS filesystem is created on each device. The <i>target<\/i> 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, <b>xfs_copy<\/b> 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 <b>xfs_copy<\/b> seeks over free blocks instead of copying them and the XFS filesystem supports sparse files efficiently.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> should only be used to copy unmounted filesystems, read-only mounted filesystems, or frozen filesystems (see <b>xfs_freeze<\/b>(8)). Otherwise, the generated filesystem(s) would be inconsistent or corrupt.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> 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, <b>xfs_copy<\/b> or <b>xfsdump<\/b>(8)\/<b>xfsrestore<\/b>(8) should be used to generate the new filesystem(s) instead of <b>dd<\/b>(1) or other programs that do block-by-block disk copying.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> uses synchronous writes to ensure that write errors are detected.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> uses <b>pthreads<\/b>(7) to perform simultaneous parallel writes. <b>xfs_copy<\/b> creates one additional thread for each target to be written. All threads die if <b>xfs_copy<\/b> terminates or aborts.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>\u2212d<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">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).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>\u2212b<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>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.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>\u2212L<\/b> <i>log<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Specifies the location of the <i>log<\/i> if the default location of <i>\/var\/tmp\/xfs_copy.log.XXXXXX<\/i> is not desired.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>\u2212V<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Prints the version number and exits.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>DIAGNOSTICS <a name=\"DIAGNOSTICS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> reports errors to both <b>stderr<\/b> and in more detailed form to a generated log file whose name is of the form <i>\/var\/tmp\/xfs_copy.log.XXXXXX<\/i> or a log file specified by the <b>\u2212L<\/b> option. If <b>xfs_copy<\/b> 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 <b>xfs_copy<\/b> terminates, all aborted targets are reported to both <b>stderr<\/b> and the log file.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If all targets abort or if there is an error reading the source filesystem, <b>xfs_copy<\/b> immediately aborts.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> returns an exit code of 0 if all targets are successfully copied and an exit code of 1 if any target fails.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <b>mkfs.xfs<\/b>(8) and <b>xfsdump<\/b>(8)\/<b>xfsrestore<\/b>(8) be used instead of using <b>xfs_copy<\/b> and <b>xfs_growfs<\/b>(8). The filesystem layout resulting from using <b>xfs_copy<\/b>\/<b>xfs_growfs<\/b> is almost always worse than the result of using <b>mkfs.xfs<\/b>\/<b>xfsdump<\/b>\/<b>xfsrestore<\/b> but in the case of small filesystems, the differences can have a significant performance impact. This is due to the way <b>xfs_growfs<\/b>(8) works, and not due to any shortcoming in <b>xfs_copy<\/b> itself.<\/p>\n<h2>CAVEATS <a name=\"CAVEATS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_copy<\/b> does not copy XFS filesystems that have a real-time section or XFS filesystems with external logs. In both cases, <b>xfs_copy<\/b> aborts with an error message.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>mkfs.xfs<\/b>(8), <b>xfsdump<\/b>(8), <b>xfsrestore<\/b>(8), <b>xfs_freeze<\/b>(8), <b>xfs_growfs<\/b>(8), <b>xfs<\/b>(5).<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  xfs_copy \u2212 copy the contents of an XFS filesystem <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,304],"class_list":["post-3161","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-xfs_copy"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3161"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3161\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}