* Should cp default to reflink?
@ 2017-11-06 22:37 Chris Murphy
2017-11-07 4:56 ` Marat Khalili
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Chris Murphy @ 2017-11-06 22:37 UTC (permalink / raw)
To: Btrfs BTRFS
I'm doing copies from one subvolume to another, through a mounted top
level (id5) at /mnt/int.
This copies the whole file conventionally (no shared extents)
$ sudo cp /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
/mnt/int/root00/var/lib/libvirt/images/
This is a reflink copy
$ sudo cp --reflink
/mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
/mnt/int/root00/var/lib/libvirt/images/
This is also a refink copy, with the original removed.
$ sudo mv /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
/mnt/int/root00/var/lib/libvirt/images/
Seems to me any request to duplicate should be optimized by default
with an auto reflink when possible, and require an explicit option to
inhibit.
--
Chris Murphy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Should cp default to reflink?
2017-11-06 22:37 Should cp default to reflink? Chris Murphy
@ 2017-11-07 4:56 ` Marat Khalili
2017-11-07 12:30 ` Austin S. Hemmelgarn
2017-11-07 12:51 ` Dmitrii Tcvetkov
2 siblings, 0 replies; 4+ messages in thread
From: Marat Khalili @ 2017-11-07 4:56 UTC (permalink / raw)
To: Chris Murphy, Btrfs BTRFS
Obviously (for me) yes, but who will decide? There should be --no-reflink for people trying to defragment something.
>Seems to me any request to duplicate should be optimized by default
>with an auto reflink when possible, and require an explicit option to
>inhibit.
Key word is "any". I much more often use rsync than cp within the same volume.
--
With Best Regards,
Marat Khalili
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Should cp default to reflink?
2017-11-06 22:37 Should cp default to reflink? Chris Murphy
2017-11-07 4:56 ` Marat Khalili
@ 2017-11-07 12:30 ` Austin S. Hemmelgarn
2017-11-07 12:51 ` Dmitrii Tcvetkov
2 siblings, 0 replies; 4+ messages in thread
From: Austin S. Hemmelgarn @ 2017-11-07 12:30 UTC (permalink / raw)
To: Chris Murphy, Btrfs BTRFS
On 2017-11-06 17:37, Chris Murphy wrote:
> I'm doing copies from one subvolume to another, through a mounted top
> level (id5) at /mnt/int.
>
> This copies the whole file conventionally (no shared extents)
> $ sudo cp /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
> /mnt/int/root00/var/lib/libvirt/images/
>
> This is a reflink copy
> $ sudo cp --reflink
> /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
> /mnt/int/root00/var/lib/libvirt/images/
>
> This is also a refink copy, with the original removed.
> $ sudo mv /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
> /mnt/int/root00/var/lib/libvirt/images/
>
> Seems to me any request to duplicate should be optimized by default
> with an auto reflink when possible, and require an explicit option to
> inhibit.
I would argue that it probably should, with the caveat that it
absolutely should be well documented. I've been using an alias to
achieve this for months now on most of my systems with no issues, so I
can say with some confidence that it works. Ideally, I'd love to see a
similar patch for busybox, but that's not really essential for this
(though having a quick easy way to call the clone ioctl in btrfs-progs
itself would be nice as a alternative).
There may however be some wailing and gnashing of teeth from those who
have convinced themselves that a completely independent copy of a file
on the same filesystem constitutes a backup and that they need such backups.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Should cp default to reflink?
2017-11-06 22:37 Should cp default to reflink? Chris Murphy
2017-11-07 4:56 ` Marat Khalili
2017-11-07 12:30 ` Austin S. Hemmelgarn
@ 2017-11-07 12:51 ` Dmitrii Tcvetkov
2 siblings, 0 replies; 4+ messages in thread
From: Dmitrii Tcvetkov @ 2017-11-07 12:51 UTC (permalink / raw)
To: Chris Murphy; +Cc: linux-btrfs
On Mon, 6 Nov 2017 15:37:21 -0700
Chris Murphy wrote:
> Seems to me any request to duplicate should be optimized by default
> with an auto reflink when possible, and require an explicit option to
> inhibit.
"cp --reflink=auto" by default might create unexpected behaviour of
slower balance on a filesystem with a lot of reflinks. Especially if
the filesystem already has many shapshots.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-07 12:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06 22:37 Should cp default to reflink? Chris Murphy
2017-11-07 4:56 ` Marat Khalili
2017-11-07 12:30 ` Austin S. Hemmelgarn
2017-11-07 12:51 ` Dmitrii Tcvetkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).