19

btrfs supports reflinks, XFS supports reflinks (since 2017 I think?).

Are there any other filesystems that support it?

truncate -s 1G test.file;
cp --reflink=always test.file ref.test.file;
  • 1
  • BTW, reflinking a sparse file isn't much of a test. truncate doesn't write or even pre-allocate the file, it just sets the length, so you have a purely sparse file with a non-zero length but no data extents. – Peter Cordes Mar 14 '23 at 17:55
  • 2
    https://www.ctrl.blog/entry/file-cloning.html has a table of support by OS and FS, although I'm not sure if the blog author intends to keep that up to date with future development. In Linux, BTRFS, XFS are the two well-known FSes with support. Also Bcachefs and OCFS2. But still not in EXT4 or OpenZFS as of Jan 2023. – Peter Cordes Mar 14 '23 at 18:03
  • @PeterCordes wow OpenZFS doesn't support reflinks? That's a surprise! – hanshenrik Mar 14 '23 at 19:19
  • 1
    Worth pointing out that OpenZFS recently merged support for reflinks, at least on Linux: https://github.com/openzfs/zfs/commit/48d0e9465de9571a5268f65b7446c693410e0220. The feature isn't yet part of a release but should be soon-ish. – CAFxX Aug 05 '23 at 00:00

1 Answers1

22

Support for reflinks is indicated using the remap_file_range operation, which is currently (6.7) supported by bcachefs, Btrfs, CIFS, NFS 4.2, OCFS2, overlayfs, and XFS.

Stephen Kitt
  • 434,908