Why does "cp -R --reflink=always" perform a standard copy on a Btrfs filesystem?
22
votes
1
answer
16826
views
Btrfs support Copy-On-Write. I tried to use that feature to clone a directory:
cp -R --reflink=always foo_directory foo_directory.mirror
I expected the command to finish almost instantly (like a
btrfs subvolume snapshot
), but the cp
command seems to perform a slow, standard copy.
According to the man page, I would expected --reflink=always
to enforce Copy-On-Write:
> 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 standard copy.
**Questions:**
- Do you know why --reflink=always
doesn't work?
- What options (or other commands) should I use instead?
Asked by Philipp Claßen
(4967 rep)
Jul 30, 2015, 03:30 PM
Last activity: Jun 23, 2023, 08:29 AM
Last activity: Jun 23, 2023, 08:29 AM