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

Shared Hosting: Migrating Your Site Seamlessly

If you’re new to web hosting, the idea of moving your website from one provider to another might sound intimidating.…

3 days ago

Top 15 WooCommerce Plugins to Power Your eCommerce Store in 2025

WooCommerce powers over 5 million online stores, and its true potential comes alive with plugins that enhance functionality. The right…

5 days ago

Explore the WordPress Theme Editor: Customization Made Easy

When you first launch a WordPress website, it comes with a theme that controls how your site looks and feels.…

2 weeks ago

Make in India, Make for the World: How Hostripples Empowers Modi’s Vision

Introduction Prime Minister Narendra Modi’s clarion call — “Make in India, Make for the World” — is not just a…

3 weeks ago

AI – Powered Customer Support in Hosting: Chatbots & Virtual Assistants

Customer support has always been the backbone of the web hosting industry. From helping users set up domains to troubleshooting…

1 month ago