Grub2 commands fail with error /usr/bin/grub2-editenv: error: invalid environment block or error: environment block too small

Solution Verified - Updated -

Issue

  • Failed to change default kernel entry. Note: In below example, we are using 1 (Second kernel from grub.cfgfile)

    [root@rhel~]# grub2-set-default 1
    /usr/bin/grub2-editenv: error: invalid environment block.
    /usr/bin/grub2-editenv: error: invalid environment block.
    /usr/bin/grub2-editenv: error: invalid environment block.
    
    [root@rhel~]# grub2-set-default 1
    /usr/bin/grub2-editenv: error: environment block too small.
    
  • grub2-mkconfig fails with environment block too small.

    [root@rhel~]# grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    /usr/bin/grub2-editenv: error: environment block too small.
    

Environment

  • Red Hat Enterprise Linux 7 and later
    • grub2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content