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.
grub
on the machine? as it maybe another OS owns thegrub
used during boot (multiple can be installed but only one will run) thus you're updating the wronggrub
or need to change ownership to your current system. – guiverc Jan 05 '22 at 22:50grub-mkconfig
? So the kernel being booted into is not even listed there? Consider doing asudo grub-install /dev/XXX
to the device you are booted into. – Organic Marble Jan 06 '22 at 00:36/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:57sudo 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 usechroot
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