From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Hugo Mills <hugo@carfax.org.uk>,
Graham Cobb <g.btrfs@cobb.uk.net>,
Cedric.dewijs@eclipso.eu, linux-btrfs@vger.kernel.org
Subject: Re: cloning a btrfs drive with send and receive: clone is bigger than the original?
Date: Sun, 10 Jan 2021 18:38:32 +0300 [thread overview]
Message-ID: <7de05d01-662d-f05f-cba8-a2524a088673@gmail.com> (raw)
In-Reply-To: <20210110132112.GA1374@savella.carfax.org.uk>
10.01.2021 16:21, Hugo Mills пишет:
> On Sun, Jan 10, 2021 at 01:06:44PM +0000, Graham Cobb wrote:
>> On 10/01/2021 07:41, Cedric.dewijs@eclipso.eu wrote:
>>> I've tested some more.
>>>
>>> Repeatedly sending the difference between two consecutive snapshots creates a structure on the target drive where all the snapshots share data. So 10 snapshots of 10 files of 100MB takes up 1GB, as expected.
>>>
>>> Repeatedly sending the difference between the first snapshot and each next snapshot creates a structure on the target drive where the snapshots are independent, so they don't share any data. How can that be avoided?
>>
>> If you send a snapshot B with a parent A, any files not present in A
>> will be created in the copy of B. The fact that you already happen to
>> have a copy of the files somewhere else on the target is not known to
>> either the sender or the receiver - how would it be?
>>
>> If you want the send process to take into account *other* snapshots that
>> have previously been sent, you need to tell send to also use those
>> snapshots as clone sources. That is what the -c option is for.
>
> And even then, it won't spot files that are identical but which
> don't share extents.
>
It won't with "btrfs send -p" as well.
>> Alternatively, use a deduper on the destination after the receive has
>> finished and let it work out what can be shared.
>
> This is a viable approach.
>
> Hugo.
>
prev parent reply other threads:[~2021-01-10 15:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-09 16:01 cloning a btrfs drive with send and receive: clone is bigger than the original?
2021-01-09 19:45 ` Andrei Borzenkov
2021-01-09 21:08 `
2021-01-10 7:41 `
2021-01-10 7:54 ` Andrei Borzenkov
2021-01-10 13:06 ` Re: " Graham Cobb
2021-01-10 13:21 ` Hugo Mills
2021-01-10 15:38 ` Andrei Borzenkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7de05d01-662d-f05f-cba8-a2524a088673@gmail.com \
--to=arvidjaar@gmail.com \
--cc=Cedric.dewijs@eclipso.eu \
--cc=g.btrfs@cobb.uk.net \
--cc=hugo@carfax.org.uk \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox