Re: backup snapshot

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

 



On Tue, Aug 11, 2015 at 1:56 PM, jd1008 <jd1008@xxxxxxxxx> wrote:
>
>
> On 08/11/2015 01:27 PM, Chris Murphy wrote:
>>
>> The other context for snapshots are system rollbacks, which is on a
>> sliding continuum between stateless vs stateful systems. So you can
>> get certain aspects of statelessness with snapshots, with an otherwise
>> stateful system. This is how Windows has done updates for a long time
>> now, and snapper, and Fedora Atomic (rpm-ostree) work. The underlying
>> technical details of how the snapshot is achieved are dissimilar, but
>> the basic idea is the same which is you have multiple trees and can
>> revert to previous states.
>>
>> So maybe it's better to call these rollbacks in terms of "user
>> selectable stateful states" haha. Whereas statelessness is like a
>> system reset: such as what we find on mobile devices, and since
>> Windows 8.
>>
>> Is restoring an rsync backup to a currently running system a rollback?
>> It's not atomic, and unless you first backup the current state you
>> can't then do a rollforward after you've done the rollback because
>> you've overwritten the current state with the backup. And since the
>> overwrite happens with in-use files, it's not atomic. Any mistakes and
>> it can easily implode the system in a way that you can't go forward or
>> backward to get to a bootable system and you're in diagnose and repair
>> mode.
>>
>> NTFS shadow copy, snapper+Btrfs (or LVM thinp), and rpm-ostree are all
>> atomic rollbacks. I think it can be argued that rollbacks imply the
>> expectation of atomicity. Otherwise you'd just say "restoring from
>> backup" or "doing a system restore/rebuild from backup".
>>
>>
> Thanx Chris for this elucidation.
> However, it is still not clear how one can do an atomic rollback
> when the currently booted system and perhaps logged in user
> has (have) already modified some files. How does one proceed then?
> Save the files modified since last backup or snapshot, do the restoration/
> rollback, and then go through the tedious process of comparing
> the just saved files against the ones brought by rollback?
> How does one proceed in such a situation?

There's the big picture point of view:

It depends on the snapshot+rollback strategy and underlying storage
technology involved.

It's possible that the snapshot taken is used for rollback; or it can
be the thing updates are applied to.

For snapper+btrfs+yast (on opensuse 13.2) the behavior is to take a
snapshot before any configuration changes including adding or deleting
packages. So the current state is snapshot, then the current state is
modified. A rollback means reverting to a snapshot, which has two
kinds: temporary via GRUB menu, and persistent via a yast or snapper
command.

For ostree and rpm-ostree (Fedora Atomic), the behavior isn't a
filesystem snapshot in a Btrfs sense because this works on plain ext4
and XFS by using uniquely named directory "trees" and hardlinks. So a
new tree "faux-snapshot" is setup with a bunch of hardlinks, and then
that new directory tree is what gets the updates. The currently active
tree is not modified. There is no need for a rollback if the update
fails, because the current tree was never modified.

And then there's the detailed view:

The different strategies above have different layouts to separate out
what things are rolled back and not. For example there's never a
snapshot or rollback of /home. Your /home files are always progressing
unidirectionally through time, no matter what. And the same thing
applies to /etc and much of /var. So if you make a mistake with some
system settings, those don't get rolled back with the above
strategies.

Could you have more granularity so you could snapshot and rollback
such things? Sure. But someone would have to do that implementation
work and test it. And probably it'd need to be something fairly
agnostic file system wise so it works on anything; which could just be
a simple config file rename and versioning scheme. If it were Btrfs
based you could very cheaply snapshot these things separate from other
directories and for selective rollback of one file use cp --reflink
behind the scenes.


-- 
Chris Murphy
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux