All of lore.kernel.org
 help / color / mirror / Atom feed
* Snapper & apt-btrfs-snapshot on Ubuntu
@ 2016-11-02  0:00 Ahmed Badr
  2016-11-02  0:19 ` Hans van Kranenburg
  2016-11-02  6:03 ` Duncan
  0 siblings, 2 replies; 9+ messages in thread
From: Ahmed Badr @ 2016-11-02  0:00 UTC (permalink / raw)
  To: linux-btrfs

Hi all,

Btrfs newbie here trying to figure out how to use it properly on Ubuntu
16.04 server.

I have root formated using Btrfs, and installed Snapper and everything
seems to works fine. I installed apt-btrfs-snapshot which takes snapshot
before and after apt-get just like OpenSUSE/Zypper and that seems to work
fine too.

The problem is, unlike OpenSUSE/Zypper, on Ubuntu neither Snapper nor
apt-btrfs-snapshot see the snapshots made by the other program. So I cannot
list, compare or manage the apt-btrfs snapshots using snapper. Any way to
fix this?

Thanks.
--
A.B.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02  0:00 Snapper & apt-btrfs-snapshot on Ubuntu Ahmed Badr
@ 2016-11-02  0:19 ` Hans van Kranenburg
  2016-11-02 11:25   ` Ahmed Badr
  2016-11-02  6:03 ` Duncan
  1 sibling, 1 reply; 9+ messages in thread
From: Hans van Kranenburg @ 2016-11-02  0:19 UTC (permalink / raw)
  To: badara+ml, linux-btrfs

On 11/02/2016 01:00 AM, Ahmed Badr wrote:
> 
> Btrfs newbie here

Congrats!

> trying to figure out how to use it properly on Ubuntu
> 16.04 server.
> 
> I have root formated using Btrfs, and installed Snapper and everything
> seems to works fine. I installed apt-btrfs-snapshot which takes snapshot
> before and after apt-get just like OpenSUSE/Zypper and that seems to work
> fine too.
> 
> The problem is, unlike OpenSUSE/Zypper, on Ubuntu neither Snapper nor
> apt-btrfs-snapshot see the snapshots made by the other program. So I cannot
> list, compare or manage the apt-btrfs snapshots using snapper. Any way to
> fix this?

To get more info, try 'btrfs sub list -q /mountpoint'. This will show
you in where both tools create their snapshots, and it will show
(parent_uuid field) which subvolume they're taken from.

While all of the snapshots with a matching parent_uuid are snapshots of
the same thing in linear time for btrfs, the tools may have their own
added administration on top (like snapshot names, or directories they're
placed in), which prevents them from being able to do something with the
other ones. This is not the fault of btrfs, it's because those tools
probably are designed to ignore anything they didn't cause to happen
themselves.

-- 
Hans van Kranenburg

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02  0:00 Snapper & apt-btrfs-snapshot on Ubuntu Ahmed Badr
  2016-11-02  0:19 ` Hans van Kranenburg
