Score:0

Ubuntu booting into old kernel; GRUB menu only shows older kernels

cn flag

UPDATE: After many false starts, it turned out that the line in /etc/fstab that loads /boot to the correct partition had been commented out. After uncommenting that, I could load new kernels normally with apt, and the computer boots normally now.


My Ubuntu machine (20.04) is booting into a much older kernel version and is ignoring several newer kernels. The GRUB menu only shows kernel entries that are prior to the one that is being loaded, so I don't have the option to switch. Any suggestions appreciated.

The kernel being loaded is 5.4.0-80-generic.

When I run sudo grub-mkconfig | grep menuentry | grep generic it shows several more recent kernels:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-92-generic
Found initrd image: /boot/initrd.img-5.4.0-92-generic
Found linux image: /boot/vmlinuz-5.4.0-91-generic
Found initrd image: /boot/initrd.img-5.4.0-91-generic
Found linux image: /boot/vmlinuz-5.4.0-90-generic
Found initrd image: /boot/initrd.img-5.4.0-90-generic
Found linux image: /boot/vmlinuz-5.4.0-89-generic
Found initrd image: /boot/initrd.img-5.4.0-89-generic
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-5.4.0-81-generic
Found initrd image: /boot/initrd.img-5.4.0-81-generic
Adding boot menu entry for UEFI Firmware Settings
done
    menuentry 'Ubuntu, with Linux 5.4.0-92-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-92-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-92-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-92-generic-recovery-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-91-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-91-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-91-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-91-generic-recovery-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-90-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-90-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-90-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-90-generic-recovery-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-89-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-89-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-89-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-89-generic-recovery-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-88-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-88-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-88-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-88-generic-recovery-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-81-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-81-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {
    menuentry 'Ubuntu, with Linux 5.4.0-81-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-81-generic-recovery-fe6a612c-184d-443a-a4b3-3254e11ff7eb' {

Updating etc/default/grub with GRUB_DEFAULT="gnulinux-5.4.0-92-generic-advanced-fe6a612c-184d-443a-a4b3-3254e11ff7eb" and then running sudo update-grub does nothing--it still boots into the old kernel and only shows old kernel options.

It's as if my GRUB options have been frozen. A couple of months ago I had a problem where some software update made the computer fail to boot. I had to boot via USB and then log in remotely to update the kernel (to the currently loading version). It's possible that I made a mistake when doing this, but I have no idea what.

guiverc avatar
cn flag
Is your system dual boot? Do you have another OS that contains `grub` on the machine? as it maybe another OS owns the `grub` used during boot (*multiple can be installed but only one will run*) thus you're updating the wrong `grub` or need to change ownership to your current system.
Organic Marble avatar
us flag
Is that the complete output from `grub-mkconfig`? So the kernel being booted into is not even listed there? Consider doing a `sudo grub-install /dev/XXX` to the device you are booted into.
cn flag
@guiverc It's not dual boot--Ubuntu only.
guiverc avatar
cn flag
The only obvious thing I see is likely a typo, ie. you give a *relative* path for `/etc/default/grub` (ie. no leading "/" thus changing the location unless "/" was your $PWD). Is your machine uEFI or BIOS in booting?
cn flag
@organic I tried ```sudo grub-install /dev/XXX``` and, now it boots straight into GRUB. Luckily, I could manually load the kernel from GRUB. But I've clearly screwed something up (not blaming you). Pretty sure this goes back to when I had to use ```chroot``` to access my hard drive via the USB boot because no subsequent updates to the kernel have been incorporated by GRUB.
cn flag
@guiverc It's uEFI. I'll go through and check the paths. Thanks.
Organic Marble avatar
us flag
If your system is EFI one of these answers should help you re-install GRUB https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/1317827#1317827
cn flag
@organic I reinstalled GRUB using that helpful link, but I'm still booting to a GRUB prompt every time. I'll tinker a bit more, but I'm probably just going to wipe the HD and start over.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.