Table of Contents
This chapter describes the handling of the root file system. In general
transactional-update will not modify any
other subvolumes or file systems: Information stored on these mounts
(such as /var
or
/home
) is usually not supposed
to be rolled back. See Chapter 4, System setup for a real world
setup.
There are exceptions for a few dedicated subvolumes such as
/boot/grub2/x86_64-efi
which
also have to be available to be able to update the bootloader; these
directories will be bind mounted into the update environment.
transactional-update is based around several concepts of the Btrfs file system, a general purpose Copy-on-Write (Cow) filesystem with snapshot and subvolume support, though support for other file systems is possible (see Chapter 6, Porting to other systems for requirements and porting information).
transactional-update is wrapping all binaries which will modify the file system with tukit, which will in turn use chroot to execute the command in the new snapshot. That way e.g. zypper will install packages into the new snapshot only.
In essence the logic of transactional-update can be summarized as follows:
SNAPSHOT_ID=`snapper create --read-write -p -d "Snapshot Update"`
zypper -R ${SNAPSHOT_DIR} up|patch|dup|...
btrfs property set ${SNAPSHOT_DIR} ro true
btrfs subvol set-default ${SNAPSHOT_DIR}
systemctl reboot