Chapter 6. Managing system upgrades with snapshots


Perform revert capable upgrades of Red Hat Enterprise Linux systems to return to an earlier version of the operating system. You can use Snapshot Manager (snapm), Boom Boot Manager (boom), and the Leapp operating system modernization framework.

Snapshot Manager provides an easy-to-use front end to storage snapshots using LVM2 or Stratis. Snapshot Manager uses a plugin design to automatically find snapshot providers for a list of mount points or block device paths.

Snapshots are created for each given mount point or device (sources) and bound together into a snapshot set. Snapshot Manager integrates with Boom Boot Manager and automatically manages boot entries for system snapshots when you use the --boot or --revert options.

Before performing the operating system upgrades, consider the following aspects:

  • System upgrades with snapshots support revert-protected upgrades if the following conditions are met:

    • The system (and all file systems to be included in the snapshot process) is installed to LVM2 logical volumes or Stratis storage file systems. LVM2 support includes both linear (thick) volumes and thin-provisioned volumes.
    • Enough free space is available to maintain the snapshots for the duration of the upgrade process.
    • You are running at least Red Hat Enterprise Linux 9.6.
  • Revert occurs at the granularity of file system mounts. If the following directories are part of the /var or root file systems, reverting an upgrade will also revert the contents of these directories:

    • /var/log
    • /var/lib/libvirt/images
    • /var/lib/containers

      If this is not desired, consider installing the system to independent volumes to hold the content of the log, images, and containers directories as required. For details on partitions on AMD and Intel 64-bit, and 64-bit ARM architectures, see Recommended partitioning scheme.

  • Ensuring consistency:

    • Snapshot Manager takes snapshots of the running system.
    • File systems are frozen to ensure crash consistency.
    • To ensure application consistency, consider shutting down running services or isolating to a specific systemd unit (for example, rescue.target).
  • System upgrades with snapshots do not work for Red Hat Update Infrastructure (RHUI) systems. Instead of using Snapshot Manager, consider creating snapshots of your virtual machines (VMs).
  • System upgrades with Snapshot Manager are currently unsupported for systems deployed with Image Mode.

6.1. Overview of the Snapshot Manager process

Create a snapshot set by using the snapm command so that you can access, use, and revert to an earlier version of the operating system.

Snapshot Manager can automatically create boot entries that you can select and access from the GRUB boot loader menu. With a snapshot entry, you can boot and access the earlier version of the operating system. With a revert entry in conjunction with the snapm snapset revert command, you can restore the state of the system as it existed before the update attempt.

The following boot entries are part of the upgrade and revert processes:

Upgrade boot entry
Boots the Leapp upgrade environment when using the leapp utility to perform a major version upgrade. Use the leapp utility to create and manage this boot entry. The leapp upgrade process automatically removes this entry.
Red Hat Enterprise Linux 10 boot entry
Boots the upgrade system environment. The leapp utility automatically creates this boot entry after a successful upgrade process.
Snapshot boot entry
Boots the snapshot of the original system. Use it to review and test the earlier operating system state, following a successful or unsuccessful upgrade attempt. Before upgrading the operating system, use the snapm snapset create command with -b (--boot) to create this boot entry.
Revert boot entry

Boots the original system environment after initiating a revert with the snapm snapset revert command. When booted in this way, reverts any upgrade to the earlier system state. Use the snapm snapset create command with -r (--revert) to create this boot entry when initiating a revert of the upgrade procedure.

A separate revert entry protects against a possible removal or modification of the images during the upgrade process, because Boom Boot Manager automatically backs up any boot images required to start the system (vmlinuz and initramfs).

6.2. Size policies

Size policies

With Snapshot Manager you can provide a size policy when creating snapshot sets. The size policy is a hint that specifies how much space is needed for the snapshot content. Different plugins that use different snapshot backends apply size policies in different ways, according to the requirements of individual snapshot providers. For the snapshot data to remain valid during the whole upgrade process, ensure that enough space is available for all types of snapshot.

lvm2cow
The size policy determines the size of the exception store allocated for the snapshot volume. This is a fixed size that can be extended after creation and reflects the maximum amount of change that the snapshot can store. If the space available to the snapshot is exhausted, it is invalidated by the kernel and can no longer be used. For more information, see snapm(8) and lvcreate(8) man pages on your system.
lvm2thin and stratis
The size policies are checked against the available space in the corresponding thin pool at the time the snapshot is created. The space is consumed dynamically from the thin pool as the content of the original volume changes. For more information, see lvmthin(7) and stratis(8) man pages on your system.

In either case, an error occurs if not enough space is available for the specified size policy.

Types of size policy

Snapshot Manager provides four types of size policy:

