Grub: Re-booting to the current OS in Fedora 37 - Cinamon (dual-boot) on a BIOS computer

I have an old Acer laptop PC that pre-dates the EFI boot loader and secure boot. I recently decided to re-activate it with Windows 10 and Fedora-37 - Cinamon. I prefer to have my computers re-boot to the OS that was running when the re-boot was initiated because it simplifies many update/upgrade operations.

My primary issue with fedora-37 - Cinamon is that grub-customizer does not seem to customize my grub configuration. I searched to find a way to customize grub to re-boot to the initiating OS, and this is the solution I found to solve the situation on a 64-bit BIOS based computer when running Fedora-37 - Cinamon:

Steps to make grub boot back into the OS from which a re-boot was initiated (BIOS system):

In the terminal emulator, open /etc/default/grub:
sudo xed /etc/default/grub // you can replace xed with nano if you prefer.

Find the GRUB_DEFAULT line:
Make sure it reads ‘GRUB_DEFAULT=saved’

Put the mouse cursor at the end of that line:
Press ENTER to move to a blank new line directly below it.

Enter:
GRUB_SAVEDEFAULT=true // (case-sensitive)

Save the file and close xed/nano.

Update your Grub configuration:
sudo update-grub
grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot the computer, switching to Windows (or whichever OS you are dual-booting with Fedora-Cinamon).
When you re-boot again, the OS you are re-booting from should be the selected option.

If you have any suggestions or comments, please reply.

I hope this helps others,

Ernie

That is clever, and useful.
I take it this is meant to work in a multiboot situation?

Absolutely! I cannot vouch for how it will work on an EFI/Secure boot system (the configuration file locations differ), but on a BIOS-based system it should do the job.

Ernie

This has pros and cons, if W10 and Fedora are on the same drive, and you are booting
W10, some W10 updates will overwrite the mbr and no more booting Fedora. If this is the
case then GRUB_DEFAULT=0, is what you need, and then you would run sudo grub-mkconfig -o /boot/grub/grub.cfg.
This works well if Windows and Linux are on different drives.

So far, I’ve had no issues. Win10 and Fedora are on the same drive and surprisingly, Win10 has been very well behaved (so far). I keep a live image of Fedora that I can use to repair grub if Win10 acts up following an update. I suppose I’ll see what happens this coming Tuesday (Windows patch Tuesday for February).

Ernie

OK, sounds like you are on top of the situation.