Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Updated grub and now system is dead [SOLVED]
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
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 455
Location: Saitama, JP

PostPosted: Fri Feb 16, 2024 6:18 am    Post subject: Updated grub and now system is dead [SOLVED] Reply with quote

I did emerge -uDN @world. One of the packages updated was grub from 2.12 to 2.12-r1. After the update, before rebooting, I ran grub-mkconfig; probably not necessary, but it doesn't hurt -- or does it? After restarting, the BIOS splash screen flashes for a half a second and drops me in the BIOS setup screen. I didn't do much in the BIOS config -- I don't think, but it still doesn't boot at all.
When I was in the BIOS setup screen the first time I think I had to choose EFI or grub. I ignorantly chose grub. It didn't help.
Any suggestions other than wipe everything and reinstall? I was thinking of running grub-install, if I can get access to it booting from a live USB stick. My system is an AMD Ryzen 5000 series
with Aorus BIOS. Please help.


Last edited by sl70 on Sat Feb 17, 2024 9:32 am; edited 2 times in total
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 66

PostPosted: Fri Feb 16, 2024 9:58 am    Post subject: Reply with quote

sl70 wrote:
Any suggestions other than wipe everything and reinstall?

I think you'll never need to reinstall, unless that is what you want. Just chroot into your installation and try to configure your grub again. Make sure your /boot or /efi is mounted and run grub-mkconfig -o /(path to)/grub/grub.conf or something similar.

sl70 wrote:
When I was in the BIOS setup screen the first time I think I had to choose EFI or grub. I ignorantly chose grub. It didn't help.

What happens if you choose EFI instead?

Other option is boot your kernel via UEFI. I don't know why, but recently I've seen a lot of people having problems grub here in the forums. I really don't know why, because in my mind grub is supposed to be something that just works. (??)
You can try fix your grub, if it goes wrong you can try boot your kernel via UEFI. Here is a tutorial if it interests you.
_________________
Best Regards,
сокровенно
Back to top
View user's profile Send private message
_kopsu_
n00b
n00b


Joined: 31 Mar 2003
Posts: 72
Location: Muurame, Finland

PostPosted: Fri Feb 16, 2024 11:20 am    Post subject: Re: Updated grub and now system is dead Reply with quote

had similar problem, although it went gave 'grub_is_shim_lock_enabled' not found. had to chroot and downgrade grub to earlier sys-boot/grub-2.06-r9

[rant]
I have had lots of trouble with UEFI and the Gentoo guides about it are so hard to follow in my opinion. I have very very old system and I would need to delete ESP and create it and create keys, sign and enroll keys, there really should be some easy guide besides working gentoo-kernel and installkernel wich I don't use, I use gentoo-sources and manual install .. Maybe I have to reconsider this... I'm becoming lazy :D
I'm running my bios (Gigabyte AX370M-DS3H) now in setup mode and if only there would be easier way to make this work safe/secure way it would be good. Year ago I did some mistake and managed to brick my bios doing these secure boot/efibootmgr tricks, I had to hardware flash it(I used arch and flashrom with cheap chinese ch341 usb stick), luckily that worked out and I did think that I don't mess with bios/efi anymore! It was hell.... Here we go again... [/rant]

sl70 wrote:
I did emerge -uDN @world. One of the packages updated was grub from 2.12 to 2.12-r1. After the update, before rebooting, I ran grub-mkconfig; probably not necessary, but it doesn't hurt -- or does it? After restarting, the BIOS splash screen flashes for a half a second and drops me in the BIOS setup screen. I didn't do much in the BIOS config -- I don't think, but it still doesn't boot at all.
When I was in the BIOS setup screen the first time I think I had to choose EFI or grub. I ignorantly chose grub. It didn't help.
Any suggestions other than wipe everything and reinstall? I was thinking of running grub-install, if I can get access to it booting from a live USB stick. My system is an AMD Ryzen 5000 series
with Aorus BIOS. Please help.
Back to top
View user's profile Send private message
fergis
n00b
n00b


Joined: 15 Jan 2024
Posts: 1