FIXED
A fixed size with an optional unit suffix, such as MiB, GiB, TiB, and others. For example, 10GiB.
%FREE
A percentage of the free space available from 0 to 100%. For example, 50%FREE.
%USED
A percentage of the space currently consumed on the mount point, as reported by the df command. You can use values greater than 100% to allow the existing content to be completely overwritten without running out of space. This policy can only be applied to snapshot sources that correspond to mounted file systems. For example, 200%USED.
%SIZE
A percentage of the size of the origin volume from 0 to 100%. For example, 75%SIZE.

You can specify size policies as a global default by using the --size-policy argument, or for individual sources by appending a size policy string separated by a colon (:):

  • --size-policy=100%SIZE
  • /:4GiB /var:75%SIZE

Determine the appropriate size policy by examining the space that each file system currently uses, and the space available in the volume groups or thin pools that will be used. If enough space is available, the size policy 100%SIZE ensures that a snapshot origin volume can be completely overwritten without risking the snapshot becoming invalid.

6.3. Upgrading to another version by using Snapshot Manager

Perform an upgrade of your Red Hat Enterprise Linux operating system by using Snapshot Manager.

Prerequisites

  • You are running Red Hat Enterprise Linux 9.6.
  • You have installed the current version of the snapm and boom-boot packages. Use dnf -y install snapm to install Snapshot Manager and its dependencies.
  • You have enough space available for the snapshot set. Make a size estimate based on the size of the original installation. List all the mounted logical volumes and ensure that enough space is available for each volume.
  • You have installed the leapp and leapp-upgrade-el9toel10 packages.

Procedure

  1. Create a named snapshot set of your system volumes, with boot and revert boot entries. For example, if your system consists of separate root and /var file systems, and you want to name the snapshot set before-upgrade:

    # snapm snapset create --boot --revert before-upgrade / /var
    SnapsetName:  	before-upgrade
    Sources:      	/, /var
    NrSnapshots:  	2
    Time:         	2025-04-23 20:41:53
    UUID:         	5e56c455-6285-5f2d-a640-1595eac8381a
    Status:       	Active
    Autoactivate: 	yes
    Bootable:     	yes
    BootEntries:
      SnapshotEntry:  178e20f
      RevertEntry:    6703c58
    Copy to Clipboard

    Where:

    • create creates the snapshot set.
    • --boot enables creation of a snapshot boot entry.
    • --revert enables creation of a revert boot entry.
    • before-upgrade specifies the name of the snapshot set.
    • / /var is the space-separated list of mount points to include in the snapshot set.

    This command automatically creates a boom operating system profile for the running system if one does not already exist. To have more control over the configured operating system profile (for example, to set custom boot options that the running system does not already use), see the boom(8) man page on your system and the boom profile create subcommand.

  2. Upgrade to Red Hat Enterprise Linux 10 using the Leapp utility:

    # leapp upgrade
    ==> Processing phase `configuration_phase`
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase `FactsCollection`
    …
    
    ====> * add_upgrade_boot_entry
        	Add new boot entry for Leapp provided initramfs.
    A reboot is required to continue. Please reboot your system.
    Debug output written to /var/log/leapp/leapp-upgrade.log
    ============================================================
                      	REPORT OVERVIEW
    ============================================================
    HIGH and MEDIUM severity reports:
    	1. Detected modified configuration files in leapp configuration directories.
    	2. Leapp detected loaded kernel drivers which are no longer maintained in RHEL 10.
    	3. GRUB2 core will be automatically updated during the upgrade
    	4. Detected customized configuration for dynamic linker.
    	5. Packages not signed by Red Hat found on the system
    
    Reports summary:
    	Errors:                  	0
    	Inhibitors:              	0
    	HIGH severity reports:   	5
    	MEDIUM severity reports: 	0
    	LOW severity reports:    	3
    	INFO severity reports:   	2
    
    Before continuing, review the full report below for details about discovered problems and possible remediation instructions:
    	A report has been generated at /var/log/leapp/leapp-report.txt
    	A report has been generated at /var/log/leapp/leapp-report.json
    
    ============================================================
                   	END OF REPORT OVERVIEW
    ============================================================
    
    Answerfile has been generated at /var/log/leapp/answerfile
    Reboot the system to continue with the upgrade. This might take a while depending on the system configuration.
    Make sure you have console access to view the actual upgrade process.
    Copy to Clipboard

    Review and resolve any blockers indicated by the leapp upgrade command report. For detailed instructions on the report, see Reviewing the pre-upgrade report.

  3. Reboot into the upgrade boot entry:

    # leapp upgrade --reboot
    ==> Processing phase `configuration_phase`
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase `FactsCollection`
    ...
    Copy to Clipboard

    The Red Hat Enterprise Linux Upgrade Initramfs is marked as the default and will boot automatically.

Verification

  • After completing the upgrade, the system automatically reboots. The GRUB screen shows the upgraded (Red Hat Enterprise Linux 10) and the earlier version of the available operating system. The upgraded system version is the default selection.

6.4. Switching between Red Hat Enterprise Linux versions

