Triple boot bootloader order

I have installed Manjaro, Ubuntu and Win11 in that order on my system.
Grub bootloader correctly shows all three OS, I can load into any of them so everything is working fine.
It’s just irking me to change the order of appearance in the menu, it is currently as follows:

Manjaro
(Manjaro advanced options)
Windows
Ubuntu
(Ubuntu advanced options)
memtest

Is there any way I can edit /boot/grub/grub.cfg so that I can move Windows to a different location on the list? I am not comfortable using vi which is the only way I can open the file on KDE Plasma. I saw what I need to change in the file, I just do not know how to actually edit it as the file is locked.

I suspect it is because of alphabetical order in efi partition - Manjaro, Microsoft, Ubuntu
I tried efibootmgr --bootorder but still no effect

https://wiki.archlinux.org/title/GRUB#Custom_grub.cfg

https://wiki.archlinux.org/title/GRUB

1 Like

I know which lines to shuffle around, I just do not know how to do that - I am hopeless at vi and Kate needs permissions to open the file.

you need always sudo-rights to edit the grub-config.
usually you can edit grub with

kate /etc/default/grub

and you’ll get asked for password if you wanna save/store it.
afterwards you need to run

sudo mkinitcpio -P
sudo update-grub

for taking effect of the changes

1 Like

if I edit

/etc/default/grub,

I do not get the option to choose the order the different OS appear in grub; I must manually edit

/boot/grub/grub.cfg

which cannot be done with Kate, no way to change the file permission too.

try

sudo kate /etc/default/grub

As I said, I can open

/etc/default/grub

just fine, but the actual configuration of the order the OS appear is stored in

/boot/grub/grub.cfg

Grub.cfg is automatically generated and your changes will be overwritten on next update (next month as the kernel update comes).

1 Like

im using Manjaro LTS and even if it does overwrite it, I would just reapply the change,

for no reapply all week…
create a pacman hook as mkinitcpio ?
(model : /usr/share/libalpm/hooks/90-mkinitcpio-install.hook)
etc/pacman.d/hooks/91-grub-modif.hook

[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/vmlinuz
Target = usr/lib/initcpio/*
Target = usr/lib/firmware/*
Target = usr/src/*/dkms.conf

[Action]
Description = Updating my grub...
When = PostTransaction
Exec = xxx/myscript.sh
NeedsTargets

“myscript.sh” edit grub entries with sed


more simple
We can also change order with /etc/grub.d/, create a 09_window

1 Like