Modify element ordering in grub

Recovering this topic since I’ve found some useful insights here, but still I can’t manage to achieve what I’m looking for.

I have a simple dual boot Manjaro-Windows10 with the typical GRUB menu which is like this:

Manjaro
Advanced Options
Windows 10

What I would like to do is simply put the “Advanced Options” submenu at the bottom, under the Windows 10 entry. I can do that by editing the /boot/grub/grub.cfg file, but of cours it gets overwritten at the next kernel or grub update.
So, following the advice here I’ve been able to remove the “Advanced Options” submenu by editing the /etc/grub.d/10_linux file.
What I would like to do now is creating another file in the grub.d directory that only creates the “Advanced Options” submenu and rename it so that it would appear in order after the Windows entry. I’ve done various experiments with no luck for now.

Could someone help me with that?

The Advanced Options submenu can be removed by adding an option to /etc/default/grub configuration

echo 'GRUB_DISABLE_SUBMENU=true' | sudo tee --append /etc/default/grub

and update GRUB

sudo update-grub

GRUB/Tips and tricks - Disable submenu | ArchWiki

Hi @nikgnomic, thanks for your help!

What I’m trying to do is not remove the Advanced Options submenu, but moving it to the bottom and make it persist any grub-updates. I’ve been able to move it by editing the /boot/grub/grub.cfg file, but from my understanding a grub-update would restore the menu as it was.

System file /boot/grub/grub.cfg has this comment:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

So changes to this file would be overwritten whenever GRUB is updated

But if GRUB configuration changes are made in file /etc/default/grub changes are not implemented until GRUB is updated

Users coming from other distributions may not realise that Manjaro GRUB does not force the first menuentry in GRUB as the default option

Manjaro uses 2 options in /etc/default/grub

GRUB_DEFAULT=saved
GRUB_SAVED_DEFAULT=saved

If a user chooses to boot from something other than the first menuentry, GRUB will continue to boot the user selected menuentry

But /etc/default/grub can also be reconfigured to boot a specific named menuentry

Latest update messed up my GRUB Menu

The option GRUB_DEFAULT can be edited to use a specific number or name from the menuentry list on GRUB

Using the menuentry number is not good for the Windows boot option because the number will change if Manjaro kernels are added or removed from the list in GRUB

If OP wanted grub to boot Windows, option would be something like

GRUB_DEFAULT="Windows Boot Manager (on /dev/sda2/)"

I would not recommend editing anything in /etc/grub.d/ to change order of menuentry items in GRUB because I experienced problems with updates following changes to /etc/grub.d/
( grub-customizer :scream:)
I had this problem over 4 years ago but I still recall the hassles of repairing GRUB

But since I have only changed GRUB configuration in /boot/grub/grub.cfg I have had no problems with GRUB updating
(except for getting an occasional /boot/grub/grub.cfg.pacnew to check and merge new settings)

If you still intend to modify GRUB configuration to change the order of menuentry items I recommend you make backup copies of any files before implementing changes

Hi @nikgnomic!

You say:

That’s why I was looking for another way of editing the order of GRUB entries, instead of directly editing /boot/grub/grub.cfg.

But then you say:

So, what do you mean? To correctly edit the entries order, without having to repeat the operation at each update, should I edit the /boot/grub/grub.cfg file or others?

Unfortunately in /etc/default/grub there’s no way of changing the order of entries. I’m simply trying to move the submenus to the bottom, but the default option would still be Manjaro, and Windows as a second one.
It’s just a visual change, for which I would like to have the OSes entries at the top of the list and the other submenus at the bottom. But if it’s too complicated of course I will desist, I just thought there would be a correct way to do this.

Editing /etc/default/grub is the only way I know of to change GRUB that will survive update process

The package grub-customizer mentioned in previous post used to change the menuentry order by renaming files in /etc/grub.d/ but this package was dropped from Manjaro repositories because it caused many problems with broken, non-bootable GRUB updates

Grub conflicts with grub-customizer - #24 by cscs
grub-cusomizer is crap software. dont use it. it doesnt work well. it breaks things.

if you must use it … then use it with some other grub … however you do it … you are on your own.

Ah great, good to know!
I always thought that /etc/default/grub would be overwritten by each GRUB update, taking the configuration from /etc/grub.d/.
So that solves my issues, thank you @nikgnomic!!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.