Grub.cfg gets reordered every kernel update

I need some guidance in figuring out what changes lately have caused every grub rebuild by grub-mkconfig to put the UEFI Firmware Setting menu entry first in the grub.cfg file.

This causes the next reboot to boot straight to the BIOS since the boot order in /etc/default/grub is still the normal GRUB_DEFAULT=“0”

I have to manually edit the /boot/grub/grub.cfg file every time to put it last in the file.

This all seemed to change back around August when the new grub scripts were added by updates.

But I can’t find which script is putting the UEFI Firmware entry first in the grub.cfg file. I rather change that one file that is causing this reorder every time grub gets updated by kernel updates than having to manually edit grub.cfg every time.

Has anyone else seen this new behavior and know the fix?

You should never do that with GRUB2, as it is well known that all manual changes are overwritten automatically, on each boot, which is also stated in the file one would manually edit.

If you use GRUB2, you can use GRUB tools to change order, etc.

However, it is recommended to use something like Grub Customizer, as explained here, in Q3:

Well, I wouldn’t have manually edit the grub.cfg if the linux scripts would not keep reordering the grub compile. I want to know which script keeps doing this.

I could just change /etc/default/grub to point at a different default number, but why should I? 0 is the default normally.

And grub customizer messes up the grub big time since Ubuntu 20.04. I think using it is what precipitated this problem when the new scripts in /etc/grub.d; 11_linux.dpkg-dist, 12_linux_zfs.dpkg-dist, and 13_linux_zfs showed up. Never had any issues with grub until these new scripts were installed by the updater.

Only when I removed grub customizer did I get a stable grub configuration that didn’t keep booting to the development partition. That all changed when those new scripts were installed that put the UEFI Firmware as default boot order.

This usually is only possible to happen, if you mix up which GRUB2 settings you are editing. If you always edit the correct one, there is not much that can be messed up.

I never edited anything in grub customizer. Only used the move or delete tools. But for some reason it always got confused because I have only one EFI partition on the drive that contains the daily driver partition and the development partition. I had to keep going into grub customizer from the development partition to make changes to the grub configuration for the daily driver.

For some reason grub customizer always had the two grub environments cross-linked somehow. The grub files are completely separate for each partition. So why does manipulating the one in the development partition affect the one in the main partition. And vice versa.

As I stated, grub customizer caused more issues than it was supposed to solve. I am not the only person to comment that grub customizer does not run well on Ubuntu 20.04.

1 Like

I’m on Linux Mint, but I am also having a problem with Grub Customizer.

From what I could figure out, grub customizer creates its own configuration files. But it swapped the UUID’s of my two partitions. But even after deleting the customizers config, the UUID swap kept happening. And every new kernel update that invoked grub-mkconfig, the grub configurations kept getting misconfigured.

And that it happened even though I never touched the UUID numbers in any grub configuration file.

As I stated, I have used grub customizer since Ubuntu 18.04 and never had any issues with it. Even used it on Ubuntu 20.04 when I first upgraded. The problem with it started with those new numbered scripts for the alternate file systems that the updater installed.