Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No boot entry after grub install
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
spinojara
n00b
n00b


Joined: 05 Aug 2024
Posts: 6

PostPosted: Mon Aug 05, 2024 5:53 am    Post subject: No boot entry after grub install Reply with quote

I'm trying to install gentoo and no matter what I do I cannot manage to get a boot entry to show up in bios (uefi).

I'm using the livegui installation media. I have /dev/sda2 mounted at /mnt/gentoo and /dev/sda1 mounted at /mnt/gentoo/boot/efi. The type of /dev/sda1 is "EFI System" and of size 1MiB. /dev/sda2 is of type "Linux Filesystem". The filesystem on /dev/sda1 is fat32:

Code:
mkfs.fat -F 32 /dev/sda1


I have no other drives except for the installation media usb (/dev/sdb). After the command

Code:
grub-install --efi-directory=/boot/efi


grub says there were no errors. I now have the file /boot/efi/EFI/gentoo/grubx64.efi. efivars are mounted at /sys/firmware/efi/efivars (rw not ro). The command

Code:
efibootmgr -v


shows the output

Code:
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0000,0003
Boot0000* gentoo         HD(1,GPT,some number,0x800,0x100000)/File(\EFI\gentoo\grubx64.efi)0000424f
dp: 04 01 2a 00 some more numbers
data 00 00 42 4f
Boot0003* USB, Partition 2      PciRoot(0x0)/Pci(0x7,0x1)/Pci(0x0,0x3)/USB(7,0)/HD(2,GPT,....,0x728bfd8,0x10000)0000424f
dp: 02 01 0c 00 ....
data: 00 00 42 4f


But when I reboot and go into bios (uefi) it finds no boot entries at all. (Except for the usb when I plug it in again). If I boot the livegui again efibootmgr -v now shows only the usb entry.

What I have tried:
    Add --removable flag to grub-install.

    Change secure boot settings and a lot of other settings in bios.

    Reinstall from the beginning of the handbook 2 times, including disk partitioning in case I missed something.

    Install debian on the same exact configuration. This works as expected.


I have checked the partitioning of the debian install. It is the same as mine, except that the EFI System partition (/dev/sda1) is 512MiB instead of my 1MiB. The file which is booted is /boot/efi/EFI/debian/grubx64.efi. At first there were other efi files here but I removed them to try to get it to use the grubx64.efi file, it still works as expected. Now, from debian the output of efibootmgr -v is almost the same:

Code:
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0003
Boot0002* debian         HD(1,GPT,<THIS NUMBER IS DIFFERENT>,0x800,0x100000)/File(\EFI\debian\grubx64.efi)0000424f
dp: ....
data ...
Boot0003* USB, Partition 2      PciRoot(0x0)/Pci(0x7,0x1)/Pci(0x0,0x3)/USB(7,0)/HD(2,GPT,....,0x728bfd8,0x10000)0000424f
dp: 02 01 0c 00 ....
data: 00 00 42 4f


I have installed gentoo on 5 different devices before and never had a problem like this. I cannot figure out what is going on. Any hints?
Back to top
View user's profile Send private message
BurningMemory
n00b
n00b


Joined: 17 Jan 2023
Posts: 54

PostPosted: Mon Aug 05, 2024 7:10 am    Post subject: Reply with quote

Have you put in any m.2 drives in the machine as of recently?
If so, try to reset the cmos battery. Should work afterwards.
If it doesn't you can try to:
- remove the entry via efibootmgr and regen the config
- reinstall to /boot and not /boot/efi
- reinstall with the --target=x86_64-efi flag

I had some weird problems with it some time ago,
something along these lines usually helped.
Also, if you're using the --target flag it may complain
about something, in that case just experiment with the flags
and it should install just fine.
Back to top
View user's profile Send private message
spinojara
n00b
n00b


Joined: 05 Aug 2024
Posts: 6

PostPosted: Mon Aug 05, 2024 7:22 am    Post subject: Reply with quote

No there are no m.2 drives and has never been. Only an old sata ssd. I have already tried the --target flag, this should not be necessary. I should be able to install to /boot/efi, also the debian install works this way. I will try to manually add the boot entry using efibootmgr.
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2170

PostPosted: Mon Aug 05, 2024 8:19 am    Post subject: Reply with quote

spinojara,

Try running grub-install --verbose. You might see some error messages (actually, I bet you'll see a lot) as it tries different routes to achieve the install.
A thought: it might be it doesn't trust your EFI partition because it doesn't have the right flags set in the GPT; I've no idea if it checks that.
_________________
Greybeard
Back to top
View user's profile Send private message
spinojara
n00b
n00b


Joined: 05 Aug 2024
Posts: 6

PostPosted: Mon Aug 05, 2024 11:25 am    Post subject: Reply with quote

I ran with the verbose flag, though I don't really understand most of it. I could post it if it helps. However my ESP partition has the right flags. Using parted -l gives the flags: "boot, esp" for /dev/sda1.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5050
Location: Bavaria

PostPosted: Mon Aug 05, 2024 12:01 pm    Post subject: Reply with quote

spinojara,

maybe you have a faulty UEFI ... we had some systems in the past where UEFI simply does not accept a new boot entry (yes, this is a clear violation of the uefi specification) ... In this case you must work with EFI\BOOT\BOOTX64.efi. Do you know how to handle this, or do you need help for this ?

( https://wiki.gentoo.org/wiki/GRUB#Motherboard_firmware_not_finding_the_.EFI_file )

First, check if all requirements are met (*), and if so, then assume that your UEFI is faulty.

*) https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Boot_kernel_via_UEFI#Prerequisites_for_an_UEFI_boot
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
spinojara
n00b
n00b


Joined: 05 Aug 2024
Posts: 6

PostPosted: Mon Aug 05, 2024 12:42 pm    Post subject: Reply with quote

I don't know about the UEFI being faulty. It does accept new boot entries, for example debian. I can install and boot debian just as expected. It just does not work with gentoo. I just tried installing debian once more but without a swap partition. Then it complained that "failed to install grub bootloader". Do I have to have a swap partition? I have only tried to install gentoo without a swap partition. This shouldn't matter right?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5050
Location: Bavaria

PostPosted: Mon Aug 05, 2024 1:14 pm    Post subject: Reply with quote

spinojara wrote:
[...] Do I have to have a swap partition? I have only tried to install gentoo without a swap partition. This shouldn't matter right?

No, you dont need a swap partition for the UEFI thing.

If you had debian on this system what you had in the output of "efibootmgr" ? (With version 18 of efibootmgr your dont need the parm -v anymore)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
spinojara
n00b
n00b


Joined: 05 Aug 2024
Posts: 6

PostPosted: Mon Aug 05, 2024 1:22 pm    Post subject: Reply with quote

Well I shouldn't, but I just tried. And now it works. All I changed during the installation process was adding a swap partition of 1GiB between the EFI and root partition. That is very weird.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5050
Location: Bavaria

PostPosted: Mon Aug 05, 2024 1:53 pm    Post subject: Reply with quote

spinojara wrote:
Well I shouldn't, but I just tried. And now it works. All I changed during the installation process was adding a swap partition of 1GiB between the EFI and root partition. That is very weird.

I think the real cause was something else, because you don't need a swap partition for UEFI. But it's good that everything is working now.

Have fun with Gentoo ! :D
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 489

PostPosted: Mon Aug 05, 2024 3:28 pm    Post subject: Re: No boot entry after grub install Reply with quote

spinojara wrote:
The type of /dev/sda1 is "EFI System" and of size 1MiB.


Why 1 MiB? Where is this value coming from? Maybe it is technically possible to create a FAT filesystem with a partition size of 1 MiB (probably with FAT12?). But I would not expect that the firmware is correctly handling such a minimal partition.

1 MiB is recommend for the "bios_grub" partition for BIOS systems on a GPT disk. But the "bios_grub" partition is a completely different thing and has nothing to do with an ESP.
Back to top
View user's profile Send private message
spinojara
n00b
n00b


Joined: 05 Aug 2024
Posts: 6

PostPosted: Tue Aug 06, 2024 11:41 am    Post subject: Reply with quote

I'm a bit ashamed to admit that that was indeed the problem, not the swap partition. Thank you all for the help.
Back to top
View user's profile Send private message
elover
Apprentice
Apprentice


Joined: 20 Nov 2019
Posts: 170
Location: Spain

PostPosted: Tue Aug 06, 2024 12:14 pm    Post subject: Reply with quote

I always make it 512MB or more, if I don't use dual boot I use efisetub

/boot
├── System.map-6.10.0-gentoo
├── System.map-6.10.0-gentoo.old
├─── System.map-6.10.3-gentoo.old
├── System.map-6.10.3-gentoo.old
├── amd-uc.img
├─── config-6.10.0-gentoo.old
├── config-6.10.0-gentoo.old
├── config-6.10.3-gentoo.old
├── config-6.10.3-gentoo.old
├─── efi.
│ ├─── efibootmgr_add_entry.sh
│ ├─── generate_initramfs.sh
│ ├─── initramfs.img
│ ├─── initramfs.img.old
│ ├─── vmlinuz.efi
│ └└── vmlinuz.efi.old
├── initramfs-6.10.0-gentoo.img
├── initramfs-6.10.0-gentoo.img.old
├─── initramfs-6.10.3-gentoo.img.old
├── initramfs-6.10.3-gentoo.img.old
├── vmlinuz-6.10.0-gentoo.img.old
├── vmlinuz-6.10.0-gentoo.old
├─── vmlinuz-6.10.3-gentoo.old
└── vmlinuz-6.10.3-gentoo.old

fibootmgr --verbose --create --disk "/dev/sda" --part "1" --label "gentoo" --loader '\vmlinuz.efi' --unicode 'initrd=\initramfs.img'" rd.vconsole.keymap=en rd.md.uuid=8d88f432:51eb4c2f:b9085ccf:62f63f8e rd. md.uuid=fe8503b5:ea54486e:b43cb91f:665fcc9f rd.luks.uuid=513d955b-eebd-4095-8f7f-9e93902811b2 root=UUID=c3f356b6-2045-44c6-90dc-485b8ad57a49 rd.luks.options=discard"
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5050
Location: Bavaria

PostPosted: Tue Aug 06, 2024 12:43 pm    Post subject: Reply with quote

spinojara wrote:
I'm a bit ashamed to admit that that was indeed the problem, not the swap partition. [...]

No problem - no reason to be ashamed :)

spinojara wrote:
[...] Thank you all for the help.

You are very Welcome :D

Have fun with Gentoo ! 8)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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