Author vstinner
Recipients giampaolo.rodola, pablogsal, vstinner
Date 2019-06-04.21:51:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Random notes.

Extract of Linux manual page of "cp":

              control clone/CoW copies. See below

       When --reflink[=always] is specified, perform a lightweight copy, where
       the data blocks are copied only when modified.  If this is not possible
       the copy fails, or if --reflink=auto is specified, fall back to a stan‐
       dard copy.  Use --reflink=never to ensure a standard copy is performed.


"Why is cp --reflink=auto not the default behaviour?":


reflinks are supported by BTRFS and OCFS2.

XFS seems to have an experimental support for reflink, 2 years old article:

Linux version of ZFS doesn't support reflink yet:


Python binding using cffi to get reflink:
"Btrfs, XFS, OCFS2 reflink support. Btrfs is tested the most.
Apple macOS APFS clonefile support. Little testing, be careful. It might eat data."


"reflink for Windows":
"Windows Server 2016 introduce Block Cloning feature."

"ReFS v2 is only available in Windows Server 2016 and Windows 10 version 1703 (build 15063) or later.
Windows 10 version 1607 (build 14393) and earlier Windows only can use ReFS v1."


Linux has 2 ioctl:

       #include <sys/ioctl.h>
       #include <linux/fs.h>

       int ioctl(int dest_fd, FICLONERANGE, struct file_clone_range *arg);
       int ioctl(int dest_fd, FICLONE, int src_fd);
Date User Action Args
2019-06-04 21:51:31vstinnersetrecipients: + vstinner, giampaolo.rodola, pablogsal
2019-06-04 21:51:31vstinnersetmessageid: <>
2019-06-04 21:51:31vstinnerlinkissue37157 messages
2019-06-04 21:51:31vstinnercreate