PostPosted: Fri Feb 16, 2024 11:51 am    Post subject: Reply with quote

there is a news item saying that it is necessary to re-run 'grub-install' and 'grub-mkconfig' after a grub update, see https://bugs.gentoo.org/920708
Back to top
View user's profile Send private message
soundrolf
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2016
Posts: 131
Location: Cologne / Germany

PostPosted: Fri Feb 16, 2024 5:31 pm    Post subject: Reply with quote

Today updated with emerge -avuUD @world grub from 2.06-r9 to 2.12-r1.
No booting possible
Boot with ventoy super_grub_disk, Gentoo booted
Make emerge -av --depclean sys-boot/grub
Mask sys-boot/grub:2/2.12-r1
New installation sys-boot/grub
emerge -av sys-boot/grub:2/2.06-r9
Mount /boot
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Gentoo running now
_________________
Regards
soundrolf

MOBO: ASUS PRIME B550M-K BIOS 3607 03/18/2024
CPU: AMD Ryzen 7 5800X 8-Core Processor (16) @ 3800 MHz
GPU: NVIDIA GK208B [GeForce GT 710] driver: nvidia v: 470.256.02
RAM: 80GB crucial DDR4 3200 MHz 2x8GB 2x32GB
Back to top
View user's profile Send private message
eeckwrk99
Apprentice
Apprentice


Joined: 14 Mar 2021
Posts: 232
Location: Gentoo forums

PostPosted: Fri Feb 16, 2024 6:26 pm    Post subject: Reply with quote

Code:
# emlop l -e sys-boot/grub
2024-02-16 21:19:21  1:09 sys-boot/grub-2.12-r1

Code:
# emlop l -s u -e sys-boot/grub
2024-02-16 21:19:20  1 sys-boot/grub-2.06-r9

Code:
$ tail -n 12 /var/log/portage/elog/summary.log
>>> Messages generated by process 690806 on 2024-02-16 21:19:21 CET for package sys-boot/grub-2.12-r1:

LOG: postinst
For information on how to configure GRUB2 please refer to the guide:
    https://wiki.gentoo.org/wiki/GRUB2_Quick_Start
WARN: postinst

Re-run grub-install to update installed boot code!
Re-run grub-mkconfig to update grub.cfg!


This + the news item, kind of hard to miss... all good here.
Back to top
View user's profile Send private message
rfx
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2023
Posts: 142
Location: de-by

PostPosted: Sat Feb 17, 2024 8:18 am    Post subject: Reply with quote

soundrolf wrote:

Mask sys-boot/grub:2/2.12-r1
emerge -av sys-boot/grub:2/2.06-r9
Mount /boot
grub-mkconfig -o /boot/grub/grub.cfg


Same error here. This workaround fixed it. Just booting minimal gentoo install, mount stuff, chroot, mask 2.12-r1, now remerge 2.06-r9, run grub-mkconfig -o /boot/grub/grub.cfg and it is working again
Back to top
View user's profile Send private message
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 455
Location: Saitama, JP

PostPosted: Sat Feb 17, 2024 9:28 am    Post subject: Reply with quote

soundrolf wrote:
Today updated with emerge -avuUD @world grub from 2.06-r9 to 2.12-r1.
No booting possible
Boot with ventoy super_grub_disk, Gentoo booted
Make emerge -av --depclean sys-boot/grub
Mask sys-boot/grub:2/2.12-r1
New installation sys-boot/grub
emerge -av sys-boot/grub:2/2.06-r9
Mount /boot
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Gentoo running now


Thank you tremendously! You saved me. One thing I had to do was use this line in grub-install:
Code:
(chroot) > grub-install --target=x86_64-efi --efi-directory=/boot --removable

Found it on this page

I read the eselect news all the time but sometimes I forget what I read. I'm only 5 years younger than Joe Biden.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3940
Location: Hamburg

PostPosted: Sat Feb 17, 2024 9:27 pm    Post subject: Reply with quote

For me it worked without the "--removeable" parameter.
Back to top
View user's profile Send private message
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 455
Location: Saitama, JP

PostPosted: Sat Feb 17, 2024 11:01 pm    Post subject: Reply with quote

I would think it depends on your BIOS.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 495

PostPosted: Sun Feb 18, 2024 9:26 am    Post subject: Reply with quote

The option "--removable" installs the grub binary to the ESP under "\EFI\BOOT\BOOTX64.EFI". If you have another bootloader installed, it is possible that the other bootloader will overwrite "\EFI\BOOT\BOOTX64.EFI" with its own binary.
Back to top
View user's profile Send private message
MurphyG
n00b
n00b


Joined: 19 Oct 2010
Posts: 26

PostPosted: Sun Feb 18, 2024 8:46 pm    Post subject: Reply with quote

Always good to have a rescue Linux on a bootable USB drive at hand. Additionally I now also prepared a script with the steps from the chroot how-to as `/chrootThis.sh` (am I reinventing the wheel here?).

Code:

#!/bin/sh
# Prepare and mount this filesystem with chroot.
# Current working directory must be the location of this script.
set -e

mount --rbind /dev dev
mount --make-rslave dev
mount -t proc /proc proc
mount --rbind /sys sys
mount --make-rslave sys
mount --rbind /tmp tmp
mount --bind /run run

cp /etc/resolv.conf etc

echo "Execute this:"
echo ". /etc/profile"
echo 'export PS1="(chroot) $PS1"'

chroot . /bin/bash
Back to top
View user's profile Send private message
grapefruithoarder2000
n00b
n00b


Joined: 19 Feb 2024
Posts: 11

PostPosted: Thu Feb 22, 2024 8:11 am    Post subject: Reply with quote

MurphyG wrote:
Always good to have a rescue Linux on a bootable USB drive at hand. Additionally I now also prepared a script with the steps from the chroot how-to as `/chrootThis.sh` (am I reinventing the wheel here?).

Code:

#!/bin/sh
# Prepare and mount this filesystem with chroot.
# Current working directory must be the location of this script.
set -e

mount --rbind /dev dev
mount --make-rslave dev
mount -t proc /proc proc
mount --rbind /sys sys
mount --make-rslave sys
mount --rbind /tmp tmp
mount --bind /run run

cp /etc/resolv.conf etc

echo "Execute this:"
echo ". /etc/profile"
echo 'export PS1="(chroot) $PS1"'

chroot . /bin/bash


:D Well maybe. I had the exact same idea after experiencing this same problem a day or two ago. So i made a chroot script to save myself from typing a whole lot of commands.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5104
Location: Bavaria

PostPosted: Thu Feb 22, 2024 1:38 pm    Post subject: Reply with quote

MurphyG wrote:
[...] Additionally I now also prepared a script with the steps from the chroot how-to as `/chrootThis.sh` (am I reinventing the wheel here?[...]

Maybe ... https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Mounting_the_necessary_filesystems says:
Quote:
If using Gentoo's install media, this step can be replaced with simply: arch-chroot /mnt/gentoo

(but I haven't tested it yet)

The script is useful if you boot with a different LiveCD. ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Q-collective
Advocate
Advocate


Joined: 22 Mar 2004
Posts: 2076

PostPosted: Sat Mar 30, 2024 2:08 am    Post subject: Reply with quote

sl70 wrote:
soundrolf wrote:
Today updated with emerge -avuUD @world grub from 2.06-r9 to 2.12-r1.
No booting possible
Boot with ventoy super_grub_disk, Gentoo booted
Make emerge -av --depclean sys-boot/grub
Mask sys-boot/grub:2/2.12-r1
New installation sys-boot/grub
emerge -av sys-boot/grub:2/2.06-r9
Mount /boot
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Gentoo running now


Thank you tremendously! You saved me. One thing I had to do was use this line in grub-install:
Code:
(chroot) > grub-install --target=x86_64-efi --efi-directory=/boot --removable

Found it on this page

I read the eselect news all the time but sometimes I forget what I read. I'm only 5 years younger than Joe Biden.

Life saver. Thank you.

I also sometimes miss important news items apparently.
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