Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] GRUB issues: cannot boot and other issues
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Mon Feb 19, 2024 8:45 pm    Post subject: [SOLVED] GRUB issues: cannot boot and other issues Reply with quote

Hello,

Yesterday, my installation was running smoothly until I updated the packages and rebooted. Upon seeing the GRUB menu, I noticed a change as the background was now the default black. When I tried to boot by pressing enter, I encountered an error for both Kernel and initial ramdisk, stating

Code:
'error: symbol 'grub_is_shim_lock_enabled' not found'.


Even when I attempted to boot manually from the GRUB shell, the same error persisted. After resorting to rescuing from a livecd, I observed an anomaly - the disk was divided into two partitions, root (/) and boot (/efi), with the boot partition containing all the necessary boot files. Strangely, there was an additional folder named "boot" on the root partition, which GRUB was searching for files and configurations in. Despite executing the rescue commands and rebooting, I was greeted with grub-rescue and an error message indicating the absence of the "normal.mod" file under '/boot/..'.

I am really confused about how this mess happened, I don't remember creating a boot folder under the root partition when I followed the guide, but I don't trust my memory.

Anyhow, is there a way to fix this mess and have GRUB look for files on the boot partition (/efi) instead of the root?

Rgds,
_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]


Last edited by myga on Thu Feb 29, 2024 1:26 am; edited 1 time in total
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1566
Location: South America

PostPosted: Mon Feb 19, 2024 9:40 pm    Post subject: Reply with quote

myga wrote:
Code:
'error: symbol 'grub_is_shim_lock_enabled' not found'.

Did you do a grub-install after the update? grub-mkconfig is also recommended.

myga wrote:
Anyhow, is there a way to fix this mess and have GRUB look for files on the boot partition (/efi) instead of the root?

GRUB always has part of it (its PE32+ executable) in the EFI System Partition (ESP), wherever that partition happens to be mounted, and the rest in /boot, wherever that directory happens to be.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Thu Feb 22, 2024 2:43 am    Post subject: Reply with quote

GDH-gentoo wrote:
myga wrote:
Code:
'error: symbol 'grub_is_shim_lock_enabled' not found'.

Did you do a grub-install after the update? grub-mkconfig is also recommended.

myga wrote:
Anyhow, is there a way to fix this mess and have GRUB look for files on the boot partition (/efi) instead of the root?

GRUB always has part of it (its PE32+ executable) in the EFI System Partition (ESP), wherever that partition happens to be mounted, and the rest in /boot, wherever that directory happens to be.


Yes, I went through all the steps described on the AMD64 manual and the GRUB wiki page.

Every time I start up my computer and access the boot menu, the first option is 'gentoo' followed by the SSD where gentoo is located. When I select 'gentoo' and press enter, the screen blinks but nothing happens. However, if I choose the SSD option, it takes me to the GRUB menu which only shows an old kernel version (5.18.88) that is not even on my system. To boot successfully, I have to manually edit the menu and select the correct kernel. Even though GRUB can find the path '/boot/vmlinuz-6.1.74-gentoo' and boot into that kernel, it gives an error saying '/boot/early_ucode.cpio' is missing!

I have a couple of questions. Firstly, I'm wondering why GRUB is using a configuration file that I can't seem to locate on my machine. It's possible that the file doesn't even exist. Secondly, if I were to reinstall GRUB as if I were installing Gentoo for the first time, would it completely ruin my current installation to the point where it cannot be fixed?

Rgds
_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Thu Feb 22, 2024 3:46 am    Post subject: Reply with quote

/dev/nvme0n1p2 is the root partition and the boot partition is /dev/nvme0n1p1 which for some reason it does not get mounted on boot (fstab file below).

Code:

# /etc/fstab: static file system information.
#
# <fs>         <mountpoint>   <type>      <opts>      <dump/pass>

/dev/nvme0n1p1          /efi/boot           vfat            defaults,noatime       0 2
/dev/nvme0n1p2          /               btrfs           noatime               0 1


Here is a snippet from the latest reboot:

Code:

[    1.346318] exFAT-fs (nvme0n1p2): invalid boot record signature
[    1.346348] exFAT-fs (nvme0n1p2): failed to read boot sector
[    1.346369] exFAT-fs (nvme0n1p2): failed to recognize exfat type
[    1.351563] BTRFS: device fsid faad532c-b28a-4c5b-aa3e-b7efc4f06509 devid 1 transid 140056 /dev/root scanned by swapper/0 (1)
[    1.351811] BTRFS info (device nvme0n1p2): first mount of filesystem faad532c-b28a-4c5b-aa3e-b7efc4f06509
[    1.351824] BTRFS info (device nvme0n1p2): using crc32c (crc32c-generic) checksum algorithm
[    1.351837] BTRFS info (device nvme0n1p2): using free space tree
[    1.373417] BTRFS info (device nvme0n1p2): enabling ssd optimizations
[    1.374892] VFS: Mounted root (btrfs filesystem) readonly on device 0:16.
[    1.375569] devtmpfs: mounted
[    1.376291] Freeing unused kernel image (initmem) memory: 1604K
[    1.376426] Write protecting the kernel read-only data: 30720k
[    1.377623] Freeing unused kernel image (text/rodata gap) memory: 2028K
[    1.378303] Freeing unused kernel image (rodata/data gap) memory: 1568K
[    1.378428] Run /sbin/init as init process
[    1.378431]   with arguments:
[    1.378432]     /sbin/init
[    1.378434]     splash
[    1.378436]   with environment:
[    1.378438]     HOME=/
[    1.378440]     TERM=linux
[    1.378442]     BOOT_IMAGE=/boot/vmlinuz-6.1.74-gentoo
[    1.459713] tsc: Refined TSC clocksource calibration: 2592.004 MHz
[    1.459732] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x255cbae350f, max_idle_ns: 440795327587 ns
[    1.459822] clocksource: Switched to clocksource tsc
[    1.515482] kbd_mode (188) used greatest stack depth: 13080 bytes left
[    1.530424] loadkeys (190) used greatest stack depth: 13056 bytes left
[    1.530613] init-early.sh (187) used greatest stack depth: 12840 bytes left
[    1.566079] cp (208) used greatest stack depth: 12824 bytes left
[    2.245635] awk (358) used greatest stack depth: 12800 bytes left
[    3.484689] e1000e 0000:00:1f.6 enp0s31f6: renamed from eth0
[    3.672487] thinkpad_acpi: ThinkPad ACPI Extras v0.26
[    3.672494] thinkpad_acpi: http://ibm-acpi.sf.net/
[    3.672498] thinkpad_acpi: ThinkPad BIOS N2CET67W (1.50 ), EC N2CHT26W
[    3.672502] thinkpad_acpi: Lenovo ThinkPad P52, model 20MAS2MJ06
[    3.674774] thinkpad_acpi: radio switch found; radios are enabled
[    3.676331] x86_pkg_temp_thermal: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.690030] iptable_nat: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.693149] BTRFS info: devid 1 device path /dev/root changed to /dev/nvme0n1p2 scanned by (udev-worker) (674)
[    3.696257] nf_log_syslog: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.702530] thinkpad_acpi: secondary fan control detected & enabled
[    3.702801] xt_LOG: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.706322] thinkpad_acpi: battery 1 registered (start 0, stop 100, behaviours: 0x7)
[    3.706329] ACPI: battery: new extension: ThinkPad Battery Extension
[    3.706674] nvidia: loading out-of-tree module taints kernel.
[    3.706686] nvidia: module license 'NVIDIA' taints kernel.
[    3.706688] Disabling lock debugging due to kernel taint
[    3.707145] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input13
[    3.708737] xt_MASQUERADE: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.712106] xt_addrtype: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.713521] alsactl (775) used greatest stack depth: 12744 bytes left
[    3.714973] alsactl (774) used greatest stack depth: 12688 bytes left
[    3.715765] xt_mark: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.718801] xt_nat: version magic '5.15.88-gentoo SMP mod_unload ' should be '6.1.74-gentoo SMP preempt mod_unload '
[    3.731952] nvidia-nvlink: Nvlink Core is being initialized, major device number 242

_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 377

PostPosted: Thu Feb 22, 2024 6:15 pm    Post subject: Reply with quote

Please post the output of

Code:
efibootmgr


The mountpoint /efi/boot looks very strange for the ESP (which is not a "boot partition"). With Grub the commonly used mountpoint for the ESP is /boot/efi, having /boot either on / or on a separate /boot partition.

The newer way is to mount the ESP to /efi.

The third variant is to mount the ESP to /boot which implies that your kernel, grub and initramfs stuff is also on the ESP.
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Thu Feb 22, 2024 9:12 pm    Post subject: Reply with quote

sMueggli wrote:
Please post the output of

Code:
efibootmgr


The mountpoint /efi/boot looks very strange for the ESP (which is not a "boot partition"). With Grub the commonly used mountpoint for the ESP is /boot/efi, having /boot either on / or on a separate /boot partition.

The newer way is to mount the ESP to /efi.

The third variant is to mount the ESP to /boot which implies that your kernel, grub and initramfs stuff is also on the ESP.


I agree. When I edited the fstab file, it was pointing to "/boot" but it didn't work either.

Notice the "windows Boot Manager" below, I do not have any windows installation on my machine and have no idea where it came from or maybe it's a UEFI default entry?!!

The entry "Boot0000* gentoo" is what was working before and supposed to boot from there when I restart the machine.

The "BootCurrent: 001A" is referring to the main SSD (NVME0) that I booted from, which for some reason has an old grub config file that wants to boot kernel 5.15.88!

Code:
BootCurrent: 001A
Timeout: 2 seconds
BootOrder: 001A,0000,0002,001B,001F,001C,001D,001E,0019,0018,0001,0020,0021,0022,0027
Boot0000* gentoo   HD(1,GPT,2367d07f-b5ae-4e9a-8946-d0150a424672,0x800,0x100000)/File(\EFI\gentoo\grubx64.efi)
Boot0001* Windows Boot Manager   HD(2,GPT,f1746160-090f-44a6-a9da-0c101046a776,0x40800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000002f000100000010000000040000007fff0400
Boot0002* kali   HD(1,GPT,23be3eaa-8894-44ac-81aa-e45154253ba7,0x800,0x100000)/File(\EFI\kali\grubx64.efi)
Boot0010  Setup   FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
Boot0011  Boot Menu   FvFile(126a762d-5758-4fca-8531-201a7f57f850)
Boot0012  Diagnostic Splash Screen   FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
Boot0013  Lenovo Diagnostics   FvFile(3f7e615b-0d45-4f80-88dc-26b234958560)
Boot0014  Regulatory Information   FvFile(478c92a0-2622-42b7-a65d-5894169e4d24)
Boot0015  Startup Interrupt Menu   FvFile(f46ee6f4-4785-43a3-923d-7f786c3c8479)
Boot0016  Rescue and Recovery   FvFile(665d3f60-ad3e-4cad-8e26-db46eee9f1b5)
Boot0017  MEBx Hot Key   FvFile(ac6fd56a-3d41-4efd-a1b9-870293811a28)
Boot0018* USB CD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0019* USB FDD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot001A* NVMe0   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,001c199932d94c4eae9aa0b6e98eb8a400)
Boot001B* NVMe1   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,001c199932d94c4eae9aa0b6e98eb8a401)
Boot001C* ATA HDD1   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f601)
Boot001D* ATA HDD2   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f602)
Boot001E* ATA HDD0   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
Boot001F* USB HDD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)
Boot0020* PCI LAN   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
Boot0021  Other CD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a35406)
Boot0022  Other HDD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f606)
Boot0023* IDER BOOT CDROM   PciRoot(0x0)/Pci(0x14,0x0)/USB(15,1)
Boot0024* IDER BOOT Floppy   PciRoot(0x0)/Pci(0x14,0x0)/USB(15,0)
Boot0025* ATA HDD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f6)
Boot0026* ATAPI CD   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a354)
Boot0027* PCI LAN   VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)


As of this moment, the boot partition is not mounted, and the machine was booted from the root partition's boot folder!

The output below from the /boot folder on the root partition:

Code:
ls /boot
System.map-6.1.74-gentoo  config-6.1.74-gentoo  grub  initramfs-6.1.74-gentoo.img  vmlinuz-6.1.74-gentoo


The following output is when I mount the boot partition manually and list the contents:

Code:
# mount /dev/nvme0n1p1 /mnt/BOOT_PART/
# cd /mnt/BOOT_PART/
/mnt/BOOT_PART # ls
 EFI                          System.map-6.1.67-gentoo       System.map-6.1.74-gentoo   config-6.1.67-gentoo.old   early_ucode.cpio   initramfs-6.1.67-gentoo.img       initramfs-6.1.74-gentoo.img   vmlinuz-6.1.67-gentoo.old
'System Volume Information'   System.map-6.1.67-gentoo.old   config-6.1.67-gentoo       config-6.1.74-gentoo       grub               initramfs-6.1.67-gentoo.img.old   vmlinuz-6.1.67-gentoo         vmlinuz-6.1.74-gentoo

_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1566
Location: South America

PostPosted: Fri Feb 23, 2024 9:52 pm    Post subject: Reply with quote

myga wrote:
Notice the "windows Boot Manager" below, I do not have any windows installation on my machine and have no idea where it came from or maybe it's a UEFI default entry?!!

[...]

Code:
Boot0000* gentoo   HD(1,GPT,2367d07f-b5ae-4e9a-8946-d0150a424672,0x800,0x100000)/File(\EFI\gentoo\grubx64.efi)
Boot0001* Windows Boot Manager   HD(2,GPT,f1746160-090f-44a6-a9da-0c101046a776,0x40800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000002f000100000010000000040000007fff0400
Boot0002* kali   HD(1,GPT,23be3eaa-8894-44ac-81aa-e45154253ba7,0x800,0x100000)/File(\EFI\kali\grubx64.efi)

The entry for Windows points to a disk that is different from the one that contains Gentoo, if I understand correctly. Also, there is an entry for Kali (?) there...

myga wrote:
[...] the boot partition [...]

"Boot partition" is misleading, I suppose that you mean the EFI System Partition. Where do you want to have it mounted? Like sMueggli said, customary mountpoints are /boot, /boot/efi and, more recently, /efi.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Fri Feb 23, 2024 10:10 pm    Post subject: Reply with quote

myga,

There are two separate concepts here.

An EFI systems always boots from the EFI/ directory in the ESP. The firmware finds with the help of the boot entries in the efivarsfs.

The concept of mounting and the kernel filesystem tree does not yet exist. That comes only after the kernel is loaded.
The ESP must be formatted as VFAT, as thats tho only filesystem that the EFI firmware can read.

Linux cannot be installed on a VFAT partition, It cannot support permissions, symlinks and a few other things that linux requires.
This forces us lo conclude the the boot directory on the root filesystem does not hold the grub.efi, which was used to boot the system as that must be on the ESP.

The ESP only needs to be mounted when its content is to be changed.
Mounting is a kernel concept, not an EFI firmware concept.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 377

PostPosted: Sat Feb 24, 2024 1:34 pm    Post subject: Reply with quote

myga wrote:
I agree. When I edited the fstab file, it was pointing to "/boot" but it didn't work either.


What is the idea behind changing the fstab? Randomly changing configurations usually do not lead to working solutions. Mounting the ESP to /boot is one way and was working earlier. If you have no reason to change the mountpoint of the ESP (e.g. missing disk space), you should stick to the formerly working configuration.

myga wrote:

Notice the "windows Boot Manager" below, I do not have any windows installation on my machine and have no idea where it came from or maybe it's a UEFI default entry?!!


It is possible that the firmware is autocreating entries for existing EFI binaries.

The output of
Code:
lsblk -o +PARTUUID
gives you the information needed.

Then you can check the partition with the PARTUUID "f1746160-090f-44a6-a9da-0c101046a776" indicated from efibootmgr whether there exists a directory "\EFI\Microsoft". If so you can delete the content of the \EFI\Microsoft.

Maybe the firmware will clean up entries to non-existing binaries. Otherwise you can delete the boot entry with the tool efibootmgr.
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Sun Feb 25, 2024 2:39 am    Post subject: Reply with quote

GDH-gentoo wrote:
myga wrote:
Notice the "windows Boot Manager" below, I do not have any windows installation on my machine and have no idea where it came from or maybe it's a UEFI default entry?!!

[...]

Code:
Boot0000* gentoo   HD(1,GPT,2367d07f-b5ae-4e9a-8946-d0150a424672,0x800,0x100000)/File(\EFI\gentoo\grubx64.efi)
Boot0001* Windows Boot Manager   HD(2,GPT,f1746160-090f-44a6-a9da-0c101046a776,0x40800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000002f000100000010000000040000007fff0400
Boot0002* kali   HD(1,GPT,23be3eaa-8894-44ac-81aa-e45154253ba7,0x800,0x100000)/File(\EFI\kali\grubx64.efi)

The entry for Windows points to a disk that is different from the one that contains Gentoo, if I understand correctly. Also, there is an entry for Kali (?) there...


I personally never used Windows on this machine, but it used to be an enterprise workstation and I'm pretty sure they did use windows. Yes, Kali has its own SSD and I used it to chroot to gentoo SSD to gather information about this problem.

GDH-gentoo wrote:
myga wrote:
[...] the boot partition [...]

"Boot partition" is misleading, I suppose that you mean the EFI System Partition. Where do you want to have it mounted? Like sMueggli said, customary mountpoints are /boot, /boot/efi and, more recently, /efi.


"Misleading" is definitely the incorrect term for this case. The boot partition serves the same purpose as the EFI System Partition, the only difference is BIOS vs UEFI. But yes, I meant ESP.
_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Sun Feb 25, 2024 2:49 am    Post subject: Reply with quote

sMueggli wrote:
myga wrote:
I agree. When I edited the fstab file, it was pointing to "/boot" but it didn't work either.


What is the idea behind changing the fstab? Randomly changing configurations usually do not lead to working solutions. Mounting the ESP to /boot is one way and was working earlier. If you have no reason to change the mountpoint of the ESP (e.g. missing disk space), you should stick to the formerly working configuration.

myga wrote:

Notice the "windows Boot Manager" below, I do not have any windows installation on my machine and have no idea where it came from or maybe it's a UEFI default entry?!!


It is possible that the firmware is autocreating entries for existing EFI binaries.

The output of
Code:
lsblk -o +PARTUUID
gives you the information needed.

Then you can check the partition with the PARTUUID "f1746160-090f-44a6-a9da-0c101046a776" indicated from efibootmgr whether there exists a directory "\EFI\Microsoft". If so you can delete the content of the \EFI\Microsoft.

Maybe the firmware will clean up entries to non-existing binaries. Otherwise you can delete the boot entry with the tool efibootmgr.


That UUID does not exist when running the command you provided which means it's a remnant from the previous owner. It can be removed from the UEFI menu when I reboot.
_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 377

PostPosted: Sun Feb 25, 2024 5:46 pm    Post subject: Reply with quote

myga wrote:

GDH-gentoo wrote:
myga wrote:
[...] the boot partition [...]

"Boot partition" is misleading, I suppose that you mean the EFI System Partition. Where do you want to have it mounted? Like sMueggli said, customary mountpoints are /boot, /boot/efi and, more recently, /efi.


"Misleading" is definitely the incorrect term for this case. The boot partition serves the same purpose as the EFI System Partition, the only difference is BIOS vs UEFI. But yes, I meant ESP.


No, the purpose of the ESP is not the same as the purpose of /boot.

/boot is part of the operating system. From https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s05.html:

Quote:
This directory contains everything required for the boot process except configuration files not needed at boot time and the map installer. Thus /boot stores data that is used before the kernel begins executing user-mode programs. This may include saved master boot sectors and sector map files.

Programs necessary to arrange for the boot loader to be able to boot a file must be placed in /sbin. Configuration files for boot loaders that are not required at boot time must be placed in /etc.


UEFI is a replacement for BIOS. And the ESP is replacing the location of the bootloader which was placed after the Master Boot Record with BIOS systems. The ESP contains the EFI binaries that are loaded by the firmware. Although you can mount the ESP to /boot they still have different purposes.

myga wrote:
That UUID does not exist when running the command you provided which means it's a remnant from the previous owner. It can be removed from the UEFI menu when I reboot.


Yes, you should be able to delete the boot entry from the UEFI settings. Or use
Code:
efibootmgr -b 1 -B
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 110

PostPosted: Thu Feb 29, 2024 1:25 am    Post subject: Reply with quote

I was able to spend some time on this issue and solved it as follow.

After booting the latest installed kernel and logging in without issues:

    > moved all files/folders from /boot to a different backup folder.
    > mounted the ESP partition at /mnt/ESP_PART.
    > copied all files/folders from /mnt/ESP_PART to /boot folder.
    > updated fstab file to mount the ESP partition to /boot.
    > unmounted /mnt/ESP_PART and rebooted (everything worked as it should except for the 'gentoo' entry in boot menu).
    > after logging in, I ran the command 'grub-install --efi-directory=/boot' (this time without the '--removable' option).
    > now the 'gentoo' entry on the boot menu works as before.


Thank you all for your the help and guidance.
_________________
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum