F40 Kernel upgrade issue

After doing a sudo dnf --refresh upgrade I’m unable to boot the newly installed kernel, with the following message shown:

initramfs-6.8.7.fc40.x86_64.img not found

Kernel panic.

I can boot selecting the 6.8.5 older kernel just fine.

Any suggestions?

Added f40, kernel

Could happen if your /boot is full.
Check that you have not run out of disk space on the /boot partition.

14% used. It was full but i got read of some unused older kernels earlier today. Before i performed the update (and rebooted before just to be sure)

try dnf reinstall kernel-6.8.7-300 then check what is in /boot.

No new initramfs

Ok. remove the kernel then install it again.
Do you see any error messages?

Just to check your system only has Fedora installed?
You have not manual changed grub files?

The drive only has fedora on it yes. not touched grub

Apparently the kernel upgrade did not complete properly.

How did you remove those older kernels?
Did you just delete files or did you use the package manager to remove them?

If you just deleted files there will be some cleanup that must be done.

What is the output of dnf list installed kernel and ls /boot

Used package manager mainly apart from some debug ones i did rm /boot/ *debug *

dnf list installed kernel

kernel.x86_64                                                               6.8.5-301.fc40                                                               @fedora 
kernel.x86_64                                                               6.8.7-300.fc40                                                               @updates```

ls /boot
```config-6.8.5-301.fc40.x86_64                             initramfs-6.8.5-301.fc40.x86_64.img  System.map-6.8.7-300.fc40.x86_64+debug
config-6.8.7-300.fc40.x86_64                             loader                               vmlinuz-0-rescue-cb26d29a6269476dbc9854b519ce97da
config-6.8.7-300.fc40.x86_64+debug                       lost+found                           vmlinuz-6.8.5-301.fc40.x86_64
efi                                                      symvers-6.8.5-301.fc40.x86_64.xz     vmlinuz-6.8.7-300.fc40.x86_64
grub2                                                    System.map-6.8.5-301.fc40.x86_64     vmlinuz-6.8.7-300.fc40.x86_64+debug
initramfs-0-rescue-cb26d29a6269476dbc9854b519ce97da.img  System.map-6.8.7-300.fc40.x86_64```

You could try running dracut to build the initramfs.
I do not have the command to hand, should to easy to web search for the details.

Tried that, I get the following:

Scriptlet output:
1 dracut[F]: Can’t write to /boot/efi/cb26d29a6269476dbc9854b519ce97da/6.8.7-300.fc40.x86_64: Directory /boot/efi/cb26d29a6269476dbc9854b519ce97da/6.8.7-300.fc40.x86_64 does not exist or is not accessible.
2 /usr/lib/kernel/install.d/50-dracut.install failed with exit status 1.
3 warning: %posttrans(kernel-core-6.8.7-300.fc40.x86_64) scriptlet failed, exit status 1
4 dracut[F]: Can’t write to /boot/efi/cb26d29a6269476dbc9854b519ce97da/6.8.7-300.fc40.x86_64+debug: Directory /boot/efi/cb26d29a6269476dbc9854b519ce97da/6.8.7-300.fc40.x86_64+debug does not exist or is not accessible.
5 /usr/lib/kernel/install.d/50-dracut.install failed with exit status 1.
6 warning: %posttrans(kernel-debug-core-6.8.7-300.fc40.x86_64) scriptlet failed, exit status 1

Are you running dracut as root?
If root then suggest you debug why there are permission errors.

As root

Seems that dracut assumes this directory exists and it does not.
Maybe a workaround is to make sure it exists and run dracut again?
Of course that leaves the question of what went wrong in the first case unanswered.

ok, will try that and report back

dracut[F]: Will not override existing initramfs (/boot/efi/cb26d29a6269476dbc9854b519ce97da/6.8.7-300.fc40.x86_64/initrd) without --force

Do I go ahead with --force??

It ends up in the wrong folder, rather on the root path of /boot it ends up in /boot/efi/cb26d29a6269476dbc9854b519ce97da/kernel_name where clearly it can’t be found on boot since the only bootable kernel i have left is on the root path of /boot/

ok, restored a backup of /boot from rescuezilla. For some reason it won’t compile a new initramfs or it compiles it in boot/efi/cb26d29a6269476dbc9854b519ce97da/kernel-name (if you manually create that folder first)

It looks like I should have asked you to run dnf list installed kernel*. It would appear from the files that are shown in /boot that you may have the kernel-debug package installed, which is only useful when asked to install it by the kernel developers for specific testing. The debug versions of files in /boot take a lot of space.

Please remove that package with sudo dnf remove kernel-debug\*
Doing so will remove all existing and will stop creating the -debug files in /boot and in most cases prevent filling that space up.

To be able to boot with any kernel other than the 6.8.5 you will have to reinstall the newer kernel

Use sudo dnf remove kernel*6.8.7* to remove all parts of that kernel.

Follow that with sudo dnf upgrade --refresh to upgrade the system, which should include installing the 6.8.7 kernel. You may need to add the --enablerepo updates-testing option to get that newer kernel. Once that completes properly then you should be able to boot to the 6.8.7 kernel.