ROSA Freeze

From Rosalab Wiki
Revision as of 14:09, 28 August 2014 by D uragan (Talk | contribs) (Additional Information: оформление)

Jump to: navigation, search

ROSA is a constantly evolving distribution which regularly gets large amounts of updates. By these updates, we try to add new features to your systems and improve existing ones. However, sometimes (very rare!) it happens that these updates are not completely correct and break something. In addition, many ROSA users and community members are enthusiasts who often try different new programs. In particular, they can install programs from repositories that have nothing common with ROSA ones. Sooner or later, such programs can cause conflicts with system packages or policies and even break the system or some of its applications. As a result, for many users it is important to have a way to safely rollback the system to a working state.

If you are familiar with RPM packages then you can perform package rollback by means of [1] or [2]. However, these tools can't guarantee that the whole system will be returned to a working state - since the breakage can be caused not by a package update, and in addition some packages can't be safely downgraded.

If you expect that breaking changes will occur to your system during your session that you will likely want to rollback, you can try ROSA Freeze. When using ROSA Freeze, your operating system can act in one of two modes — a usual one and a "frozen" one. When using a frozen mode, ROSA Freeze mounts an "interceptor" over every top-level directory (/bin, /etc, /usr and others; this list can be changed y administrator) by means of aufs. These interceptors can be located in either tmpfs or on a separate partition. Any modification made in a "frozen" folder in reality goes to its interceptor, while the state of original folder remains the same. After system reboot all the content of these interceptors is automatically removed and thus the system is rolled back to its initial state. Note that after reboot the system will remain frozen; you should explicitly disable this mode by means of rfreeze tool. And to be sure, while working in a frozen mode, at any moment you can merge all the changes made into aufs to the original folders.

ROSA Freeze tool is located in the rosa-freeze package. Currently the tool should be launched in console with root privileges. To check its functionality, you can ask the tool about current status of ROSA Freeze:

# rfreeze status

To enter the "frozen" mode, run

# rfreeze enable

The system will be frozen immediately, no reboot is required. After reboot, the system will remain frozen. To unfreeze it, launch

# rfreeze disable

After this command it is necessary to reboot the machine.

while the system is run in the frozen mode, all changes made by user to the frozen folders will be automatically discarded after system reboot. But if you suddenly understands that you want to save all your changes, you can merge them by launching

# rfreeze merge

After this command, the current state of your system will become the base one.

Note that the "merge" command is considered to be experimental at the moment. In particular, it doesn't handle situations when some frozen folders are mounted from separate partitions different from the root one.

What Is Actually Frozen?

By default, ROSA Freeze freezes all top-level folders except the following:

  • /dev
  • /home
  • /lost+found
  • /media
  • /mnt
  • /proc
  • /run
  • /sys
  • /tmp

For every other top-level folder a separate interceptor is created inside /tmp/sysroot-rw directory which can be located in tmpfs or on a separate partition. This interceptor is mounted using aufs over the original folder so all the changes go to /tmp/sysroot-rw.

For example, by means of aufs we mount /tmp/sysroot-rw/bin over /bin. If user modifies something inside /bin then the actual changes happen in /tmp/sysroot-rw/bin, while the original /bin remains the same. But thanks to aufs, user doesn't notice this during his session and sees all his changes in /bin until reboot.

Original versions of all frozen folders can be checked at any moment inside the /tmp/sysroot-ro directory.

Additional Information

To get all options and features supported by the version of ROSA Freeze installed in your system, launch

# rfreeze --help

Source code of the program is distributed under the BSD license and is available at https://abf.rosalinux.ru/soft/rosa-freeze