linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: "Senén Vidal Blanco" <senenvidal@sgisoft.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: Storage and snapshots as historical yearly
Date: Mon, 11 Sep 2017 14:49:05 -0400	[thread overview]
Message-ID: <07ff0aeb-d4a8-ffb9-3a13-695ab9b2e65f@gmail.com> (raw)
In-Reply-To: <9208764.SjP1vfhOIA@pcsenen>

On 2017-09-11 14:17, Senén Vidal Blanco wrote:
> I am trying to implement a system that stores the data in a unit (A) with
> BTRFS format that is untouchable and that future files and folders created or
> modified are stored in another physical unit (B) with BTRFS format.
> Each year the new files will be moved to store A and start over.
>   
> The idea is that a duplicate of disk A can be made to keep it in a safe place
> and that the files stored there can not be modified until the mixture of (A) and
> (B) is made.
Before I get into anything further, I would like to comment that this is 
a very odd use case.  Yearly granularity doesn't make sense for backups 
unless you generate very little data throughout the year (otherwise 
backups will take forever) and can afford to lose multiple months of 
that data.

The timescale you're talking about combined with the requirement that 
files not be modifiable on A except during the times when you sync 
changes indicates you will probably be much better served by proper 
off-line archival storage than some online configuration as you appear 
to be trying to create.
>   
> I have looked for information on this but I do not see it very clear. Both
> "SEND" and "RECEIVE" do the opposite case to what interests me.
If you can afford to operate at a shorter timescale (even monthly), then 
BTRFS snapshots plus send and receive probably are one of the best 
options.  Perhaps you could explain your understanding of send and 
receive and why you think it won't work, and I (and possibly other 
people on the list as well) could confirm whether or not you understand 
correctly.
>   
> I have also seen that you could try to get a RAID 0 but I am afraid that the
> data in A will not remain intact if the system performs a "BALANCE" at some
> point and mixes data between (A) and (B).
>   
> It is assumed that both the (A) and (B) data will be displayed in the same
> structure transparently, for example in "/ home".
>   
> -------------------------------
> |             HOME            |
> | ------------   ------------ |
> | |          |   |          | |
> | |          |   |          | |
> | | DISK (A) |   | DISK (B) | |
> | |  BTRFS   |   |  BTRFS   | |
> | |          |   |          | |
> | ------------   ------------ |
> -------------------------------
What you are describing here is called an overlay or union mount. 
Source A would be your lower directory, and B would be your upper 
directory.  Unmodified data is passed through from the lower directory 
until a file is changed.  When changes are made to the overlay mount, 
they are reflected on the upper directory.  Special files called 
'whiteout' files are used in the upper directory to represent deleted items.

Unfortunately, I don't know of any overlay mount implementation that 
works correctly and reliably with BTRFS.  I know for a fact that 
OverlayFS (the upstream in-kernel implementation) does not work, and I 
believe that AUFS3 and UnionFS (the third-party options that are used by 
most LiveCD's) don't work either.  UnionFS-FUSE (a userspace 
implementation completely unrelated to UnionFS) might work, but I've 
never tested it and it will likely have performance issues because it's 
implemented in userspace.  As far as I know, whiteout support is the 
primary missing piece here, but I may be mistaken.

Alternatively, this could be done with a seed device.  The concept is 
pretty similar to an overlay mount, but it operates at a lower level, 
and it's a BTRFS specific feature.  Unfortunately, it's not well 
documented, and I'm not confident that I could explain how to do it 
correctly.

  reply	other threads:[~2017-09-11 18:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 18:17 Storage and snapshots as historical yearly Senén Vidal Blanco
2017-09-11 18:49 ` Austin S. Hemmelgarn [this message]
2017-09-11 21:36   ` Pete
2017-09-12 12:16     ` Austin S. Hemmelgarn
2017-09-13 11:51       ` Pete
2017-09-13 12:26         ` Austin S. Hemmelgarn
2017-09-19 19:09   ` Senén Vidal Blanco
2017-09-12  3:34 ` Andrei Borzenkov
2017-09-19 11:49   ` Senén Vidal Blanco
2017-09-19 18:33     ` Andrei Borzenkov
2017-09-19 19:19       ` Austin S. Hemmelgarn
2017-09-21 10:07       ` Senén Vidal Blanco

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=07ff0aeb-d4a8-ffb9-3a13-695ab9b2e65f@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=senenvidal@sgisoft.com \
    /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;
as well as URLs for NNTP newsgroup(s).