OCI : Grubby commands fail with error "/usr/bin/grub2-editenv: error: invalid environment block"
Applies to:
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64
Oracle Linux 8 – Oracle Linux 9
Symptoms:
Failed to change the default kernel
[root@xxxx ~]# grubby --set-default "/boot/vmlinuz-5.15.0-208.159.3.el8uek.x86_64" grub2-editenv: error: invalid environment block. The default is /boot/loader/entries/c20b6092d8ce4c58832f6d822e93dcec-5.15.0-208.159.3.el8uek.x86_64.conf with index 2 and kernel /boot/vmlinuz-5.15.0-208.159.3.el8uek.x86_64
Cause:
The file /boot/grub2/grubenv
is either corrupted or not exactly 1024B (1K) in size.
Solution:
Confirm that grubenv
file is pointing to the proper location
ls -l /boot/grub2/grubenv
0