How to create a BOOM boot entry

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9

Issue

  • Need to create an auxiliary boot entry using Boom for an LVM2 logical volume snapshot of the root file system.

Resolution

  • Ensure the proper packages are installed per What is BOOM and how to install it?
  • You’ll need to have spare storage in your volume group in order to create the LVM snapshots. There should be sufficient space allocated to the snapshot to accommodate the changes applied by the update. A simple rule of thumb that will always yield enough space (but which may require more space than absolutely necessary) is to make the snapshot the same size as the consumed space on the volume, as reported by tools like df . If you need to add storage please see How to extend a logical volume and its filesystem online in Red Hat Enterprise Linux? Additionally you can use the vgs and lvs commands to determine free space on your volume groups and info for existing logical volumes, respectively.

Create a snapshot of your root volume:

[root@host]# lvcreate --size SNAPSHOT_SIZE --snapshot --name snap_root rhel/root
  Logical volume "snap_root" created.

Use the size determined at the first step in place of SNAPSHOT_SIZE. Note that LVM2 supports human readable unit suffixes such as ‘m’, ‘g’, ‘t’ etc. - see the LVM2 manual pages for further details. Also note that LVM2 thinly provisioned snapshots may be used in exactly the same way if a thin pool has been configured in the system volume group.

Boom uses a template-driven system for generating boot entries for different operating systems. Before creating the boot entry, it is necessary to create an OsProfile with the necessary template definitions. This can be done using default values obtained from the running system, or the user can specify command line options to customize the profile. See the manual pages for the boom.8 command for further information. Future releases of boom for Red Hat Enterprise Linux 8 will include a built-in profile for the operating system, making this step unnecessary.

Create the OS profile:

[root@localhost libblockdev]# boom profile create --from-host --uname-pattern el8
Created profile with os_id e6f881a:
  OS ID: "e6f881ae3f8a2e010375fb840bb4f386b330db6e",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "8.0 (Ootpa)", Version ID: "8.0",
  UTS release pattern: "el8",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}"

The uname pattern is a regular expression that is matched against the system kernel version to determine it the running system matches a given Os Profile. By setting this to “el8”, boom will automatically detect the correct Os Profile when creating or modifying boot entries.

The newly created profile is displayed on the terminal. The profile may be modified either by using the boom profile edit command, or by deleting and then re-creating it. It is also possible to clone profiles, for example to make changes to the existing template. See the manual page for further information on manipulating and editing profiles.

Once the profile has been set up it is possible to create new auxiliary boot entries for the system that will appear in the system bootloader menu.

Create boot entry for the root logical volume snapshot:

[root@localhost libblockdev]# boom create --title "RHEL Snapshot" --root-lv rhel/snap_root
Created entry with boot_id 0d0f768:
  title RHEL Snapshot
  machine-id 535a443e291d42bea50b989701c5a851
  version 4.18.0-48.el8.x86_64
  linux /vmlinuz-4.18.0-48.el8.x86_64
  initrd /initramfs-4.18.0-48.el8.x86_64.img
  options root=/dev/rhel/snap_root ro rd.lvm.lv=rhel/snap_root

For RHEL 7 hosts if you have not previously configured boom on this system, it is necessary to re-create the Grub2 config.
How do I permanently modify the kernel command line in RHEL 7?
This step is not needed on RHEL 8 as it uses BLS by default - do not modify the Grub2 config in RHEL 8.

Other options, such as the kernel version to boot, or the kernel options string (kernel command line) may be specified on the command line if desired. Any missing information is taken from the running system (for example, the running kernel version), or generated from the appropriate Os Profile templates.

Once completed, the system can be rebooted. On the grub spash screen there should be an entry for "RHEL Snapshot". Selecting this entry will allow boot to the alternate root.

For demonstrations using Boom see the Content from www.youtube.com is not included.Booting Snapshots With the Boom Boot Manager and Content from www.youtube.com is not included.Using Leapp and Boom to Upgrade to RHEL 8 recordings, published by Content from www.youtube.com is not included.Red Hat Videos.

SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.