5.7 grubby fatal error during kernel upgrade when /boot is on a BTRFS subvolume

If /boot is hosted on a btrfs subvolume, GRUB 2 is unable to correctly process the initramfs and vmlinuz pathnames. This problem occurs when you update or install a new kernel and grubby attempts to update the GRUB 2 configuration. In the case where you are running a fresh installation of Oracle Linux 7 Update 7 and you upgrade the RHCK or UEK kernel, the following error is displayed:

grubby fatal error: unable to find a suitable template

After the kernel update, when the system is rebooted, it boots the old kernel.

The workaround for this problem is to use grub2-mkconfig to regenerate the /etc/grub2/grub.cfg file, or /etc/grub2-efi.cfg file on a UEFI booted system, immediately after the kernel has been installed or upgraded, for example:

# grub2-mkconfig -o /boot/grub2/grub.cfg

Obtain a listing of the kernel menu entries in the generated configuration as follows:

# grep -P "submenu|^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2

From the listing, select the kernel entry that you want to run as the default kernel and set this entry as the default by using the following command:

# grub2-set-default "menu entry title"

where menu entry title is the title of the kernel entry that you identified in the listing.

You can use the grub2-editenv list command to check that the saved_entry has been updated with the selected kernel menu title.

Reboot the system and use uname -a to check that the correct kernel is now running.

(Bug ID 22750169)