Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
grub2 ignores the default kernel. I don't understand why.
I have installed two kernels:
3.10.0-514.10.2.el7.x86_64 and 3.10.0-514.2.2.el7.x86_64.
After installing the 514.2.2 kernel, I use grubby to set the default.
# grubby --default-kernel
/boot/vmlinuz-3.10.0-514.2.2.el7.x86_64
The saved_entry is perfect:
# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
You can see that the kernel I want to boot is index 1:
# grubby --info=ALL
index=0
kernel=/boot/vmlinuz-3.10.0-514.10.2.el7.x86_64
args="ro crashkernel=auto rd.lvm.lv=vg_default/lv_root rd.lvm.lv=vg_default/lv_swap rhgb quiet rd.shell=0 rd.driver.blacklist=nouveau "
root=/dev/mapper/vg_default-lv_root
initrd=/boot/initramfs-3.10.0-514.10.2.el7.x86_64.img
title=CentOS Linux (3.10.0-514.10.2.el7.x86_64) 7 (Core)
index=1
kernel=/boot/vmlinuz-3.10.0-514.2.2.el7.x86_64
args="ro crashkernel=auto rd.lvm.lv=vg_default/lv_root rd.lvm.lv=vg_default/lv_swap rhgb quiet rd.shell=0 rd.driver.blacklist=nouveau "
root=/dev/mapper/vg_default-lv_root
initrd=/boot/initramfs-3.10.0-514.2.2.el7.x86_64.img
title=CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
index=2
kernel=/boot/vmlinuz-0-rescue-d650fd57864e488499a08498403b2867
args="ro crashkernel=auto rd.lvm.lv=vg_default/lv_root rd.lvm.lv=vg_default/lv_swap rhgb quiet rd.shell=0 rd.driver.blacklist=nouveau "
root=/dev/mapper/vg_default-lv_root
initrd=/boot/initramfs-0-rescue-d650fd57864e488499a08498403b2867.img
title=CentOS Linux (0-rescue-d650fd57864e488499a08498403b2867) 7 (Core)
index=3
non linux entry
index=4
non linux entry
index=5
non linux entry
index=6
non linux entry
index=7
non linux entry
You can see that the default index should be 1:
# grubby --default-index
1
I made sure that /etc/sysconfig/kernel contains UPDATEDEFAULT=no
/etc/default/grub contains:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg_default/lv_root rd.lvm.lv=vg_default/lv_swap rhgb quiet rd.shell=0 rd.driver.blacklist=nouveau"
GRUB_DISABLE_RECOVERY="true"
Everything seems perfect, but then I ..
# grub2-mkconfig -o /boot/grub2/grub.cfg
... boot .. and index 0 is selected!!!
Is this a bug or a feature!?
Actually, it seems that the problem is that the saved default is stored in /boot/grub2/grubenv. /boot/grub2/grubenv is a symlink to /boot/efi/EFI/centos/grubenv. When booting, the path to the file is actually /efi/EFI/centos/grubenv (because /boot is mounted to /). I replaced the symlink with a symlink with a symlink to /efi/EFI/centos/grubenv, and it *worked*!