Centos 8 elrepo Kernel-ML boot issue - grub error


  • When using elrepo kernel-ml in centos 8 you might experience grub is failing and centos 8 is failed to boot. With below message :

    error: file '/boot/grub/grubenv' not found.
    error: file '/boot/grub/i386-pc/increment.mod' not found.
    error: file '/boot/grub/grubenv' not found.
    

    if grub is failing and centos 8 failed to boot do this steps:

    boot into rescue mode mount centos disk :

    then you need to change the line in /etc/default/grub by editing the file :
    GRUB_ENABLE_BLSCFG=true to GRUB_ENABLE_BLSCFG=false

    then rebuild grub :

    grub2-mkconfig -o /boot/grub2/grub.cfg
    

    example :
    [root@test ~]# cat /etc/default/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"
    GRUB_ENABLE_BLSCFG=true
    GRUB_DISABLE_UUID=true
    GRUB_DISABLE_LINUX_UUID=true
    /etc/default/grub

    [root@test ~]# cat /etc/default/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"
    GRUB_ENABLE_BLSCFG=false
    GRUB_DISABLE_UUID=true
    GRUB_DISABLE_LINUX_UUID=true

    Best to run after dnf update/yum update :

    sed -i 's/GRUB_ENABLE_BLSCFG.*/GRUB_ENABLE_BLSCFG=false/' /etc/default/grub
    grub2-mkconfig -o /boot/grub2/grub.cfg
    

Recent Topics