[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Live Fille System Backup

Hash: SHA1

On Tue, May 09, 2017 at 12:03:14PM +0000, Curt wrote:


> Because someone mentioned Btrfs and its backup "magic," I'm looking at
> the wiki, which says (amongst other things):
> https://btrfs.wiki.kernel.org/index.php/Incremental_Backup
>  Instant, Atomic COW Snapshots
>   Since the snapshots are atomic, when a snapshot is restored it appears to
>   applications as if a power loss had occurred (and the filesystem has gone back
>   to an earlier state). Thus it is possible to backup databases without stopping
>   them beforehand. 
> I don't know what an atomic cow is (maybe some poor bovine living near
> Chernobyl) but it sounds interesting.

COW stands for "copy-on-write". The idea is that you don't overwrite whatever
you are trying to change, but make a copy first, munge that and when you are
done, you swap old and new.

If that "whatever" happens to be a virtual memory page, there's support
from the operating system kernel, supported by the virtual memory hardware
(the trick is typically that the page is, from the outset, marked as
"read only", and when something tries to write it, a fault is triggered;
this is all typically hardware supported; then the fault handler is
called, which duplicates the page and routes the writes to the fresh

The "atomic" part is that things are set up carefully in a way that
at the end, regardless of when you shot the thing in the head, you
see either the whole change or nothing. Standard fare for file systems
and databases these days.

(Far from trivial, though. One of the standard tricks databases, ZFS
and btrfs use, afaik, is they have their backbone as a B-tree. Whenever
something has to be updated, it typically runs from one node (perhaps
a leaf) all the way back to the root. This whole path is constructed
by copying all the touched nodes (when the thing dies here nothing
has changed!) and at the end, replacing the root node in one (hopefully
atomic) operation. After that, the change is permanent.

COW has to be one of the nice acronyms, though.

> I wonder if Btrfs has any notable drawbacks as a file system.

It's pretty young, as file systems go. And ext4 is so rock-solid and
trusted that btrfs doesn't get the broad exposure it'd need for
trust to be built. Sysadmin is a conservative and fainthearted
bunch :-)

> BTW, I learned (by way of your least favorite search engine) that the inventor
> of the Monoyer chart (Ferdinand Monoyer) embedded his name (and occupation--DM,
> docteur en médecine) in the chart (beginning on the penultimate line, the last
> and first letters read vertically upwards).
> These French are clever devils.

They are. And they are friendly and know what a good meal is.
Looking forward to my next vacation there :-D

- -- t
Version: GnuPG v1.4.12 (GNU/Linux)


Reply to: