Grub2-Bootloader Defect

Issues related to applications and software problems and general support
Post Reply
dcz01
Posts: 20
Joined: 2017/03/07 10:15:22

Grub2-Bootloader Defect

Post by dcz01 » 2021/05/11 14:28:28

Hello,

i have an bigger problem with one machine on UEFI with the Grub2-Bootloader.
I updated the machine some days ago with the command

Code: Select all

yum update -y --allowerasing
and so the following package was uninstalled:

Code: Select all

Removing dependent packages:
 grub2-efi-x64                 x86_64  1:2.02-90.el8                 @anaconda             1.8 M
Then the server was rebooted and couldn't start up normally.
So i tried a repair of the bootloader with an GParted-Live-CD (Debian).
These where my used commands:

Code: Select all

sudo mkdir /mnt/sysimage
sudo mount /dev/sda3 /mnt/sysimage
sudo mount /dev/sda2 /mnt/sysimage/boot
sudo mount /dev/sda1 /mnt/sysimage/boot/efi
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /sys /mnt/sys
sudo mount -t proc /proc /mnt/proc
grub2-install --efi-directory=/boot/efi --target=x86_64-efi /dev/sda
After that the system won't even start itself to CentOS 8 and it always waited for input at:

Code: Select all

grub > 
With the following command i could start it back to my CentOS 8.3.2011:

Code: Select all

grub > normal
Then it loaded the kernel before the update but i can use my system.

Now in the system (CentOS) i tried to reinstall the grub2-efi-x64 and used this two commands:

Code: Select all

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

Code: Select all

grub2-install /dev/sda
But the normal grub isn't installed anymore on the MBR and i must use always the normal command to boot manually.

The grub2-install always creates two dirs at /boot/grub2:
One fonts dir and one x86_64-efi dir.

Does anyone know how to fix this problem?

Greetings
dcz01

User avatar
TrevorH
Forum Moderator
Posts: 30785
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Grub2-Bootloader Defect

Post by TrevorH » 2021/05/11 14:42:34

Does the directory (or is it a file?) /sys/firmware/efi exist?
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

dcz01
Posts: 20
Joined: 2017/03/07 10:15:22

Re: Grub2-Bootloader Defect

Post by dcz01 » 2021/05/12 06:44:45

Yes, the directory /sys/firmware/efi exists:

Code: Select all

ls -la /sys/firmware/efi

drwxr-xr-x.  6 root root    0 11. Mai 15:36 .
drwxr-xr-x.  7 root root    0 11. Mai 15:36 ..
-r--r--r--.  1 root root 4096 12. Mai 08:42 config_table
drwxr-xr-x.  2 root root    0 11. Mai 15:36 efivars
drwxr-xr-x.  3 root root    0 12. Mai 08:42 esrt
-r--r--r--.  1 root root 4096 11. Mai 15:46 fw_platform_size
-r--r--r--.  1 root root 4096 12. Mai 08:42 fw_vendor
-r--r--r--.  1 root root 4096 12. Mai 08:42 runtime
drwxr-xr-x. 11 root root    0 12. Mai 08:42 runtime-map
-r--------.  1 root root 4096 11. Mai 15:36 systab
drwxr-xr-x. 76 root root    0 12. Mai 05:00 vars

dcz01
Posts: 20
Joined: 2017/03/07 10:15:22

Re: Grub2-Bootloader Defect

Post by dcz01 » 2021/05/12 09:25:11

And i forgot that in chroot above i also needed to use this command that grub2-install doesn't terminate with an error:

Code: Select all

mount --bind /sys/firmware/efi/efivars /mnt/sysimage/firmware/efi/efivars

dcz01
Posts: 20
Joined: 2017/03/07 10:15:22

Re: Grub2-Bootloader Defect

Post by dcz01 » 2021/05/12 10:22:27

Should i use or could i have damaged or overwritten my correct grubx64.efi file in /boot/efi/EFI/centos with the grub2-install command?
In the RedHat documentation this command isn't listed with UEFI: https://access.redhat.com/documentation ... d_Machines

And here is my problem i think and he has also overwritten his grubx64.efi file with grub2-install --efi-directory=/boot/efi --target=x86_64-efi /dev/sda.
https://thomas-leister.de/en/repair-fed ... ootloader/

Post Reply

Return to “CentOS 8 - General Support”