@ 2016-11-02  6:03 ` Duncan
  2016-11-02  6:31   ` Alex Powell
  2016-11-02 11:09   ` Ahmed Badr
  1 sibling, 2 replies; 9+ messages in thread
From: Duncan @ 2016-11-02  6:03 UTC (permalink / raw)
  To: linux-btrfs

Ahmed Badr posted on Wed, 02 Nov 2016 02:00:55 +0200 as excerpted:

> Btrfs newbie here trying to figure out how to use it properly on Ubuntu
> 16.04 server.
> 
> I have root formated using Btrfs, and installed Snapper [...]

I see Hans answered your direct question so I'll skip that, but one 
additional hint, in case you hadn't seen it yet and your snapshot 
management helpers aren't setup to take care of this automatically 
(possibly because you're using two of them)...

Btrfs tends to have scaling issues if you let the number of snapshots get 
too high.  Try to keep it under 300 snapshots per subvolume (combined 
between all tools) if at all possible, and if your use-case makes it easy 
enough, try to keep it under 100 snapshots per subvolume.  Definitely 
don't let it get into the thousands of snapshots per subvolume, or 
commands such as btrfs balance and btrfs check will take MUCH longer and 
use MANY TIMES more memory.

With automated snapshot management such as snapper, just make sure it's 
thinning down the snapshots at a reasonable rate as well, and ultimately 
deleting the oldest ones.  With proper thinning, it's easily possible to 
keep to around 250-ish snapshots, even starting at ever half hour or so.  
With that, proper thinning probably means thinning down to perhaps every 
hour to every three hours after 24 hours, then to two snapshots a day 
after a couple more days and one a day after a week.  Continue thinning 
after that, until after say a quarter (13 weeks) you're only keeping one 
a week, and after six months you're only keeping quarterly snapshots -- 
if you're not deleting all snapshots at six months because you switch to 
alternative media backups before that.

The thing for you is that since you're using two different automated 
snapshot tools, you need to make sure the combined total still stays 
below that 300, and below 100 if your use-case can handle it, as it'll 
definitely mean more efficient processing if you need to run a balance or 
check.

Second tip, btrfs quotas can make the scaling issues much worse.  If your 
use-case doesn't require them, simply turn them off (or never activate 
them in the first place) and avoid the management complexity they bring.  
A number of people have reported problems that simply disappeared when 
they turned off btrfs quotas, so being proactive and turning them off if 
you don't need them, to avoid having the issues in the first place, 
certainly can't hurt.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02  6:03 ` Duncan
@ 2016-11-02  6:31   ` Alex Powell
  2016-11-02 11:18     ` Ahmed Badr
  2016-11-02 11:09   ` Ahmed Badr
  1 sibling, 1 reply; 9+ messages in thread
From: Alex Powell @ 2016-11-02  6:31 UTC (permalink / raw)
  Cc: linux-btrfs

Hi All,
Taking a step back as well- there is also the possibility that you
might not need snapshots

I say this as you're a noobie- like me!
If you're a noobie, I assume you're not using it to host some massive
Oracle DB and need all these features

If you're using this for a home media server or some other small scale
project (small business) then perhaps incremental backups to another
array (preferably offsite) is what you need.
Even if the above isn't correct about you- it might be true of someone
reading this, so probably worth mentioning

Cheers

On Wed, Nov 2, 2016 at 4:33 PM, Duncan <1i5t5.duncan@cox.net> wrote:
> Ahmed Badr posted on Wed, 02 Nov 2016 02:00:55 +0200 as excerpted:
>
>> Btrfs newbie here trying to figure out how to use it properly on Ubuntu
>> 16.04 server.
>>
>> I have root formated using Btrfs, and installed Snapper [...]
>
> I see Hans answered your direct question so I'll skip that, but one
> additional hint, in case you hadn't seen it yet and your snapshot
> management helpers aren't setup to take care of this automatically
> (possibly because you're using two of them)...
>
> Btrfs tends to have scaling issues if you let the number of snapshots get
> too high.  Try to keep it under 300 snapshots per subvolume (combined
> between all tools) if at all possible, and if your use-case makes it easy
> enough, try to keep it under 100 snapshots per subvolume.  Definitely
> don't let it get into the thousands of snapshots per subvolume, or
> commands such as btrfs balance and btrfs check will take MUCH longer and
> use MANY TIMES more memory.
>
> With automated snapshot management such as snapper, just make sure it's
> thinning down the snapshots at a reasonable rate as well, and ultimately
> deleting the oldest ones.  With proper thinning, it's easily possible to
> keep to around 250-ish snapshots, even starting at ever half hour or so.
> With that, proper thinning probably means thinning down to perhaps every
> hour to every three hours after 24 hours, then to two snapshots a day
> after a couple more days and one a day after a week.  Continue thinning
> after that, until after say a quarter (13 weeks) you're only keeping one
> a week, and after six months you're only keeping quarterly snapshots --
> if you're not deleting all snapshots at six months because you switch to
> alternative media backups before that.
>
> The thing for you is that since you're using two different automated
> snapshot tools, you need to make sure the combined total still stays
> below that 300, and below 100 if your use-case can handle it, as it'll
> definitely mean more efficient processing if you need to run a balance or
> check.
>
> Second tip, btrfs quotas can make the scaling issues much worse.  If your
> use-case doesn't require them, simply turn them off (or never activate
> them in the first place) and avoid the management complexity they bring.
> A number of people have reported problems that simply disappeared when
> they turned off btrfs quotas, so being proactive and turning them off if
> you don't need them, to avoid having the issues in the first place,
> certainly can't hurt.
>
> --
> Duncan - List replies preferred.   No HTML msgs.
> "Every nonfree program has a lord, a master --
> and if you use the program, he is your master."  Richard Stallman
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02  6:03 ` Duncan
  2016-11-02  6:31   ` Alex Powell
@ 2016-11-02 11:09   ` Ahmed Badr
  1 sibling, 0 replies; 9+ messages in thread
From: Ahmed Badr @ 2016-11-02 11:09 UTC (permalink / raw)
  To: linux-btrfs

On Wed, Nov 2, 2016 at 8:03 AM, Duncan <1i5t5.duncan@cox.net> wrote:
> Btrfs tends to have scaling issues if you let the number of snapshots get
> too high.  Try to keep it under 300 snapshots per subvolume (combined
> between all tools) if at all possible, and if your use-case makes it easy
> enough, try to keep it under 100 snapshots per subvolume.  Definitely
> don't let it get into the thousands of snapshots per subvolume, or
> commands such as btrfs balance and btrfs check will take MUCH longer and
> use MANY TIMES more memory.

Thanks for the heads up on that. I didn't find this info anywhere so I
will  definitely do that. I don't think I'll even need that many
snapshots in the first place. Since this is a dedicated backup server
that I'll set and forget, I'll keep a snapshot every couple of hours
for the first day and a daily snapshot for a week. I'll be backing the
root partition on another computer anyway.

Since I'll be trying out several backup software to see which one
suits me best I'll use Snapper prior to installing each software. I'm
very excited since Btrfs will make this super easy

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02  6:31   ` Alex Powell
@ 2016-11-02 11:18     ` Ahmed Badr
  2016-11-02 11:56       ` Austin S. Hemmelgarn
  0 siblings, 1 reply; 9+ messages in thread
From: Ahmed Badr @ 2016-11-02 11:18 UTC (permalink / raw)
  To: linux-btrfs

On Wed, Nov 2, 2016 at 8:31 AM, Alex Powell
<alexj.powellalt@googlemail.com> wrote:
> Taking a step back as well- there is also the possibility that you
> might not need snapshots

I do need it for my root partition at least in the initial phase of
setting things up and trying out different software. Once the system
is stable, I might might not need it that much.

> If you're a noobie, I assume you're not using it to host some massive
> Oracle DB and need all these features

No I'm not hosting a DB on this server. If I'm not mistaken, I believe
Btrfs's COW functionality is not suitable for DB storage anyway.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02  0:19 ` Hans van Kranenburg
@ 2016-11-02 11:25   ` Ahmed Badr
  2016-11-02 11:44     ` Austin S. Hemmelgarn
  0 siblings, 1 reply; 9+ messages in thread
From: Ahmed Badr @ 2016-11-02 11:25 UTC (permalink / raw)
  To: linux-btrfs

On Wed, Nov 2, 2016 at 2:19 AM, Hans van Kranenburg
<hans.van.kranenburg@mendix.com> wrote:
> While all of the snapshots with a matching parent_uuid are snapshots of
> the same thing in linear time for btrfs, the tools may have their own
> added administration on top (like snapshot names, or directories they're
> placed in), which prevents them from being able to do something with the
> other ones. This is not the fault of btrfs, it's because those tools
> probably are designed to ignore anything they didn't cause to happen
> themselves.

I understand now. Both apps seems to behave well and do not mess with
each others snapshots so I'm tempted to use both but I think I better
stick to only one as I might get confused with so many snapshots and
rollback to the wrong one.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02 11:25   ` Ahmed Badr
@ 2016-11-02 11:44     ` Austin S. Hemmelgarn
  0 siblings, 0 replies; 9+ messages in thread
From: Austin S. Hemmelgarn @ 2016-11-02 11:44 UTC (permalink / raw)
  To: badara+ml, linux-btrfs

On 2016-11-02 07:25, Ahmed Badr wrote:
> On Wed, Nov 2, 2016 at 2:19 AM, Hans van Kranenburg
> <hans.van.kranenburg@mendix.com> wrote:
>> While all of the snapshots with a matching parent_uuid are snapshots of
>> the same thing in linear time for btrfs, the tools may have their own
>> added administration on top (like snapshot names, or directories they're
>> placed in), which prevents them from being able to do something with the
>> other ones. This is not the fault of btrfs, it's because those tools
>> probably are designed to ignore anything they didn't cause to happen
>> themselves.
>
> I understand now. Both apps seems to behave well and do not mess with
> each others snapshots so I'm tempted to use both but I think I better
> stick to only one as I might get confused with so many snapshots and
> rollback to the wrong one.
What I would suggest doing in this case is to split out /home to a 
separate filesystem, use snapper for that, and use apt-btrfs-snapshot 
for everything else (except possibly stuff which gets served externally 
by the system, such as /var/www).  That way you get the benefits of 
snapper for the files where that type of snapshotting matters, and 
apt-btrfs-snapshot for where that actually matters, and you have no 
chance of them stepping on each others toes.

Also, make sure to check the settings for snapper, the defaults are 
pathologically bad for most end-users and will quite often put you in a 
bad situation eventually with the filesystem.  What actually works is up 
to your use case, but you almost certainly don't need snapshots more 
frequently than every few minutes.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Snapper & apt-btrfs-snapshot on Ubuntu
  2016-11-02 11:18     ` Ahmed Badr
@ 2016-11-02 11:56       ` Austin S. Hemmelgarn
  0 siblings, 0 replies; 9+ messages in thread
From: Austin S. Hemmelgarn @ 2016-11-02 11:56 UTC (permalink / raw)
  To: badara+ml, linux-btrfs

On 2016-11-02 07:18, Ahmed Badr wrote:
> On Wed, Nov 2, 2016 at 8:31 AM, Alex Powell
> <alexj.powellalt@googlemail.com> wrote:
>> Taking a step back as well- there is also the possibility that you
>> might not need snapshots
>
> I do need it for my root partition at least in the initial phase of
> setting things up and trying out different software. Once the system
> is stable, I might might not need it that much.
So, it's worth mentioning that there are about 4 practical uses for 
snapshots:
1. File versioning/history.  Essentially, usage like Windows File 
History (which uses snapshots and COW on NTFS) or Apples Time Machine. 
This is generally useful to a traditional home user, but in many cases, 
if you actually _need_ file versioning, your better off using a VCS like 
Git or Mercurial.
2. Atomic installs and updates.  This is essentially what 
apt-btrfs-snapshot and the snapper integration in Zypper do, and there 
are other cases of software that do this.  This is generally the most 
useful to traditional end-users.
3. On-system point-in-time copies of specific things.  This is one of 
the things that LVM snapshots are traditionally used for, and isn't 
often useful to end users, but can be for some middle-ware.  In essence, 
this is the same as 2, just for things other than software.
4. Getting a stable view of a live filesystem.  This is important for 
backup software and similar tools.  In essence, by taking a snapshot of 
the filesystem to be backed up, you can guarantee that nothing will 
change as your archiving it.  I don't know of any backup software that 
does this, but the custom backup scripts I use for my personal systems 
do, and we're looking at setting up our custom backup system where I 
work to do so also.

2, 3, and 4 are generally always useful.  For 2, you just need 
apt-btrfs-snapshot.  For 3 just manually creating snapshots is perfectly 
fine, and for 4 manual creation or automatic through your regular backup 
software works.  If you don't need them for the first use, I'd suggest 
just uninstalling snapper, as that's about all it's used for on Ubuntu.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-11-02 11:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02  0:00 Snapper & apt-btrfs-snapshot on Ubuntu Ahmed Badr
2016-11-02  0:19 ` Hans van Kranenburg
2016-11-02 11:25   ` Ahmed Badr
2016-11-02 11:44     ` Austin S. Hemmelgarn
2016-11-02  6:03 ` Duncan
2016-11-02  6:31   ` Alex Powell
2016-11-02 11:18     ` Ahmed Badr
2016-11-02 11:56       ` Austin S. Hemmelgarn
2016-11-02 11:09   ` Ahmed Badr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.