I have a strange issue with my grub2 installation, grub boot list does not show entries for installed kernels (only one kernel is available: 6.7.3-200.fc39.x86_64). Itβs looks like that that entries for the new kernels were created under /boot/efi/loader/entries/ but system takes under consideration only entries from /boot/loader/entries/. I already tried reinstall grub itself using this instruction but without any effect. I will be grateful for any suggestions.
root@hp840:/home/grzegorz# sudo sh -c "ls -lr /boot/"
total 165416
-rwxr-xr-x. 1 root root 14782280 Jan 31 01:00 vmlinuz-6.7.3-200.fc39.x86_64
-rwxr-xr-x. 1 root root 11036144 Mar 5 2022 vmlinuz-0-rescue-fb3c1fe83e654cd69a64e0256d9580a9
-rw-r--r--. 1 root root 8849769 Jan 31 01:00 System.map-6.7.3-200.fc39.x86_64
lrwxrwxrwx. 1 root root 45 Mar 24 22:07 symvers-6.8.1-201.fc39.x86_64.xz -> /lib/modules/6.8.1-201.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Mar 13 13:24 symvers-6.7.9-200.fc39.x86_64.xz -> /lib/modules/6.7.9-200.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Mar 4 18:05 symvers-6.7.7-200.fc39.x86_64.xz -> /lib/modules/6.7.7-200.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Feb 28 18:47 symvers-6.7.6-200.fc39.x86_64.xz -> /lib/modules/6.7.6-200.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Feb 24 11:22 symvers-6.7.5-200.fc39.x86_64.xz -> /lib/modules/6.7.5-200.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Feb 9 15:04 symvers-6.7.3-200.fc39.x86_64.xz -> /lib/modules/6.7.3-200.fc39.x86_64/symvers.xz
drwx------. 2 root root 16384 Mar 5 2022 lost+found
drwxr-xr-x. 3 root root 4096 Mar 5 2022 loader
-rw-------. 1 root root 42105336 Feb 9 15:04 initramfs-6.7.3-200.fc39.x86_64.img
-rw-------. 1 root root 92302035 Mar 5 2022 initramfs-0-rescue-fb3c1fe83e654cd69a64e0256d9580a9.img
drwx------. 3 root root 4096 Mar 25 17:09 grub2
drwxr-xr-x. 2 root root 4096 Sep 19 2023 extlinux
drwx------. 6 root root 4096 Jan 1 1970 efi
-rw-r--r--. 1 root root 269368 Jan 31 01:00 config-6.7.3-200.fc39.x86_64
root@hp840:/home/grzegorz# mount |grep boot
/dev/nvme0n1p2 on /boot type ext4 (rw,relatime,seclabel)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
That did not respond as I would have expected. It should have recursively parsed and reported each subdirectory of /boot as well.
What shell are you using? echo $SHELL
Mine gives
$ sudo sh -c "ls -lR /boot/"
/boot/:
total 459300
-rw-r--r--. 1 root root 269378 Feb 22 18:00 config-6.7.6-200.fc39.x86_64
-rw-r--r--. 1 root root 269378 Feb 29 18:00 config-6.7.7-200.fc39.x86_64
-rw-r--r--. 1 root root 269378 Mar 5 18:00 config-6.7.9-200.fc39.x86_64
drwx------. 4 root root 16384 Dec 31 1969 efi
drwx------. 5 root root 4096 Mar 24 18:42 grub2
-rw-------. 1 root root 157884040 Mar 24 18:22 initramfs-0-rescue-c50eedc1bcb245299bc96b1173897ac2.img
-rw-------. 1 root root 75057408 Mar 3 19:35 initramfs-6.7.6-200.fc39.x86_64.img
-rw-------. 1 root root 75259068 Mar 5 18:44 initramfs-6.7.7-200.fc39.x86_64.img
-rw-------. 1 root root 75508985 Mar 24 18:22 initramfs-6.7.9-200.fc39.x86_64.img
drwxr-xr-x. 3 root root 4096 May 9 2023 loader
drwx------. 2 root root 16384 May 9 2023 lost+found
lrwxrwxrwx. 1 root root 45 Mar 3 19:35 symvers-6.7.6-200.fc39.x86_64.xz -> /lib/modules/6.7.6-200.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Mar 5 18:44 symvers-6.7.7-200.fc39.x86_64.xz -> /lib/modules/6.7.7-200.fc39.x86_64/symvers.xz
lrwxrwxrwx. 1 root root 45 Mar 13 08:56 symvers-6.7.9-200.fc39.x86_64.xz -> /lib/modules/6.7.9-200.fc39.x86_64/symvers.xz
-rw-r--r--. 1 root root 8850731 Feb 22 18:00 System.map-6.7.6-200.fc39.x86_64
-rw-r--r--. 1 root root 8851783 Feb 29 18:00 System.map-6.7.7-200.fc39.x86_64
-rw-r--r--. 1 root root 8851994 Mar 5 18:00 System.map-6.7.9-200.fc39.x86_64
-rwxr-xr-x. 1 root root 14790472 Mar 24 18:22 vmlinuz-0-rescue-c50eedc1bcb245299bc96b1173897ac2
-rwxr-xr-x. 1 root root 14794568 Feb 22 18:00 vmlinuz-6.7.6-200.fc39.x86_64
-rwxr-xr-x. 1 root root 14794568 Feb 29 18:00 vmlinuz-6.7.7-200.fc39.x86_64
-rwxr-xr-x. 1 root root 14790472 Mar 5 18:00 vmlinuz-6.7.9-200.fc39.x86_64
/boot/efi:
total 12
drwx------. 4 root root 4096 Jul 18 2023 EFI
-rwx------. 1 root root 34 Jul 19 2023 mach_kernel
drwx------. 3 root root 4096 Jul 19 2023 System
/boot/efi/EFI:
total 8
drwx------. 2 root root 4096 Mar 24 18:25 BOOT
drwx------. 2 root root 4096 Mar 24 18:25 fedora
/boot/efi/EFI/BOOT:
total 1820
-rwx------. 1 root root 747681 Mar 18 19:00 BOOTIA32.EFI
-rwx------. 1 root root 949424 Mar 18 19:00 BOOTX64.EFI
-rwx------. 1 root root 70360 Mar 18 19:00 fbia32.efi
-rwx------. 1 root root 87816 Mar 18 19:00 fbx64.efi
/boot/efi/EFI/fedora:
total 17628
-rwx------. 1 root root 112 Mar 18 19:00 BOOTIA32.CSV
-rwx------. 1 root root 110 Mar 18 19:00 BOOTX64.CSV
-rwx------. 1 root root 2960704 Feb 6 18:00 gcdia32.efi
-rwx------. 1 root root 3968320 Feb 6 18:00 gcdx64.efi
-rwx------. 1 root root 144 May 9 2023 grub.cfg
-rwx------. 1 root root 2960704 Feb 6 18:00 grubia32.efi
-rwx------. 1 root root 3968320 Feb 6 18:00 grubx64.efi
-rwx------. 1 root root 673992 Mar 18 19:00 mmia32.efi
-rwx------. 1 root root 848080 Mar 18 19:00 mmx64.efi
-rwx------. 1 root root 949424 Mar 18 19:00 shim.efi
-rwx------. 1 root root 747681 Mar 18 19:00 shimia32.efi
-rwx------. 1 root root 949424 Mar 18 19:00 shimx64.efi
/boot/efi/System:
total 4
drwx------. 3 root root 4096 Jul 19 2023 Library
/boot/efi/System/Library:
total 4
drwx------. 2 root root 4096 Oct 11 09:58 CoreServices
/boot/efi/System/Library/CoreServices:
total 4
-rwx------. 1 root root 384 Jul 19 2023 SystemVersion.plist
/boot/grub2:
total 24
drwx------. 2 root root 4096 Mar 13 08:55 fonts
-rw-------. 1 root root 6602 Mar 3 19:35 grub.cfg
-rw-------. 1 root root 1024 Mar 24 18:42 grubenv
drwxr-xr-x. 2 root root 4096 May 10 2023 i386-pc
drwxr-xr-x. 2 root root 4096 May 10 2023 x86_64-efi
/boot/grub2/fonts:
total 2344
-rwx------. 1 root root 2394108 Feb 6 18:00 unicode.pf2
/boot/grub2/i386-pc:
total 48
-rw-r--r--. 1 root root 22532 Apr 11 2023 multiboot2.mod
-rw-r--r--. 1 root root 20592 Apr 11 2023 relocator.mod
/boot/grub2/x86_64-efi:
total 80
-rw-r--r--. 1 root root 38520 Apr 11 2023 multiboot2.mod
-rw-r--r--. 1 root root 40904 Apr 11 2023 relocator.mod
/boot/loader:
total 4
drwx------. 2 root root 4096 Mar 24 18:22 entries
/boot/loader/entries:
total 16
-rw-r--r--. 1 root root 512 Mar 24 18:22 c50eedc1bcb245299bc96b1173897ac2-0-rescue.conf
-rw-r--r--. 1 root root 460 Mar 3 19:35 c50eedc1bcb245299bc96b1173897ac2-6.7.6-200.fc39.x86_64.conf
-rw-r--r--. 1 root root 460 Mar 5 18:44 c50eedc1bcb245299bc96b1173897ac2-6.7.7-200.fc39.x86_64.conf
-rw-r--r--. 1 root root 460 Mar 24 18:22 c50eedc1bcb245299bc96b1173897ac2-6.7.9-200.fc39.x86_64.conf
/boot/lost+found:
This directory /boot/efi/fb3c1fe83e654cd69a64e0256d9580a9 appears to be the problem. There are several threads about this where when that directory exists the files that normally would be placed in /boot are instead placed under that directory.
If you remove that directory and its content sudo rm -r /boot/efi/fb3c1fe83e654cd69a64e0256d9580a9
then run sudo dnf reinstall kernel* it should solve the issue for the current kernel.
You may read through the entire thread if necessary to understand what happened and why.
Once that directory is removed the issue should not reappear in the future.
My error in the earlier ls command. It should have been sudo sh -c "ls -lR /boot/"
I will fix that above.
@computersavvy thanks for the help, it worked as a charm!
Thank you also for the link, I am one of those guys who update my fedora instance in place since many releases, I wasnβt aware of such issue. Thanks once again.