Chapter 6. Managing system upgrades with snapshots
Perform rollback capable upgrades of Red Hat Enterprise Linux systems to return to an earlier version of the operating system. You can use the Boom Boot Manager and the Leapp operating system modernization framework.
Before performing the operating system upgrades, consider the following aspects:
-
System upgrades with snapshots do not work on multiple file systems in your system tree, for example, a separate
/varor/usrpartition. - System upgrades with snapshots do not work for the Red Hat Update Infrastructure (RHUI) systems. Instead of using the Boom utility, consider creating snapshots of your virtual machines (VMs).
6.1. Overview of the Boom process Copy linkLink copied to clipboard!
Create boot entries using the Boom Boot Manager so you can select and access these entries from the GRUB boot loader menu. Creating boot entries simplifies the process of preparation for a rollback capable upgrade.
The following boot entries are part of the upgrade and rollback processes:
Upgrade boot entryBoots the Leapp upgrade environment. Use the
leapputility to create and manage this boot entry. Theleappupgrade process automatically removes this entry.Red Hat Enterprise Linux 9 boot entryBoots the upgrade system environment. Use the
leapputility to create this boot entry after a successful upgrade process.Snapshot boot entryBoots the snapshot of the original system. Use it to review and test the previous operating system state, following a successful or unsuccessful upgrade attempt. Before upgrading the operating system, use the
boomcommand to create this boot entry.Rollback boot entryBoots the original system environment and rolls back any upgrade to the previous system state. Use the
boomcommand to create this boot entry when initiating a rollback of the upgrade procedure.
6.2. Upgrading to another version using Boom Boot Manager Copy linkLink copied to clipboard!
Perform an upgrade of your Red Hat Enterprise Linux operating system by using the Boom Boot Manager.
Prerequisites
- You are running Red Hat Enterprise Linux 8.8 or 8.10.
-
You have installed the current version of the
boom-bootpackage (version boom-boot-1.3-2.el8 or later). - You have sufficient space available for the snapshot. Make a size estimate based on the size of the original installation. List all the mounted logical volumes.
-
You have installed the
leapppackage. - You have enabled software repositories.
Additional file systems might include /usr or /var.
Procedure
Create a snapshot of your root logical volume:
If your root file system uses thin provisioning, create a thin snapshot:
lvcreate -s rhel/root -kn -n root_snapshot_before_changes Logical volume "root_snapshot_before_changes" created.
# lvcreate -s rhel/root -kn -n root_snapshot_before_changes Logical volume "root_snapshot_before_changes" created.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Here:
-
-screates the snapshot. -
rhel/rootcopies the file system to the logical volume. -
-knautomatically activates LV at boot time. -n root_snapshot_before_changesshows the name of the snapshot.While creating a thin snapshot, do not define the snapshot size. The snapshot is allocated from the thin pool.
-
If your root file system uses thick provisioning, create a thick snapshot:
lvcreate -s rhel/root -n root_snapshot_before_changes -L 25g Rounding up size to full physical extent 25 GiB Logical volume "root_snapshot_before_changes" created.
# lvcreate -s rhel/root -n root_snapshot_before_changes -L 25g Rounding up size to full physical extent 25 GiB Logical volume "root_snapshot_before_changes" created.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command:
-
-screates the snapshot. -
rhel/rootcopies the file system to the logical volume. -
-n root_snapshot_before_changesshows the name of the snapshot. -L 25gis the snapshot size. Make a size estimate based on the size of the original installation.While creating a thick snapshot, define the snapshot size that can hold all the changes during the upgrade.
ImportantThe created snapshot does not include any additional system changes.
-
Create the profile:
Creating a profile requires an architecture-specific workaround to avoid an interaction between
kexec-toolsorkdumpctlandboom. During the upgrade, the updatedkexec-toolspackage attempts to modify all boot entries with updatedcrashkernelsettings. This deletes the boot images used by the entry. You can avoid this by appending the RHEL 9crashkernelsettings to the RHEL 8 profile options.On an Intel 64 or AMD64 (x86_64), or IBM Z (s390x) architecture:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On an 64-bit ARM (AArch64) architecture:
boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=1G-4G:256M,4G-64G:320M,64G-:576M"# boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=1G-4G:256M,4G-64G:320M,64G-:576M"Copy to Clipboard Copied! Toggle word wrap Toggle overflow On an IBM POWER little-endian (ppc64le) architecture:
boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G" --optional-keys "grub_users grub_arg grub_class id"# boom profile create --from-host --os-options "root=%{root_device} ro %{root_opts} rhgb quiet crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G" --optional-keys "grub_users grub_arg grub_class id"Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
--optional-keysargument is required on ppc64le to ensure that thegrub2-mkconfigcommand generates the correct boot entry in step 10.2.3. For more information, see RHEL-36180.
Create a snapshot boot entry of the original system using backup copies of the original boot images:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Here:
-
--title "Root LV snapshot before changes"is the name of the boot entry, that shows in the boot entry list during system startup. --rootlvis the root logical volume that corresponds to the new boot entry.After you complete the previous step, you have a boot entry that enables access to the original system, before the upgrade.
Ignore "WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'". For details, see RHEL-35983.
On systems with ppc64le architecture, update boot entries:
grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Generating boot entries from BLS files... done
# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Generating boot entries from BLS files... doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Upgrade to Red Hat Enterprise Linux 9 using the Leapp utility:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Review and resolve any blockers indicated by the
leapp upgradecommand report. For detailed instructions on the report, see Reviewing the pre-upgrade report.Reboot into the upgrade boot entry:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Select the Red Hat Enterprise Linux Upgrade Initramfs entry from the GRUB boot screen.
NoteThe Snapshots submenu from the GRUB boot screen is not available in Red Hat Enterprise Linux 9.
Verification
- After completing the upgrade, the system automatically reboots. The GRUB screen shows the upgraded (Red Hat Enterprise Linux 9) and the previous version of the available operating system. The upgraded system version is the default selection.
6.3. Switching between Red Hat Enterprise Linux versions Copy linkLink copied to clipboard!
Access simultaneously current and previous Red Hat Enterprise Linux versions on your machine. Using the Boom Boot Manager to access different operating system versions reduces the risk associated with upgrading an operating system, and also helps reduce hardware downtime. With this ability to switch between environments, you can:
- Quickly compare both environments in a side-by-side fashion.
- 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 while the update itself is running.
Procedure
Reboot the system:
reboot
# rebootCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Select the required boot entry from the GRUB boot loader screen.
Verification
Verify that the selected boot volume is displayed:
cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-513.24.1.el8_9.x86_64.boom0 root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
# cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-513.24.1.el8_9.x86_64.boom0 root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512MCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Deleting the logical volume snapshot after a successful upgrade Copy linkLink copied to clipboard!
If you have successfully upgraded your system by using the Boom Boot Manager, you can remove the snapshot boot entry and the logical volume (LV) snapshot to use the upgraded system.
You cannot perform any further operations with the LV snapshot after you delete it.
Prerequisites
- You have recently upgraded your Red Hat Enterprise Linux to a later version by using the Boom Boot Manager.
Procedure
- Boot into Red Hat Enterprise Linux 9 from the GRUB boot loader screen.
After the system loads, view the available boot entries. The following output shows the snapshot boot entry in the list of boom boot entries:
boom list BootID Version Name RootDevice 1e1a9b4 4.18.0-513.5.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/mapper/rhel-root 4ea37b9 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/mapper/rhel-root c919f89 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/rhel/root_snapshot_before_changes
# boom list BootID Version Name RootDevice 1e1a9b4 4.18.0-513.5.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/mapper/rhel-root 4ea37b9 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/mapper/rhel-root c919f89 4.18.0-513.24.1.el8_9.x86_64 Red Hat Enterprise Linux /dev/rhel/root_snapshot_before_changesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the snapshot entry by using the
BootIDvalue:boom delete --boot-id c919f89 Deleted 1 entry
# boom delete --boot-id c919f89 Deleted 1 entryCopy to Clipboard Copied! Toggle word wrap Toggle overflow This deletes the boot entry from the GRUB menu.
Remove the LV snapshot:
lvremove rhel/root_snapshot_before_changes Do you really want to remove active logical volume rhel/root_snapshot_before_changes? [y/n]: y Logical volume "root_snapshot_before_changes" successfully removed# lvremove rhel/root_snapshot_before_changes Do you really want to remove active logical volume rhel/root_snapshot_before_changes? [y/n]: y Logical volume "root_snapshot_before_changes" successfully removedCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Complete the remaining post-upgrade tasks. For details, see Upgrading from RHEL 8 to RHEL 9.
6.5. Creating a rollback boot entry after an unsuccessful upgrade Copy linkLink copied to clipboard!
To revert the operating system upgrade back to the previous state of the system after an unsuccessful upgrade, use a rollback boot entry. This can also be helpful if you find a problem with the upgraded environment, for example, incompatibility with in-house software.
To prepare the rollback boot entry, use the snapshot environment.
Prerequisites
- You have a snapshot. For instructions for creating a snapshot, see Upgrading to another version using Boom boot manager.
Procedure
Merge the snapshot with the original volume:
lvconvert --merge rhel/root_snapshot_before_changes Logical volume rhel/root_snapshot_before_changes contains a filesystem in use. Delaying merge since snapshot is open. Merging of thin snapshot rhel/root_snapshot_before_changes will occur on next activation of rhel/root.
# lvconvert --merge rhel/root_snapshot_before_changes Logical volume rhel/root_snapshot_before_changes contains a filesystem in use. Delaying merge since snapshot is open. Merging of thin snapshot rhel/root_snapshot_before_changes will occur on next activation of rhel/root.Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningAfter you merge the snapshot, you must continue with all the remaining steps in this procedure to prevent data loss.
Create a rollback boot entry for the merged snapshot:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ignore all WARNING messages, see RHEL-35983.
Reboot your machine to restore the operating system state:
reboot
# rebootCopy to Clipboard Copied! Toggle word wrap Toggle overflow - After the system reboots, select the RHEL Rollback boot entry from the GRUB screen.
When the
rootlogical volume is active, the system automatically starts the snapshot merge operation.ImportantWhen the merge operation starts, the snapshot volume is no longer available. After successfully booting the RHEL Rollback boot entry, the Root LV snapshot boot entry no longer works. Merging the snapshot logical volume destroys the Root LV snapshot and restores the prior state of the original volume.
After you complete the merge operation, remove the unused entries and restore the original boot entry:
Remove the unused Red Hat Enterprise Linux 9 boot entries from the
/bootfile system and rebuild thegrub.cfgfile for the changes to take effect:rm -f /boot/loader/entries/*.el9*
# rm -f /boot/loader/entries/*.el9*Copy to Clipboard Copied! Toggle word wrap Toggle overflow rm -f /boot/*.el9*
# rm -f /boot/*.el9*Copy to Clipboard Copied! Toggle word wrap Toggle overflow grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... done
# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow
After a successful rollback to the system, delete the
boomsnapshot and rollback boot entries:Copy to Clipboard Copied! Toggle word wrap Toggle overflow boom delete c919f89 WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only Deleted 1 entry
# boom delete c919f89 WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only Deleted 1 entryCopy to Clipboard Copied! Toggle word wrap Toggle overflow boom delete 6c44638 WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only Deleted 1 entry
# boom delete 6c44638 WARNING - Options for BootEntry(boot_id=1e1a9b4) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=1ccc554) do not match OsProfile: marking read-only WARNING - Options for BootEntry(boot_id=4ea37b9) do not match OsProfile: marking read-only Deleted 1 entryCopy to Clipboard Copied! Toggle word wrap Toggle overflow Ignore the warnings. For details, see RHEL-35983.