From: Hugo Mills <hugo@carfax.org.uk>
To: Graham Cobb <g.btrfs@cobb.uk.net>
Cc: Cedric.dewijs@eclipso.eu, arvidjaar@gmail.com,
linux-btrfs@vger.kernel.org
Subject: Re: Re: Re: cloning a btrfs drive with send and receive: clone is bigger than the original?
Date: Sun, 10 Jan 2021 13:21:12 +0000 [thread overview]
Message-ID: <20210110132112.GA1374@savella.carfax.org.uk> (raw)
In-Reply-To: <8344b57d-9a2a-f4e9-59cb-42d6a7fa0600@cobb.uk.net>
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.
> 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.
--
Hugo Mills | The last man on Earth sat in a room. Suddenly, there
hugo@... carfax.org.uk | was a knock at the door.
http://carfax.org.uk/ |
PGP: E2AB1DE4 | Frederic Brown
next prev parent reply other threads:[~2021-01-10 13:22 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 [this message]
2021-01-10 15:38 ` Andrei Borzenkov
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=20210110132112.GA1374@savella.carfax.org.uk \
--to=hugo@carfax.org.uk \
--cc=Cedric.dewijs@eclipso.eu \
--cc=arvidjaar@gmail.com \
--cc=g.btrfs@cobb.uk.net \
--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