On Tue, Nov 24, 2015 at 10:17:13PM +0100, Christoph Anton Mitterer wrote: > On Tue, 2015-11-24 at 15:58 -0500, Austin S Hemmelgarn wrote: > > I had tried using send/receive once with -p, but had numerous issues. > > > The incrementals I've been doing have used -c instead, and I hadn't had > > any issues with data loss with that. The issue outlined here was only a > > small part of why I stopped using it for backups. The main reason was > > to provide better consistency between my local copies and what I upload > > to S3/Dropbox, meaning I only have to test one back up image per > > filesystem backed-up, instead of two. > > Okay maybe I just don't understand how to use send/receive correctly... > > > What I have is about the following (simplified): > > master-fs: > 5 > | > +--data (subvol, my precious data) > | > +--snapshots > | > +--2015-11-01 (suvol, ro-snapshot of /data) > > So 2015-11-01 is basically the first snapshot ever made. > > Now I want to have it on: > backup-fs > +--2015-11-01 (suvol, ro-snapshot of /data) > > > So far I did > btrfs send /master-fs/snapshots/2015-11-01 | btrfs receive > /backup-fs/2015-11-01 > > > > > Then time goes by and I get new content in the data subvol, so what > I'd like to have then is a new snapshot on the master-fs: > 5 > | > +--data (subvol, more of my precious data) > | > +--snapshots > | > +--2015-11-01 (suvol, ro-snapshot of /data) > +--2015-11-20 (suvol, ro-snapshot of /data) > > And this should go incrementally on backup-fs: > backup-fs > +--2015-11-01 (suvol, ro-snapshot of /data) > +--2015-11-20 > (suvol, ro-snapshot of /data) > > So far I used something like: > btrfs send -p 2015-11-01 /master-fs/snapshots/2015-11-20 | btrfs receive > /backup-fs/2015-11-20 > > And obviously I want it to share all the ref-links and stuf... > > > So in other words, what's the difference between -p and -c? :D
-p only sends the file metadata for the changes from the reference snapshot to the sent snapshot. -c sends all the file metadata, but will preserve the reflinks between the sent snapshot and the (one or more) reference snapshots. You can only use one -p (because there's only one difference you can compute at any one time), but you can use as many -c as you like (because you can share extents with any number of subvols). In both cases, the reference snapshot(s) must exist on the receiving side. In implementation terms, on the receiver, -p takes a (writable) snapshot of the reference subvol, and modifies it according to the stream data. -c makes a new empty subvol, and populates it from scratch, using the reflink ioctl to use data which is known to exist in the reference subvols. Hugo. -- Hugo Mills | Anyone who claims their cryptographic protocol is hugo@... carfax.org.uk | secure is either a genius or a fool. Given the http://carfax.org.uk/ | genius/fool ratio for our species, the odds aren't PGP: E2AB1DE4 | good. Bruce Schneier
signature.asc
Description: Digital signature