The Case Of The Missing /boot/grub2/grub.cfg In CentOS8

Home » CentOS » The Case Of The Missing /boot/grub2/grub.cfg In CentOS8
CentOS 6 Comments

So I installed CentOS8. And I was looking for the grub config file:

[root@testbox ~]# ls -l /etc/grub2.cfg lrwxrwxrwx. 1 root root 22 Oct 2 13:01 /etc/grub2.cfg -> ../boot/grub2/grub.cfg
[root@testbox ~]#

But

[root@testbox ~]# ls /boot/grub2/
grubenv
[root@testbox ~]#

Why is it not there? FYI, I did try ‘yum reinstall grub2’ and no
/boot/grub2/grub.cfg for me.

6 thoughts on - The Case Of The Missing /boot/grub2/grub.cfg In CentOS8

  • Le 27/12/2019 à 04:11, Mauricio Tavares a écrit :

    You’re probably on an EFI system, and your grub.cfg is in a different location. Can’t remember it off the top of my head, but do

    # find /boot -name ‘grub.cfg’

    Cheers,

    Niki


    Microlinux – Solutions informatiques durables
    7, place de l’église – 30730 Montpezat Site : https://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32
    Mob. : 06 51 80 12 12

  • first. But, it would save time looking for files that have been already added to its db, specially compared to running find in a large system.

    Right you are. I have to say sometimes I wonder if running EFI
    in this system (200GB boot drive I am using 10G of it) makes sense. With that said, if that is the case, why would the alias
    /etc/grub2.cfg still be created if it points to a non-existing file?
    Wouldn’t it make sense for it to just either not to be there at all or point to the efi one? I can make arguments for both sides, but not for a homeless alias.

    On a side note, would it be a case where both
    /boot/efi/EFI/CentOS/grub.cfg and /boot/grub2/grub.cfg are installed?

  • Other than the small amount of space that the UEFI volume uses, you should consider using uefi everywhere, since legacy boot is going away in the next couple years.

    I believe the broken symlink is going to exist for either legacy or UEFI boots, as an indicator of the boot loader for the “grubby” boot management tool.

    Having both resolve successfully would probably result in boot parameters not being updated automatically for the grub.cfg that you are actually using.


    Jonathan Billings

  • [root@linux etc]# rpm -qf /etc/grub2.cfg grub2-pc-2.02-0.80.el7.CentOS.x86_64
    [root@linux etc]# rpm -qf /etc/grub2-efi.cfg grub2-efi-x64-2.02-0.80.el7.CentOS.x86_64

    …in other words, the grub2.cfg link is installed with the grub2-pc package and the grub2-efi.cfg link is created with the grub2-efi package. You can probably get away without the grub2-efi package on a legacy bios system, but not the other way around, so an efi system will have both links.

    At the end of the day it’s harmless, don’t loose any sleep over it.

    Peter