Features/SystemRollbackWithBtrfs

From FedoraProject

Jump to: navigation, search

Contents

System Rollback With Btrfs

Summary

If a user has chosen to use Btrfs on one or more partitions, this feature will:

  1. automatically create new disk snapshots before each yum transaction
  2. enable the user to change which snapshot will be next booted into, if desired
  3. enable the user to manually create a new snapshot, if desired

All of the above will require superuser privileges.

Owner

Current status

Detailed Description

Btrfs is capable of creating lightweight filesystem snapshots that can be mounted (and booted into) selectively. The created snapshots are copy-on-write snapshots, so there is no file duplication overhead involved for files that do not change between snapshots.

It's important to note that these snapshots are whole-filesystem snapshots -- while we propose to create a new snapshot each time a yum transaction happens, that doesn't mean reverting to an earlier snapshot will only revert the files changed by yum! The entire root filesystem will be reverted, including users' home directories if they are on btrfs. (Because of this, a user may decide to keep /home on a separate, non-btrfs partition where it is unaffected by rollbacks they decide to initiate.)

A "rollback" to an older snapshot is not destructive to data. It switches to an earlier snapshot, and later snapshots are still available afterwards. We allow the user to choose which snapshot will be mounted next, and making that choice does not affect or destroy any other snapshots.

We are not proposing Btrfs to be the default filesystem for Fedora 13; this feature would only be present on installs where Btrfs has been optionally chosen for at least one filesystem.

Benefit to Fedora

There are several interesting use cases for this feature:

Of these, the ability for our developers to feel comfortable tracking Rawhide without fear of an unusable install seems to have the most immediate utility to Fedora.

Scope

We propose to create:

How To Test

The test plan will look something like:

User Experience

There will be new options available if your disk contains btrfs filesystems and you run palimpsest. If there is a mounted btrfs partition, palimpsest will offer a selection of old snapshots to use at next mount, and offer the creation of new ones. If there are no btrfs mounts, the UI will be entirely unchanged.

If the grub subfeature is completed, and a user has chosen to use btrfs as their boot filesystem, users will see a list of date/timestamps corresponding to snapshots that they can select from by interrupting grub at boot-time.

Dependencies

All of the support needed for btrfs snapshots should be already present in the kernel. The patch to support btrfs in grub has not been committed to grub1 so far (although we note that Gentoo already carries it locally). We would have to persuade the Fedora Grub maintainer(s) to adopt the patch for the grub subfeature to be completed.

Contingency Plan

None necessary, revert if not completed.

Documentation

Here is generic documentation on btrfs snapshots:

There will be significant documentation work needed to explain the following about this feature:

Release Notes

Comments and Discussion