3.10 grubby Fatal Error Upgrading Kernel 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 3 and you upgrade the RHCK or UEK kernel, the following error is displayed:

grubby fatal error: unable to find a suitable template

When the system is rebooted, after the kernel update, the system boots to the old kernel.

Similarly, when upgrading from Oracle Linux 7 update 2 to Oracle Linux 7 update 3, if the /boot directory is hosted on a btrfs subvolume, the system boots to the old Oracle Linux 7 update 2 kernel after the upgrade is complete.

The workaround to this problem is to use grub2-mkconfig to recreate /etc/grub2/grub.cfg 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:

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

From the listing, select the kernel entry that you wish to run as the default kernel and set this entry as the default using the following command, substituting menu entry title with the title of the kernel entry that you identified in the listing:

# grub2-set-default "menu entry title"

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

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

(Bug ID 22750169)