{
    "content": [
        {
            "type": "text",
            "text": "# xfs_copy (man)\n\n## NAME\n\nxfscopy - copy the contents of an XFS filesystem\n\n## SYNOPSIS\n\nxfscopy [ -bd ] [ -L log ] source target1 [ target2 ... ]\nxfscopy -V\n\n## DESCRIPTION\n\nxfscopy copies an XFS filesystem to one or more targets in parallel (see xfs(5)).  The first\n(source) argument must be the pathname of the device or file containing the  XFS  filesystem.\nThe  remaining  arguments  specify one or more target devices or file names. If the pathnames\nspecify devices, a copy of the source XFS filesystem is created on each  device.  The  target\ncan  also  be the name of a regular file, in which case an image of the source XFS filesystem\nis created in that file. If the file does not exist, xfscopy creates the file. The length of\nthe  resulting  file  is  equal to the size of the source filesystem. However, if the file is\ncreated on an XFS filesystem, the file consumes roughly the amount of space actually used  in\nthe  source  filesystem  by  the  filesystem  and  the  XFS log.  The space saving is because\nxfscopy seeks over free blocks instead of copying  them  and  the  XFS  filesystem  supports\nsparse files efficiently.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (4 subsections)\n- **DIAGNOSTICS**\n- **NOTES**\n- **CAVEATS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "xfs_copy",
        "section": "",
        "mode": "man",
        "summary": "xfscopy - copy the contents of an XFS filesystem",
        "synopsis": "xfscopy [ -bd ] [ -L log ] source target1 [ target2 ... ]\nxfscopy -V",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "filesystem will be used as a replacement for the original filesystem (such as in the case of disk replacement)."
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "target files. This is useful when the filesystem holding the target file does not sup‐ port direct IO."
            },
            {
                "flag": "-L",
                "long": null,
                "arg": null,
                "description": "/var/tmp/xfscopy.log.XXXXXX is not desired."
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "mkfs.xfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.xfs/8/json"
            },
            {
                "name": "xfsdump",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfsdump/8/json"
            },
            {
                "name": "xfsrestore",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfsrestore/8/json"
            },
            {
                "name": "xfsfreeze",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfsfreeze/8/json"
            },
            {
                "name": "xfsgrowfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfsgrowfs/8/json"
            },
            {
                "name": "xfs",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/xfs/5/json"
            },
            {
                "name": "xfscopy",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfscopy/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-d",
                        "lines": 3,
                        "flag": "-d"
                    },
                    {
                        "name": "-b",
                        "lines": 3,
                        "flag": "-b"
                    },
                    {
                        "name": "-L",
                        "lines": 2,
                        "flag": "-L"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    }
                ]
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "xfscopy - copy the contents of an XFS filesystem\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "xfscopy [ -bd ] [ -L log ] source target1 [ target2 ... ]\nxfscopy -V\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "xfscopy copies an XFS filesystem to one or more targets in parallel (see xfs(5)).  The first\n(source) argument must be the pathname of the device or file containing the  XFS  filesystem.\nThe  remaining  arguments  specify one or more target devices or file names. If the pathnames\nspecify devices, a copy of the source XFS filesystem is created on each  device.  The  target\ncan  also  be the name of a regular file, in which case an image of the source XFS filesystem\nis created in that file. If the file does not exist, xfscopy creates the file. The length of\nthe  resulting  file  is  equal to the size of the source filesystem. However, if the file is\ncreated on an XFS filesystem, the file consumes roughly the amount of space actually used  in\nthe  source  filesystem  by  the  filesystem  and  the  XFS log.  The space saving is because\nxfscopy seeks over free blocks instead of copying  them  and  the  XFS  filesystem  supports\nsparse files efficiently.\n\nxfscopy should only be used to copy unmounted filesystems, read-only mounted filesystems, or\nfrozen filesystems (see xfsfreeze(8)).  Otherwise, the generated filesystem(s) would be  in‐\nconsistent or corrupt.\n\nxfscopy  does  not  alter  the source filesystem in any way. Each new (target) filesystem is\nidentical to the original filesystem except that new  filesystems  each  have  a  new  unique\nfilesystem identifier (UUID).  Therefore, if both the old and new filesystems will be used as\nseparate distinct filesystems, xfscopy or xfsdump(8)/xfsrestore(8) should be used to  gener‐\nate  the  new  filesystem(s)  instead  of dd(1) or other programs that do block-by-block disk\ncopying.\n\nxfscopy uses synchronous writes to ensure that write errors are detected.\n\nxfscopy uses pthreads(7) to perform simultaneous parallel writes.  xfscopy creates one  ad‐\nditional  thread  for  each  target to be written.  All threads die if xfscopy terminates or\naborts.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-d",
                        "content": "filesystem  will  be used as a replacement for the original filesystem (such as in the\ncase of disk replacement).\n",
                        "flag": "-d"
                    },
                    {
                        "name": "-b",
                        "content": "target files. This is useful when the filesystem holding the target file does not sup‐\nport direct IO.\n",
                        "flag": "-b"
                    },
                    {
                        "name": "-L",
                        "content": "/var/tmp/xfscopy.log.XXXXXX is not desired.\n",
                        "flag": "-L"
                    },
                    {
                        "name": "-V",
                        "content": "",
                        "flag": "-V"
                    }
                ]
            },
            "DIAGNOSTICS": {
                "content": "xfscopy  reports  errors  to  both  stderr and in more detailed form to a generated log file\nwhose name is of the form /var/tmp/xfscopy.log.XXXXXX or a log file specified by the -L  op‐\ntion.  If  xfscopy detects a write error on a target, the copy of that one target is aborted\nand an error message is issued to both stderr and the log file, but the rest  of  the  copies\ncontinue.  When  xfscopy terminates, all aborted targets are reported to both stderr and the\nlog file.\n\nIf all targets abort or if there is an error reading the source filesystem, xfscopy  immedi‐\nately aborts.\n\nxfscopy returns an exit code of 0 if all targets are successfully copied and an exit code of\n1 if any target fails.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "When moving filesystems from one disk to another, if the original filesystem is significantly\nsmaller  than  the new filesystem, and will be made larger, we recommend that mkfs.xfs(8) and\nxfsdump(8)/xfsrestore(8) be used instead of using xfscopy and xfsgrowfs(8).  The filesystem\nlayout resulting from using xfscopy/xfsgrowfs is almost always worse than the result of us‐\ning mkfs.xfs/xfsdump/xfsrestore but in the case of small  filesystems,  the  differences  can\nhave  a  significant  performance impact. This is due to the way xfsgrowfs(8) works, and not\ndue to any shortcoming in xfscopy itself.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "xfscopy does not copy XFS filesystems that have a real-time section or XFS filesystems  with\nexternal logs. In both cases, xfscopy aborts with an error message.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "mkfs.xfs(8), xfsdump(8), xfsrestore(8), xfsfreeze(8), xfsgrowfs(8), xfs(5).\n\n\n\nxfscopy(8)",
                "subsections": []
            }
        }
    }
}