Grub2 UEFI Nightmare

Issues related to applications and software problems
Post Reply
morgz84
Posts: 4
Joined: 2019/05/07 21:13:26

Grub2 UEFI Nightmare

Post by morgz84 » 2019/05/30 21:11:49

Perhaps someone on here can save me from a nervous breakdown. The more I try and research Grub and it's internals, the more of a black art it seems to be. No definitive answers on anything, anywhere.

I was trying to create a UEFI bootable USB key and during this progress, got a bit careless on the command line and typed grub2-install and accidenttally hit enter without any parameters. Of course grub2install did it's thing and I got a mesaage telling me that it was successfully installed for target x86_64-efi. I thought nothing of it. All I have done, I thought, was simply reinstall grub with it's current settings. How wrong could I possibly be. Now on boot, I just get a plain dumb grub> prompt. I can load in the config file with

Code: Select all

configfile (hd0,gpt1)/EFI/redhat/grub.cfg
and boot the system. No matter what I do with the parameters in grub2-install I have the same result. This is a UEFI 64 bit system. I am a bit confused with the file layout in the ESP partition. It seems to create a "redhat" directory, along with loads of firmware boot files and my grub.cfg, but also a "scientific" dir with a couple of random fw files, although this seems to be normal according to the fresh install I have done on a VM trying to work this out. I have no doubt this mess can be fixed with a simple command line, but I just don't have a clue any more. Like I say, it seems to be a complete black art. I can't be the only idiot in the world to have made this fateful (or shouldn't have been fateful) mistake. Please help!

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Grub2 UEFI Nightmare

Post by avij » 2019/05/30 22:06:40

CentOS writes its stuff to /boot/efi/EFI/centos

If yours writes to "redhat" or "scientific", chances are you are not running CentOS at all.

morgz84
Posts: 4
Joined: 2019/05/07 21:13:26

Re: Grub2 UEFI Nightmare

Post by morgz84 » 2019/05/31 07:18:23

Hi, I'm running Scientfic Linux 7.6 which is to all intents and purposes CentOS.

morgz84
Posts: 4
Joined: 2019/05/07 21:13:26

Re: Grub2 UEFI Nightmare

Post by morgz84 » 2019/05/31 09:00:10

I thought I should update this in case someone goes to the trouble of writing a long answer and / or someone else has this issue. I pressed F12 on my BIOS screen and saw that "scientific" was the first boot choice. I changed to "redhat" and voila, it immediately went to my normal grub menu and then subsequently booted. I now understand that with grub, you can have seperate bootloader instances. When I ran grub2-install, it created a new instance called "scientific", but this just had the basic firmware and no other supporting files. When it did this, it also changed my UEFI to point to this new incomplete instance. Even when I subsequently ran grub2-install with the --bootloader-id=redhat flag, it wasn't changing the boot order back, I had to change it back. I am not sure if this is a squirk / bug of Scientific Linux or whether you get similar behaviour in CentOS. From everything I have seen since using this OS, it is identical to CentOS, which is why I tend to post questions here due to it's larger user base. I run Scientific here at work, due to working for scientific organisation which uses it a lot and want to use the same platform I am supporting.

Anyway, I hope this whole experience of mine helps someone else in a similar boat.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Grub2 UEFI Nightmare

Post by TrevorH » 2019/05/31 13:37:40

Hi, I'm running Scientfic Linux 7.6 which is to all intents and purposes CentOS.
Except in this one place. CentOS has modded grub, SL have not.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply