Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
booting aborts when grub should kick in
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
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Wed Mar 13, 2024 8:46 am    Post subject: booting aborts when grub should kick in Reply with quote

After an emerge of @world i changed some options in /etc/default/grub:
Code:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Then i did sudo grub-mkconfig -o /boot/grub/grub.cfg, followed by a restart.

After the ASUS Bios splash screen, I caught a short flash of something that might be the grub menu, but in this instant the computer restarted. This time after the splash screen, I ended up inside the BIOS settings.

I suspected i must have somehow messed up the grub configuration so i booted with a LiveCD USB stick, mounted the root partition and the boot partition, as well as /proc/, /sys, /dev, and /run (as specified in the gentoo handbook). Then chrooted to the mounted root, undid my changes to /etc/default/grub and ran
sudo grub-mkconfig -o /boot/grub/grub.cfg
again. But after rebooting i got showed the same behaviour: booting up until shortly before grub should kick in, then sudden restart, and finally ending up in the BIOS settings.

How should i proceed to get my system running again?
(i would prefer a solution which doesn't include a complete a complete & fresh installation of gentoo, because i got a lot of data on my root partition)
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3628

PostPosted: Wed Mar 13, 2024 9:30 am    Post subject: Reply with quote

Context please.

Did you upgraded grub, rebuild grub only, emerge only other packages?

Upgrade requires more that an grub-mkconfig

MBR, UEFI?

Never had problem because of
Code:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
Maybe I've been lucky...

NeddySeagoon would say gentoo mostly never requires reinstall instead of fixes, I guess.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here.
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Wed Mar 13, 2024 10:23 am    Post subject: Reply with quote

I did not explicitly upgrade grub, i only ran emerge --update--newuse --deep @world.
I don't know if this pulled in a new version of grub, but it cerainly uipdated some other packages.

I have UEFI.

It is, however possible that i didn't have /boot mounted when i first ran the grub-mkconfig.
But the second time (when booted from USB) i had /boot mounted.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3628

PostPosted: Wed Mar 13, 2024 10:32 am    Post subject: Reply with quote

Code:
qlop -v grub
should list about grub rebuilds.

Not having efi partition mounted should output complains.

Very uncomfy about that one: grub install from install/liveCD may no be so straight forward.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here.
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4157
Location: Bavaria

PostPosted: Wed Mar 13, 2024 2:29 pm    Post subject: Reply with quote

jody,

please chroot into your Gentoo system (*) and re-install grub (and do again a grub-mkconfig afterwards). You have the same problem I already explained here: https://forums.gentoo.org/viewtopic-p-8818652.html#8818652

*) How to chroot into your Gentoo system again is explained here:
https://wiki.gentoo.org/wiki/User:Pietinger/New_at_Gentoo#Pause_during_Installation
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Wed Mar 20, 2024 9:55 am    Post subject: Reply with quote

Hi Pietinger
Thank you for your reply.

I guess my system is even more messed up than i thought.
Code:
 # grub-install --target=x86_64_efi --efi-directory=/boot /dev/sda
Installing for x86-64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub-install: error: efibootmgr failed to register the boot entry: No such file or directory.


(Probably unrelated, but my setup is such that i have an EFI subdirectory directory on /dev/sda1, and i simply do a mount /dev/sda1 /boot (this used to work until now))

But i also tried
Code:
mount /dev/sda1 /boot/efi

but this, too, doesn't work:
Code:

grub-install --target=x86_64_efi --efi-directory=/boot/efi /dev/sda
Installing for x86-64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub-install: error: efibootmgr failed to register the boot entry: No such file or directory.


I must admit the underlying problem is probably that i do not fully grasp the relationship between efi/uefi and /boot...
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Wed Mar 20, 2024 10:44 am    Post subject: Reply with quote

I just found out that the /sys directory on my disk does not contain a firmware/efi subdirectory -
there are only the acpi, di and memmap subdirectories.
This is obviously the reason for the error message cited in my previous mail.

The gentoo-install usb stick i used to boot the system also doesn't contain the /sys/firmware/efi subdirectory.
(i created the stick with rufus from install-amd64-minimal-20240317T170433Z.iso (in dd mode, not iso)).

Also, i saw on the gentoo download page that for arm they have an image for "Minimal Installation CD" marked with "EFI", whereas the one for amd does not.

Is there some other image i should use to boot my machine to get the efi subdirectory?
Or is there some way i can download that subdirectory?
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


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

PostPosted: Wed Mar 20, 2024 12:38 pm    Post subject: Reply with quote

jody wrote:
I just found out that the /sys directory on my disk does not contain a firmware/efi subdirectory - [...]

Is there some other image i should use to boot my machine to get the efi subdirectory?
Or is there some way i can download that subdirectory?

It appears automatically if the computer really boots in UEFI mode... Which hints at yours not doing so...
_________________
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: 4157
Location: Bavaria

PostPosted: Wed Mar 20, 2024 1:43 pm    Post subject: Reply with quote

jody,

grub-install calls efibootmgr. efibootmgr needs to be able to access EFI variables (yes, it is /sys/firmware/efi). This is provided by efivarfs.

To get this, you must:

1. the computer must have booted in UEFI (check if you have in your BIOS CSM mode enabled; if yes you must disable CSM mode),
2. the kernel needs some options: https://wiki.gentoo.org/wiki/Efivarfs#Kernel (every kernel from our GentooCDs have it)
3. the efivarfs must be mounted: https://wiki.gentoo.org/wiki/Efibootmgr#EFI_vars (every GentooCD mount it automatically)

I recommend you to boot with our Gentoo Minimal CD and then chroot into your Gentoo:
https://wiki.gentoo.org/wiki/User:Pietinger/New_at_Gentoo#Pause_during_Installation
Of course you will mount it to /boot and not to /efi because you have an old installation. See more here: https://forums.gentoo.org/viewtopic-t-1165115-highlight-.html

Then do again your grub-install and grub-mkconfig.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 668
Location: Switzerland

PostPosted: Mon Mar 25, 2024 1:30 pm    Post subject: Reply with quote

In my BIOS the CSM was indeed enabled.
After disabling it, the boot process worked fine.
Thank You!
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4157
Location: Bavaria

PostPosted: Mon Mar 25, 2024 3:41 pm    Post subject: Reply with quote

jody wrote:
Thank You!

You are very Welcome ! :D
_________________
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