Fixing Linux kernel not found

In summary, fixing a Linux kernel not found error involves troubleshooting the cause of the issue, which can range from a corrupted boot loader to a missing or corrupted kernel file. Steps to fix the error include checking the file system, reinstalling the kernel, and repairing the boot loader. It is important to properly identify and address the root cause of the error in order to successfully fix it.
  • #1
jack action
Science Advisor
Insights Author
Gold Member
2023 Award
3,318
8,807
TL;DR Summary
If the current kernel is not in the grub or the installed list of apt, where is it?
I have this remote server where I loaded the ISP-provided OS, namely Ubuntu 22.04.

The lsb_release -d shows "Ubuntu 22.04.4 LTS" and uname -r shows "5.2.0".

My problem arose when there seemed to be missing modules for kernel 5.2.0 in /lib/modules/5.2.0 for my needs. There is also no information about kernel 5.2.0 in the grub files or the /boot directory.

No problem, I'm upgrading to the latest kernel (image and headers) and the grub. I now have kernel 5.15.101 installed, also in the grub files and the /boot directory; even all the modules files are there. But there is still no sign of the 5.2.0 version in the new grub files.

Rebooting ... still 5.2.0 loading up. I tried to change GRUB_DEFAULT from '0' to '1' or even '2', and always version 5.2.0 loads up.

I cannot find where '5.2.0' is set to load. With apt there is nothing about this version, installed or available. If there is no mention of it in the grub, where is it coming from?

The most info I found was with cat / proc/version which returned "Linux version 5.2.0 (mockbuild @ builder9.eng.sw.ru) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Wed Jul 12 12:00:44 MSK 2023".

Being accessed with a remote connection, I cannot access a grub menu to examine.
 
Computer science news on Phys.org
  • #3
I wouldn't know for sure. How can I check and couldn't I upgrade the kernel with such an environment?
 
  • #4
jack action said:
I wouldn't know for sure. How can I check and couldn't I upgrade the kernel with such an environment?
Run the 'df' command to see what is the / (normally the root) mount point.
My Linux workstations at the house all use remote boots from a central house server.
Filesystem 1K-blocks Used Available Use% Mounted on
udev 16424744 0 16424744 0% /dev
tmpfs 3290748 1508 3289240 1% /run
10.1.1.2:/sdb/nfs1 429814784 336425984 93388800 79% /
tmpfs 5120 12 5108 1% /run/lock
tmpfs 9079160 2131540 6947620 24% /dev/shm
none 16453732 60740 16392992 1% /tmp
none 16453732 0 16453732 0% /var/tmp
none 16453732 0 16453732 0% /media
none 16453732 1720 16452012 1% /var/log

To upgrade the local network kernel with that setup you normally need 'root' access on the remote file and boot server. I use tftp with nfs combined with dhcp (keyed on the workstation MAC address) on the host server for remote booting.
 
  • #5
df:
Filesystem        1K-blocks    Used Available Use% Mounted on
/dev/ploop25095p1  51472864 4879680  44375016  10% /
none                   4096       0      4096   0% /sys/fs/cgroup
tmpfs               1048576       0   1048576   0% /dev/shm
tmpfs                419432     196    419236   1% /run
tmpfs                  5120       0      5120   0% /run/lock
tmpfs                  1024       0      1024   0% /run/credentials/systemd-sysusers.service
none                1048576       0   1048576   0% /run/shm
tmpfs                209712       0    209712   0% /run/user/1000

I have 'root' access on my VPS managed by a Virtuozzo Container, with the OS loaded from a Virtuozzo Template that I selected.

With other ISPs I have, I have similar setups and I usually upgrade the whole thing with sudo do-release-upgrade -d which upgrades from version 22 to 24 without any complication. With this one, it created problems I couldn't identify, and decided to stay with the original version 22. I then realized I couldn't modify the kernel parameters net.ipv4.* with sysctl like I usually do because I was missing modules.
 
  • Like
Likes nsaspook
  • #6
As an update, the problem was that I was provided with a Virtuozzo Container instead of a pure VPS:
https://www.virtuozzo.com/hybrid-server/virtuozzo-containers/ said:
With Virtuozzo Containers, a single operating system kernel can support multiple isolated virtualized instances instead of just one. From an end user standpoint, these instances, called Containers, look and feel like a real server. This approach provides a common, secure virtualization layer that allocates a single set of system resources across all Containers. The result: a leaner, more efficient virtualization layer with bare-metal performance.

If you’re a service provider or SaaS ISV, this approach translates into higher ratios of virtual servers to physical servers, near-native server performance, and unique advantages for managing a virtual environment.
Hence why I couldn't modify the kernel.
 

FAQ: Fixing Linux kernel not found

What does "Linux kernel not found" mean?

"Linux kernel not found" is an error message that indicates the bootloader (such as GRUB) cannot locate the kernel image necessary to start the Linux operating system. This can occur due to misconfiguration, missing files, or file system corruption.

How can I fix the "Linux kernel not found" error?

To fix this error, you can try the following steps: boot from a live USB or CD, mount the root filesystem, and check the /boot directory for the kernel image. If the kernel is missing, you may need to reinstall it using your package manager or restore it from backup.

What should I check if the kernel image is present but still getting the error?

If the kernel image is present but you're still encountering the error, check the bootloader configuration file (e.g., /boot/grub/grub.cfg or /etc/default/grub) for correct entries. Ensure the paths to the kernel and initramfs images are accurate, and then update the bootloader using the command 'update-grub'.

Can a corrupted filesystem cause the "Linux kernel not found" error?

Yes, a corrupted filesystem can lead to the "Linux kernel not found" error. If critical files, including the kernel image, are damaged or misplaced, the bootloader may fail to locate them. Running filesystem checks using tools like fsck can help identify and fix such issues.

What if I recently updated my kernel and started seeing this error?

If you started seeing the "Linux kernel not found" error after a kernel update, it's possible that the update did not complete successfully, or the new kernel was not properly installed. You can try booting into an older kernel from the GRUB menu or reinstall the latest kernel version using your package manager.

Back
Top