Change boot order Fedora and Windows 11

What is the proper way (using grub2) to change the boot order in the boot menu?
I currently have Fedora 37 installed in a dual boot configuration with Windows 11.
Fedora is the default option, and I want to have Windows 11 as the default option.
Thank you!

Changing the sequence of the boot menu is independent of changing the default.

Changing the default is simple and the method could be found trivially with google. (I don’t remember it well enough off the top of my head to simply tell you).

So far as I know, changing the sequence is an undocumented aspect of the /boot/grub2/grub.cfg file. I don’t really think that is what you actually want. But I might as well put that answer here (I’ve put it in other threads). In that file there are a pair of lines

insmod blscfg

Those represent all the menuentry items that are generated from the directory /boot/loader/entries which should include all your Fedora boot entries.

The other entries (I expect including Windows 11) are in /boot/grub2/grub.cfg as menuentry items (each multi-line in what should be obvious overall syntax). You can change the order of those menuentry items relative to each other and relative to the whole group of automatic items, by changing the relative order within /boot/grub2/grub.cfg

If I’m wrong about where your Windows 11 entry is (if it is also set up to be one of the automatic ones), I’m pretty sure you can change the relative order within the automatic ones by renaming the files within /boot/loader/entries

Thank you! I want to change the boot menu order to see WIndows 11 at the top of the list and below other options.

You are correct. It is easy to set the default option, but that isn’t what I want.

The contents of both the /boot/grub2/grub.cfg file and the /boot/loader/entries/ directory are modified automatically in a variety of situations (such as updating the kernel).

So if you modify those by hand, you are at risk of having your changes overwritten.

Most documented changes that go into those are documented as changes to other files which end up modifying the way the above file and directory are automatically modified. Doing things indirectly is harder to figure out, but better documented and stable across things like kernel updates. But, so far as I know, there is no such indirect method of getting the change you want.

In many cases, it is also possible to make direct changes that tend not to be destroyed by the next automatic change. But I don’t know the real rules for that and it hasn’t been worth the trouble to figure out.

So, if you really want to make the change you say you want, I think your best bet is to do it the way I do:

  1. Backup all of /boot/ somewhere else, so after any automatic change you can easily compare and see what was changed.
  2. Plan on fixing things (doing a manual merge between the backup and real /boot/) after each automatic change to /boot/

That all isn’t really very hard. The automatic changes to /boot/ aren’t that frequent. But if you don’t like the idea of that extra manual step on occassion, either give up on wanting that nonstandard sequence or somehow learn more about how to integrate with the automatic process than I ever found.

There are good reasons to back up all of /boot/ but you don’t really need to merge that much. Only merge around what you originally changed.

The simplest way I know to make windows the boot option automatically and still allow booting linux as you choose would be to

  1. Edit /etc/default/grub and add a line that reads GRUB_SAVEDEFAULT=true
  2. Rebuild grub.cfg with sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  3. Reboot and select windows to boot from the grub menu

From this point on grub should automatically boot windows until the user selects a different OS/kernel to boot.

I just tested it on my dual boot desktop and it always boots to the last OS/kernel selected from the grub menu (windows included) until the user selects a different one to boot. It works perfectly to remember and always boot the same kernel/OS even after a kernel upgrade has been done. The only exception I have seen is that if one has selected the newest kernel in the grub menu, then a kernel update will still give you the newest kernel to boot (the one just installed as first in the menu)

This does not require doing anything with the content of /boot as suggested above.