GRUB2 rescue in CentOS 8... How?

Issues related to applications and software problems and general support
Post Reply
yaomtc
Posts: 23
Joined: 2017/04/22 00:07:03

GRUB2 rescue in CentOS 8... How?

Post by yaomtc » 2019/11/05 02:16:02

There doesn't seem to be any up-to-date documentation for rescuing a CentOS install, or any that work for me, anyway.

Has anyone tried this recently and gotten it to work? The latest documentation hasn't been updated since CentOS 6, apparently. I just run into issues like:

Code: Select all

/grub2-install: error: /usr/lib/grub/x86_64/modinfo.sh doesn't exist. Please specify --target or --directory.
Or:

Code: Select all

Package grub2-efi-ia32 available, but not installed.
No match for argument: grub32-efi
After trying this article for CentOS 7.

I just run into nothing but errors whatever I try. Has this feature been tested? Is my PC just really weird for some reason? What do I try next?

(Also, why does the rescue disc not even start up an internet connection in case you need to install stuff like this?)

nouvo09
Posts: 146
Joined: 2009/09/19 19:21:36
Location: Paris, France

Re: GRUB2 rescue in CentOS 8... How?

Post by nouvo09 » 2019/11/05 10:49:12

don't post the errors without posting the commands themselves. let us see if they are usefull or nit.

BTW there is no other way to rescue a system, so the doc is up-to-date.
Member of centos-FR forum

yaomtc
Posts: 23
Joined: 2017/04/22 00:07:03

Re: GRUB2 rescue in CentOS 8... How?

Post by yaomtc » 2019/11/05 17:59:12

How is it up to date, though, when this happens?

Code: Select all

# grub-install /dev/sdb
bash: grub-install: command not found
The documentation should say grub2-install, shouldn't it?

But,

Code: Select all

# grub2-install /dev/sdb
/grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.

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

Re: GRUB2 rescue in CentOS 8... How?

Post by TrevorH » 2019/11/05 18:58:31

The CentOS wiki link you posted was last updated in 2012 and would be for CentOS 6 not 7 or 8 which use grub2 not grub legacy.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

lightman47
Posts: 999
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: GRUB2 rescue in CentOS 8... How?

Post by lightman47 » 2019/11/05 19:57:41

HANG ON a bit!

Even in CentOS 7 when I try to find help, default CentOS documentation links often point back to archaic RH versions 4 or 5 or . I've learned to NOT use the CentOS supplied links for anything other than basic knowledge.

(sorry)
Multple login IDs are not your friend when asking for help!

yaomtc
Posts: 23
Joined: 2017/04/22 00:07:03

Re: GRUB2 rescue in CentOS 8... How?

Post by yaomtc » 2019/11/06 00:45:28

If it were easier to contribute to the wiki, I could fix it myself.
As much as we would like to have an open Wiki where everyone can write without jumping through hoops, we're not able to do so. Say thanks to all the spammers out there who "contribute" their stuff everywhere on the web.
[...]
but we hope to change the process in the future so it becomes easier to contribute to the Wiki.
ArchWiki editor on abuse/vandalism:
It happens quite rarely so I don't think a dedicated policy is needed.
I don't know what software you're using currently, but MediaWiki has a lot of options for combating spam.

desertcat
Posts: 662
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: GRUB2 rescue in CentOS 8... How?

Post by desertcat » 2019/11/06 10:18:57

There is a SECRET. GRUB2 is a piece of garbage, and there is a good chance that at some point GRUB2 is going out into the weeds. The SECRET is to be PROACTIVE and NOT REACTIVE. By "PROACTIVE" I mean you should EXPECT that at some point GRUB2 *will* go out into the weeds and you need to prepare NOW for that day.

But far to often people are "REACTIVE" -- they never expect that their GRUB2 will somehow get mangled and then they have to jump through a lot of hoops just to get their machines back up and running.

There is a great little utility called Grub Customizer (yum Install grub-customizer) in it there is a "rescue" of sorts but all it really does is to get your machine back up and running but, then it may create a few problems all of its own. But the actual "rescue" is actually quite simple:

How to restore this backup
--------------------------
* make sure you have root permissions (`gksu nautilus` or `sudo -s` on command line) otherwise you won't be able to copy the files
* to fix an unbootable configuration, just copy:
* '/etc/grub.d/backup/boot_grub' to '/boot/grub2'
* to reset the whole configuration (if it cannot be fixed by using grub customizer), also copy these files:
* '/etc/grub.d/backup/etc_grub_d' to '/etc/grub.d'
* '/etc/grub.d/backup/default_grub' to '/etc/default/grub'

You need to BACKUP *3* files:

1) /boot/grub2
2) /etc/default/grub
3) /etc/grub.d

Use file browser and/or the CLI and first create some sort of backup file directory (I created mine in /home/dcat/computers/grub_backup). Now go to /boot/grub2 and copy the entire directory to your backup file. Do the same for /etc/default/grub, and for /etc/grub.d.

Now you ready should GRUB2 go out into the weeds -- simply erase all 3 files and directories and copy your backup files in their respective places, run the command grub2-mkconfig -o /boot/grub2/grub.cfg then re-boot the machine.

viewtopic.php?f=48&t=66355

As an aside the directory that most frequently gets mangled is /etc/grub.d followed by /boot/grub2 which contains the all powerful grub.cfg

By being a bit Proactive you will be ready for the day that Grub2 suddenly decides to take a walk.

Post Reply

Return to “CentOS 8 - General Support”