CloudLinux Boot Fail | /etc/grub2.cfg points to the wrong file instead of /boot/grub2/grub.cfg

Hello,

Error :

/sbin/dracut: line 1137: /proc/crypto: No such file or directory
grep: /boot/grub2/grub.cfg: No such file or directory
grep: /boot/grub2/grub.cfg: No such file or directory

[WARNING] /boot/grub2/grub.cfg is missing
[WARNING] Kernel 3.10.0-614.10.2.lve1.4.56.el7.x86_64 GRUB entry is missing
[WARNING] Kernel 3.10.0-614.10.2.lve1.4.56.el7.x86_64 initramfs GRUB entry is missing
[WARNING] /etc/grub2.cfg is not a link
[WARNING] /etc/grub2.cfg points to the wrong file instead of /boot/grub2/grub.cfg

 

This is may be due to EFI enabled boot.

To Fix this issue follow the below steps :

# ls -la /boot/efi/EFI/centos/
total 2024
drwxr-xr-x 3 root root    4096 Jun 23 00:31 .
drwxr-xr-x 3 root root    4096 Jun 22 11:39 ..
drwxr-xr-x 2 root root    4096 Jun 23 00:28 fonts
-rwxr-xr-x 1 root root 1024736 Nov  7  2016 gcdx64.efi
-rwxr-xr-x 1 root root    1024 Jun 23 21:42 grubenv
-rwxr-xr-x 1 root root 1024736 Nov  7  2016 grubx64.efi
( as you can see, there is no config file grub.cfg above)

# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
(the config has been generated)
# ls -la /boot/efi/EFI/centos/grub.cfg
-rwxr-xr-x 1 root root 5235 Jun 24 06:15 /boot/efi/EFI/centos/grub.cfg

# ls -la /etc/grub2.cfg
lrwxrwxrwx 1 root root 22 Jun 23 00:28 /etc/grub2.cfg -> ../boot/grub2/grub.cfg

# rm /etc/grub2.cfg
rm: remove symbolic link ‘/etc/grub2.cfg’? y

# ln -s ../boot/efi/EFI/centos/grub.cfg /etc/grub2.cfg

# ls -la /etc/grub2.cfg
lrwxrwxrwx 1 root root 31 Jun 24 06:22 /etc/grub2.cfg -> ../boot/efi/EFI/centos/grub.cfg
(i.e. the symlink has been corrected to point to the new correct grub.cfg in EFI)


After the next/each kernel update please ensure that the file /boot/efi/EFI/centos/grub.cfg 
contains the new kernel or just re-generate it by running:
# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
I think the action above should be done automatically during the kernel update and you don't need to 
check it manually -- but I wish to inform you about this, so you'll be aware and recheck just to 
ensure that grub.cfg is Ok before the next reboot.

Also if the system uses EFI, then the following command will show you the boot order (in other case, 
it will show nothing/error):
# efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0004,0005,0006,0007,0008,0009,0000,0002,000A
Boot0000* centos
Boot0002  UEFI: Built-in EFI Shell
Boot0004* UEFI: Intel(R) I350 Gigabit Network Connection
Boot0005* UEFI: IP4 Intel(R) I350 Gigabit Network Connection
Boot0006* UEFI: IP6 Intel(R) I350 Gigabit Network Connection
Boot0007* UEFI: Intel(R) I350 Gigabit Network Connection
Boot0008* UEFI: IP4 Intel(R) I350 Gigabit Network Connection
Boot0009* UEFI: IP6 Intel(R) I350 Gigabit Network Connection
Boot000A  Hard Drive




HR-ADMIN

Recent Posts

Website Affirmations for 2026: Build, Grow, and Succeed Online

With 2026 just days away, it’s time to reimagine your website’s future. Hostripples encourages businesses, creators, and entrepreneurs to begin…

2 weeks ago

Cron Jobs: Automate Everything While You Sleep

Cron Jobs – The Unsung Heroes Think of cron jobs as the unsung heroes of your server — capes optional,…

2 weeks ago

Designing a Christmas Website: Creative Ideas & Best Practices

With vibrant colors, cheerful graphics, and a sprinkle of festive magic, your website can instantly create an emotional connection and…

3 weeks ago

Meet Sora: The Game-Changing AI Video Model from ChatGPT

The world of artificial intelligence is evolving faster than ever — and one of the biggest breakthroughs is here. Sora,…

1 month ago

How to Design a Website for Black Friday 2025 (Complete Guide)

Black Friday 2025 is here — the biggest shopping moment of the year, where customers expect unbeatable prices, fast performance,…

1 month ago