Re: btrfs send/receive using generation number as source

2016-04-08 Thread Chris Murphy
On Fri, Apr 8, 2016 at 5:01 AM, Martin Steigerwald  wrote:
> Hello!
>
> As far as I understood, for differential btrfs send/receive – I didn´t use it
> yet – I need to keep a snapshot on the source device to then tell btrfs send
> to send the differences between the snapshot and the current state.
>
> Now the BTRFS filesystems on my SSDs are often quite full, thus I do not keep
> any snapshots except for one during rsync or borgbackup script run-time.
>
> Is it possible to tell btrfs send to use generation number xyz to calculate
> the difference? This way, I wouldn´t have to keep a snapshot around, I
> believe.
>
> I bet not, at the time cause -c wants a snapshot. Ah and it wants a snapshot
> of the same state on the destination as well. Well on the destination I let
> the script make a snapshot after the backup so… what I would need is to
> remember the generation number of the source snapshot that the script creates
> to backup from and then tell btrfs send that generation number + the
> destination snapshots.
>
> Well, or get larger SSDs or get rid of some data on them.

Well if you can't even keep one ro snapshot around, it suggests you
need more space. Otherwise the minimal strategy is:


Yesterday's source has subvols:
root.current
root.20160406

So you'd do

btrfs sub snap -r root.current root.20160407
btrfs send -p root.20160406 root.20160407  | btrfs receive xxx
btrfs sub del root.20160406

Today it's

btrfs sub snap -r root.current root.20160408
btrfs send -p root.20160407 root.20160408  | btrfs receive xxx
btrfs sub del root.20160407


Tomorrow:

btrfs sub snap -r root.current root.20160409
btrfs send -p root.20160408 root.20160409  | btrfs receive xxx
btrfs sub del root.20160408


Locally you always have one snapshot to rollback to or make selective
reflink copies of files from.


-- 
Chris Murphy
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs send/receive using generation number as source

2016-04-08 Thread Henk Slager
On Fri, Apr 8, 2016 at 1:01 PM, Martin Steigerwald  wrote:
> Hello!
>
> As far as I understood, for differential btrfs send/receive – I didn´t use it
> yet – I need to keep a snapshot on the source device to then tell btrfs send
> to send the differences between the snapshot and the current state.

During the incremental send operation you need 2 ro snapshots
available (a parent and a current snapshot) and after that, you just
need to keep the current one and promote that to parent snapshot and
keep it around until the next incremental send. So indeed that locks
space and you might run out of free space if there is a long time
before the next incremental send|receive and changes in the filesystem
are large in volume.

Alternatively, you could do non-incremental send, if the fs is
relatively small and you have some method to dedupe on the receiving
filesystem. But the rsync method is by far preferred in this case I
would say.

> Now the BTRFS filesystems on my SSDs are often quite full, thus I do not keep
> any snapshots except for one during rsync or borgbackup script run-time.
>
> Is it possible to tell btrfs send to use generation number xyz to calculate
> the difference? This way, I wouldn´t have to keep a snapshot around, I
> believe.
>
> I bet not, at the time cause -c wants a snapshot. Ah and it wants a snapshot
> of the same state on the destination as well. Well on the destination I let
> the script make a snapshot after the backup so… what I would need is to

You can use -p for incremental send and you can also send back (new)
increments from backup to master.

> remember the generation number of the source snapshot that the script creates
> to backup from and then tell btrfs send that generation number + the
> destination snapshots.
>
> Well, or get larger SSDs or get rid of some data on them.

I switched from ext4 to btrfs rootfs on an old netbook which has only
4G soldered flash and no option for extension  (except via USB/SDcard
which turned out to be not reliable enough over a longer period of
time).
Basically compress=lzo mount option extents the lifetime of this
netbook while still using a modern full-sized linux distro. But I
guess you have already compressed/compacted what is possible.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs send/receive using generation number as source

2016-04-08 Thread Martin Steigerwald
On Freitag, 8. April 2016 11:12:54 CEST Hugo Mills wrote:
> On Fri, Apr 08, 2016 at 01:01:03PM +0200, Martin Steigerwald wrote:
> > Hello!
> > 
> > As far as I understood, for differential btrfs send/receive – I didn´t use
> > it yet – I need to keep a snapshot on the source device to then tell
> > btrfs send to send the differences between the snapshot and the current
> > state.
> > 
> > Now the BTRFS filesystems on my SSDs are often quite full, thus I do not
> > keep any snapshots except for one during rsync or borgbackup script
> > run-time.
> > 
> > Is it possible to tell btrfs send to use generation number xyz to
> > calculate
> > the difference? This way, I wouldn´t have to keep a snapshot around, I
> > believe.
> 
>btrfs sub find-new
> 
>BUT that will only tell you which files have been added or updated.
> It won't tell you which files have been deleted. It's also unrelated
> to send/receive, so you'd have to roll your own solution.

I am aware of this one.

> > I bet not, at the time cause -c wants a snapshot. Ah and it wants a
> > snapshot of the same state on the destination as well. Well on the
> > destination I let the script make a snapshot after the backup so…
> > what I would need is to remember the generation number of the source
> > snapshot that the script creates to backup from and then tell btrfs
> > send that generation number + the destination snapshots.
> > 
> > Well, or get larger SSDs or get rid of some data on them.
> 
>Those are the other options, of course.

Hm, I see.

Thanks,
-- 
Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs send/receive using generation number as source

2016-04-08 Thread Hugo Mills
On Fri, Apr 08, 2016 at 01:01:03PM +0200, Martin Steigerwald wrote:
> Hello!
> 
> As far as I understood, for differential btrfs send/receive – I didn´t use it 
> yet – I need to keep a snapshot on the source device to then tell btrfs send 
> to send the differences between the snapshot and the current state.
> 
> Now the BTRFS filesystems on my SSDs are often quite full, thus I do not keep 
> any snapshots except for one during rsync or borgbackup script run-time.
> 
> Is it possible to tell btrfs send to use generation number xyz to calculate 
> the difference? This way, I wouldn´t have to keep a snapshot around, I 
> believe.

   btrfs sub find-new

   BUT that will only tell you which files have been added or updated.
It won't tell you which files have been deleted. It's also unrelated
to send/receive, so you'd have to roll your own solution.

> I bet not, at the time cause -c wants a snapshot. Ah and it wants a
> snapshot of the same state on the destination as well. Well on the
> destination I let the script make a snapshot after the backup so…
> what I would need is to remember the generation number of the source
> snapshot that the script creates to backup from and then tell btrfs
> send that generation number + the destination snapshots.

> Well, or get larger SSDs or get rid of some data on them.

   Those are the other options, of course.

   Hugo.

-- 
Hugo Mills | The trouble with you, Ibid, is you think you know
hugo@... carfax.org.uk | everything.
http://carfax.org.uk/  |
PGP: E2AB1DE4  |


signature.asc
Description: Digital signature


btrfs send/receive using generation number as source

2016-04-08 Thread Martin Steigerwald
Hello!

As far as I understood, for differential btrfs send/receive – I didn´t use it 
yet – I need to keep a snapshot on the source device to then tell btrfs send 
to send the differences between the snapshot and the current state.

Now the BTRFS filesystems on my SSDs are often quite full, thus I do not keep 
any snapshots except for one during rsync or borgbackup script run-time.

Is it possible to tell btrfs send to use generation number xyz to calculate 
the difference? This way, I wouldn´t have to keep a snapshot around, I 
believe.

I bet not, at the time cause -c wants a snapshot. Ah and it wants a snapshot 
of the same state on the destination as well. Well on the destination I let 
the script make a snapshot after the backup so… what I would need is to 
remember the generation number of the source snapshot that the script creates 
to backup from and then tell btrfs send that generation number + the 
destination snapshots.

Well, or get larger SSDs or get rid of some data on them.

Thanks,
-- 
Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html