Access the current and earlier Red Hat Enterprise Linux versions on your machine. Using Snapshot Manager and the entries created in the GRUB boot loader menu to access different operating system versions reduces the risk associated with upgrading an operating system, and also helps reduce downtime. With this ability to switch between environments, you can:

  • Quickly compare both environments.
  • Switch between environments while evaluating the result of the upgrade.
  • Recover older content of the file system.
  • Continue accessing the old system, while the upgraded host is running.
  • Halt and revert the update process at any time, even if the upgrade itself fails.

Procedure

  1. Reboot the system:

    # reboot
    Copy to Clipboard
  2. Select the required boot entry from the GRUB boot loader screen.

Verification

  • Check the kernel version:

    • For the snapshot environment:

      # uname -r
      5.14.0-558.el9.x86_64
      Copy to Clipboard
    • For the upgraded environment:

      # uname -r
      6.12.0-83.el10.x86_64
      Copy to Clipboard
  • Check the root device:

    • For the snapshot environment:

      # findmnt /
      TARGET SOURCE                                                    FSTYPE OPTIONS
      /      /dev/mapper/rhel-root-snapset_before-upgrade_1745441237_- xfs    rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota
      Copy to Clipboard
    • For the upgraded environment:

      # findmnt /
      TARGET SOURCE                FSTYPE OPTIONS
      /      /dev/mapper/rhel-root xfs    rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota
      Copy to Clipboard

6.5. Deleting the snapshot set after a successful upgrade

If you have successfully upgraded your system by using Snapshot Manager, you can remove the snapshot set. Deleting the snapshot set automatically deletes any corresponding boot entries.

Important

You cannot perform any further operations with the snapshot set after you delete it.

Prerequisites

Procedure

  1. Boot into Red Hat Enterprise Linux 10 from the GRUB boot loader screen.
  2. After the system loads, view the available snapshot sets. The following output shows the before-upgrade snapshot set in the list of snapshot sets:

    # snapm snapset list
    SnapsetName      Time                 NrSnapshots Status  Sources
    before-upgrade   2025-04-23 21:47:17            2 Active  /, /var
    Copy to Clipboard
  3. Delete the snapshot set by name:

    # snapm snapset delete before-upgrade
    Copy to Clipboard
  4. Complete the remaining post-upgrade tasks. For details, see Upgrading from RHEL 9 to RHEL 10.

6.6. Reverting after an unsuccessful update

To revert the operating system upgrade back to the previous state of the system after an unsuccessful upgrade, use the snapm snapset revert command. This can also be helpful if you find a problem with the upgraded environment, for example, incompatibility with in-house software.

To start the revert, use the snapshot boot environment.

Prerequisites

Procedure

  1. Start the revert operation:

    # snapm snapset revert before-upgrade
      Delaying merge since origin is open.
      Merging of snapshot rhel/root-snapset_before-upgrade_1745441237_- will occur on next activation of rhel/root.
      Delaying merge since origin is open.
      Merging of snapshot rhel/var-snapset_before-upgrade_1745441237_-var will occur on next activation of rhel/var.
    WARNING - Snaphot set before-upgrade is in use: reboot required to complete revert
    WARNING - Boot into 'Revert before-upgrade 2025-04-23 21:47:17 (5.14.0-558.el9.x86_64)' to continue
    Copy to Clipboard
    Warning

    After you revert the snapshot set, you must continue with all the remaining steps in this procedure to prevent data loss.

  2. Reboot your machine to restore the operating system state:

    # reboot
    Copy to Clipboard
  3. Select the Revert boot entry from the GRUB screen. When the system volumes are active, the system automatically starts the snapshot revert operation.

    Important

    When the merge operation starts, the snapshot volume is no longer available. Starting the revert operation automatically deletes the snapshot boot entry.

  4. After you complete the merge operation, remove the unused entries:

    # rm -f /boot/loader/entries/*.el10*
    Copy to Clipboard
    # rm -f /boot/*.el10*
    Copy to Clipboard
  5. After a successful revert to the system, delete the revert boot entry by using the boom command:

    # boom list -o+title
    BootID  Version                  Name                     RootDevice            Title
    34d576e 5.14.0-546.el9.x86_64    Red Hat Enterprise Linux /dev/mapper/rhel-root Red Hat Enterprise Linux (5.14.0-546.el9.x86_64) 9.6 (Plow)
    b737685 5.14.0-558.el9.x86_64    Red Hat Enterprise Linux /dev/mapper/rhel-root Red Hat Enterprise Linux (5.14.0-558.el9.x86_64) 9.6 (Plow)
    6703c58 5.14.0-558.el9.x86_64    Red Hat Enterprise Linux /dev/rhel/root        Revert before-upgrade 2025-04-23 21:47:17 (5.14.0-558.el9.x86_64)
    Copy to Clipboard
    # boom delete 6703c58
    Deleted 1 entry
    Copy to Clipboard
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat