Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Solved grub fail again
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Fri Apr 26, 2024 8:01 am    Post subject: Solved grub fail again Reply with quote

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=gentoo


installerar för x86_64-efi-plattform
efi variables are not supported on this system

grub-install:fel: efi boot mgr misslyckades med att registrera uppstartsposten:

filen eller katalogen finns inte

/Borje


Last edited by borje2 on Tue Apr 30, 2024 5:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 312
Location: Somewhere in the 77

PostPosted: Fri Apr 26, 2024 9:56 am    Post subject: Reply with quote

Hello,

This is an English subsection of the forum, if there is one available in your language, please, go in there if you want to speak your mother's tongue.

Otherwise, in English, please :).

Also, funny story: I had this problem yesterday, you seems to have boot the USB live of Gentoo in BIOS mode, not UEFI.

Rebooting on it will allow you to finish the installation process in UEFI mode.

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Fri Apr 26, 2024 12:10 pm    Post subject: Reply with quote

Check your BIOS setting: CSM mode (some BIOS call it "legacy") must be DISABLED.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22578

PostPosted: Fri Apr 26, 2024 2:40 pm    Post subject: Reply with quote

When posting error messages from programs, please run the program with LC_MESSAGES=C, so that the messages are not translated. This makes it easier for us to understand what the tool is reporting.
Back to top
View user's profile Send private message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Fri Apr 26, 2024 3:10 pm    Post subject: grub-install Reply with quote

grub-install fail

grub-install --target=x86_64-efi --efi-directory=/boot --bootloadet-id=gentoo

installing for x86_64-efi platforms

EFI variables are not supported on this system

grub-install :error: efibootmgr failed to register the boot entry: no such file or directory

/Borje
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 481

PostPosted: Fri Apr 26, 2024 4:55 pm    Post subject: Reply with quote

Did you boot the live-medium in UEFI mode? Check if the /sys/firmware/efi directory is filled.

Did you chroot correctly? Please show the commands you used.
Back to top
View user's profile Send private message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Fri Apr 26, 2024 7:18 pm    Post subject: sMueggli Reply with quote

I don't know how to boot live-medium in UEFI mode?

/sys/firmware/efi directory where did I found that?

sorry I am newbi

/Borje
Back to top
View user's profile Send private message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Fri Apr 26, 2024 7:42 pm    Post subject: Reply with quote

now I boot into live medium in UEFI mode

chroot

mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
swapon /dev/sda2

cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

export PS1="(chroot) $PS1"

/sys/firmware/efi directory I cannot find

/Borje
Back to top
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 312
Location: Somewhere in the 77

PostPosted: Fri Apr 26, 2024 7:46 pm    Post subject: Reply with quote

borje2 wrote:
now I boot into live medium in UEFI mode

chroot

mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
swapon /dev/sda2

cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

export PS1="(chroot) $PS1"

/sys/firmware/efi directory I cannot find

/Borje


Don't you forget to mount /efi ?

You have mounted a partition as boot, it should probably be a VFAT 32 partition, typed as EFI, with fdisk for example. And it should be named /efi, not /boot. So it's the same command (same partition) but you have to mount it on /mnt/gentoo/efi.

/boot is used for BIOS computer, not UEFI.

Did you use a GPT layout for the disk or BIOS ?

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Fri Apr 26, 2024 9:07 pm    Post subject: Reply with quote

borje2 wrote:
now I boot into live medium in UEFI mode
[...]
/sys/firmware/efi directory I cannot find

Once again:

Check your BIOS setting: CSM mode (some BIOS call it "legacy") must be DISABLED.

Our GentooCDs are dualboot-capable ... IF UEFI-(BIOS) is set to CSM they do an old MBR boot AND THEN you dont have a /sys/firmware/efi directory.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger


Last edited by pietinger on Fri Apr 26, 2024 9:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


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

PostPosted: Fri Apr 26, 2024 9:07 pm    Post subject: Reply with quote

borje2 wrote:
/sys/firmware/efi directory I cannot find

After booting the live medium (don't chroot yet):
Code:
ls -F /sys/firmware

If "efi/" is not in the output, then the live medium did not boot in UEFI mode.
_________________
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
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Fri Apr 26, 2024 9:11 pm    Post subject: Reply with quote

borje2,

I thought I had already given you this link ... but it was someone else ... sorry ... please only read this chapter:

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
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Fri Apr 26, 2024 9:18 pm    Post subject: Reply with quote

P.P.S.: I hope you have done ALL mounts and not only these:

borje2 wrote:
mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev


... because you are missing /sys =>

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Mounting_the_necessary_filesystems

BETTER: Do a arch-chroot
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Sat Apr 27, 2024 6:53 am    Post subject: Reply with quote

I have disable legacy in BIOS setting

I am very confused
when I boot from live cd i use BOOTx64.efi

shall I only have directory /efi? Not /boot

what should be the keystroke for
grub-install
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1028

PostPosted: Sat Apr 27, 2024 7:24 am    Post subject: Reply with quote

as Pietiger wrote , you missed to mount /sys filesystem where efivars were stored
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 481

PostPosted: Sat Apr 27, 2024 8:20 am    Post subject: Reply with quote

kgdrenefort wrote:
/boot is used for BIOS computer, not UEFI.
That is nonsense.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


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

PostPosted: Sat Apr 27, 2024 12:03 pm    Post subject: Reply with quote

borje2 wrote:
I am very confused
when I boot from live cd i use BOOTx64.efi

shall I only have directory /efi? Not /boot

I have no idea what you are asking.
_________________
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
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Sat Apr 27, 2024 12:23 pm    Post subject: Reply with quote

borje2 wrote:
I have disable legacy in BIOS setting

Good.

borje2 wrote:
when I boot from live cd i use BOOTx64.efi

Yes, every bootable OperatingSystem (for UEFI) - every Linux and also Windows - use this NAME because it is a hardcoded name every UEFI understands. As you surely already know you must make an UEFI boot-entry to boot a kernel or bootmanager or Windows ... but you dont want to do this for every USB stick (or bootable CD). Therefore UEFI invented this hardcoded name. Now you can boot this WITHOUT having a boot entry. You must know: BOOTx64.efi IS the grub (only renamed from grubx64.efi to this name). See more here: https://wiki.gentoo.org/wiki/EFI_System_Partition#Removable_media

borje2 wrote:
shall I only have directory /efi? Not /boot

You will need both directories. You mount your ESP (EfiSystemPartition) to /efi ... and then later grub-install will install your grubx64.efi (=first part of grub) INTO /efi/EFI/gentoo/grubx64.efi ... and ... the second part of grub INTO /boot/grub

Please read: https://forums.gentoo.org/viewtopic-t-1165115-highlight-.html


borje2 wrote:
what should be the keystroke for grub-install

Sorry, I dont understand your question. Please describe in other words what you mean.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Sat Apr 27, 2024 2:42 pm    Post subject: Reply with quote

Maybe read also in the neighbour thread from yesterday:

"Need guidance about efi partition":
https://forums.gentoo.org/viewtopic-t-1168647-highlight-.html
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Sat Apr 27, 2024 2:42 pm    Post subject: Reply with quote

I get more confused with UEFI

shall I have 2 diffrent directory? /efi and /boot both mount on /dev/sda1?

mount /sys is it not in

mount --rbind /sys /mnt/gentoo/sys
and
mount --make-rslave /mnt/gentoo/sys

/Borje
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Sat Apr 27, 2024 2:49 pm    Post subject: Reply with quote

borje2 wrote:
shall I have 2 diffrent directory? /efi and /boot both mount on /dev/sda1?

Yes ... two directories ... BUT ... you mount your ESP only to /efi ... /boot is just a directory in your root partition ;-)

borje2 wrote:
mount /sys is it not in

mount --rbind /sys /mnt/gentoo/sys
and
mount --make-rslave /mnt/gentoo/sys

That is rather impossible. Please describe every step you do after booting with our GentooMinimalCd.

Again: Please print this article and read it beside our AMD64 Handbook:
https://wiki.gentoo.org/wiki/User:Pietinger/Draft/Quick_Installation_OpenRC_for_an_UEFI_System

Maybe you want start here: https://wiki.gentoo.org/wiki/User:Pietinger/New_at_Gentoo
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
borje2
Apprentice
Apprentice


Joined: 19 Apr 2024
Posts: 195
Location: Gällivare

PostPosted: Sat Apr 27, 2024 3:13 pm    Post subject: Reply with quote

Two directory OK
mount ESP to /efi I don't understand how to

when I start from live-cd I go into bootsetup
I take
kör UEFI-program
CDROM: hp DVD-ram UJ8E1
EFI
BOOT
BOOTx64,EFI

ls -F /sys/firmware

Show:
acpi/ dmi/ efi/ memmap/

/Borje
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


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

PostPosted: Sat Apr 27, 2024 3:43 pm    Post subject: Reply with quote

Alright. After booting your live medium, without chrooting, post the outputs of:

Code:
$ lsblk -o name,mountpoints,partlabel,parttype
$ ls -F /mnt/*
$ mount

_________________
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
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 312
Location: Somewhere in the 77

PostPosted: Sat Apr 27, 2024 4:19 pm    Post subject: Reply with quote

sMueggli wrote:
That is nonsense


Indeed, I wanted to say: /boot is used to install GRUB for a MBR/BIOS case (but also used in GPT/BIOS case IIRC), got a bit quick to answer.

That /boot partition will be where grub-install works on BIOS system.

While /efi is used on an UEFI system, and is used as the directory where you use grub-install command.

Is that more correct ?
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


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

PostPosted: Sat Apr 27, 2024 5:24 pm    Post subject: Reply with quote

kgdrenefort wrote:
Is that more correct ?

No.

I don't like the term "the /boot partition". If it means anything, it is "the partition that you mount at /boot", which is a user's choice and may very well be none. Although the chosen bootloader (or lack of) can force the user to set things up in a particular way. So in my opinion the term is best avoided.

grub-install always installs most of GRUB (modules, fonts, themes, files for localization, etc.) to the /boot directory, regardless of target, and regardless of which partition holds the contents of that directory —unless said partition contains a filesystem type that GRUB doesn't support reading from—.

The rest of it depends: on UEFI systems, grub-install additionally installs a PE32+ file to the EFI System Partition. Which can be mounted wherever you want as long as you tell grub-install where it is. Although three choices are the customary ones: /boot, /boot/efi and /efi. The Gentoo Handbook currently favors the latter.

On BIOS systems and disks with a GPT, grub-install additionally installs part of it to the protective Master Boot Record, and part of it to a partition marked in the GPT with a special Partition Type GUID.

On BIOS systems and disks with a MS-DOS partition table, grub-install additionally installs part of it to the Master Boot Record, and part of it to the space between the MBR and the first partition —which must be large enough—.

Oh, and you usually don't need to tell grub-install which system it is: it does a decent job guessing it and figuring out what to do. I. e. --target is not generally needed.
_________________
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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