5

I'm about to copy data from one XFS file system to another (smaller) XFS file system. The file systems may be unmounted while copying. I don't want to have to worry about ACLs, SELinux contexts, etc, so I'm looking at xfs_copy and xfsdump.

When should xfs_copy be used instead of xfsdump, and vice versa? Is one quicker than the other?

Troels Arvin
  • 652
  • 7
  • 17

2 Answers2

5

xfs_copy should be used when doing an image of the source filesystem - ie: very similar to what dd would do.

xfsdump copies filesystem content rather than creating a true filesystem image. This measn xfsdump walk the filesystem and, iterating on each object, copies each file/dir (including their attributes).

When using xfs_copy vs xfsdump? From xfs_copy man page:

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 mkfs.xfs(8) and xfsdump(8)/xfsrestore(8) be used instead of using xfs_copy and xfs_growfs(8). The filesystem layout resulting from using xfs_copy/xfs_growfs is almost always worse than the result of using mkfs.xfs/xfsdump/xfsrestore but in the case of small filesystems, the differences can have a significant performance impact.

shodanshok
  • 47,711
  • 7
  • 111
  • 180
0

If source file system has been corrupt and can not repair by xfs_repair, you can use xfsdump salvage data and minimize your losses.