1

When I cd /grub.d OS doesn't go to directory grub2.cfg and grub2-efi.cfg are showing as red. This means Grub2 is broken. This is on a Fedora distro.

lrwxrwxrwx.  1 root root       22 May  2  2018 grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx.  1 root root       31 May  2  2018 grub2-efi.cfg -> ../boot/efi/EFI/centos/grub.cfg
drwx------.  2 root root     4096 May  2  2018 grub.d

FWIW, I found out I can't use the commonly recommended Grub commands, as I can’t mount my EFI, not entirely sure why but it could be because both of the hard drives are in RAID0 mode in the Intel OROM utility. Setting them as non-RAID drives may enable individual partitions to be mounted. Not sure though, so I have to mount my EFI first.

How can this be fixed?

Giacomo1968
  • 55,001

1 Answers1

0

Unclear what Linux distro you are on, but as explained here on this RedHat 7 system administrator’s guide, you can just run:

sudo grub2-mkconfig

And you are good to go. As explained here:

The GRUB 2 configuration file, grub.cfg, is generated during installation, or by invoking the /usr/sbin/grub2-mkconfig utility, and is automatically updated by grubby each time a new kernel is installed. When regenerated manually using grub2-mkconfig, the file is generated according to the template files located in /etc/grub.d/, and custom settings in the /etc/default/grub file. Edits of grub.cfg will be lost any time grub2-mkconfig is used to regenerate the file, so care must be taken to reflect any manual changes in /etc/default/grub as well.

If you are using Ubuntu, you can run this command as explained here in the Ubuntu 18.04 man pages; should work for older versions of Ubuntu as well:

sudo update-grub

That said, it is explained on that page as follows:

update-grub is a stub for running grub-mkconfig -o /boot/grub/grub.cfg to generate a grub2 config file.

So hey, might as well try running that command directly like this:

grub-mkconfig -o /boot/grub/grub.cfg
Giacomo1968
  • 55,001
  • updated subject line to include Distro | Fedora. – mister mcdoogle Mar 05 '19 at 03:57
  • Makes sense. Now, would you suggest differently in a situation where you were booting from a USBOS, trying to re-assemble a raid. – mister mcdoogle Mar 05 '19 at 06:48
  • @JesseMacDougall I don’t know if booting from a USB matters in a case like this. If you found this answer to be helpful, please up vote it. If this is the answer that's solved your problem, please be sure to check it off as such. – Giacomo1968 Mar 05 '19 at 15:13
  • 1
    thanks for the reminder. I don't have 15 rep to vote your response up.

    Problem isn't solved yet. I found out I can't use those grub commands, as I cant mount my EFI, not entirely sure why but it could be because both of the hard drives are in RAID0 mode in the Intel OROM utiility. Setting them as non-RAID drives may enable individual partitions to be mounted. Not sure though, so I have to mount my EFI first

    – mister mcdoogle Mar 06 '19 at 03:59