0

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.

srs_dgb
  • 1
  • 1
  • 2
    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. – guiverc Jan 05 '22 at 22:50
  • 1
    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. – Organic Marble Jan 06 '22 at 00:36
  • @guiverc It's not dual boot--Ubuntu only. – srs_dgb Jan 06 '22 at 22:27
  • 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? – guiverc Jan 06 '22 at 22:57
  • @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. – srs_dgb Jan 06 '22 at 23:03
  • @guiverc It's uEFI. I'll go through and check the paths. Thanks. – srs_dgb Jan 06 '22 at 23:04
  • 1
    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 – Organic Marble Jan 06 '22 at 23:16
  • @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. – srs_dgb Jan 07 '22 at 02:11

0 Answers0