Description of problem: After upgrade to fedora 30 from 29, (which enabled bootloader spec) grub no longer set the last booted OS correctly. Always choose Windows 10 as the default. In Fedora 29 Same machine prior to upgrade grub would recall which OS (or kernel) last booted and have that has the default entry in the list. Version-Release number of selected component (if applicable): 2.02-78.fc30 How reproducible: Always Steps to Reproduce: 1. Boot to Windows 10. - Shutdown 2. Restart computer - choose Fedora 30 (5.0.10-300) Shutdown 3. Restart computer Actual results: Grub menu still shows Windows 10 as default Expected results: Grub menu selects Fedora 30 (5.0.19-300) as last booted. Additional info: Contents of /etc/default/grub GRUB_TIMEOUT="15" GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT="saved" GRUB_SAVEDEFAULT="true" GRUB_DISABLE_SUBMENU="true" #GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="resume=UUID=226e613d-a795-401c-bec0-061f21ff14da rhgb quiet" GRUB_DISABLE_RECOVERY="true" GRUB_BACKROUND="/boot/efi/EFI/fedora/themes/breeze/hp-Logo.png" GRUB_THEME="/boot/efi/EFI/fedora/themes/breeze/theme.txt" GRUB_ENABLE_BLSCFG="true" Disabling Bootloader spec (install grubby-deprecated and change GRUB_ENABLE_BLSCFG="false" with a grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg.
No doubt will be closed with a WONTFIX (if not ignored) but adding features (bootloader spec) as the default setup should not break / deprecate / remove existing useful functionality (such as grub being able to set and remember the last booted entry in the list). Dual booting to windows on a laptop has been something I have been doing with Fedora since Fedora Core 2 (15 years now) -- grub and (grub2) setting and remembering the last booted entry in the list has been a useful for this common use case.
Still true with F31. From my experiments, Grub "retrieves its memory of saved last booted OS" when an update brings a new version of Linux. After such an update, Grub remembers the last (Fedora) booted OS... until you ask again a boot on Windows, and fall back in the same bug (saved option desperately stuck to Windows)... until the next Linux version update, and so on.
Looking in grub.cfg I've seen that the f31 section no longer use menuentry statement but use Boot Loader Specification so the savedefault function is not called. savedefault function is the one that save your choice in grubenv file and use it the next time you boot your PC. Windows boot section uses menuentry statement ad savedefault function si called as expected.
FWIW, I have found can get this to behave correctly, if I run a grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg after each kernel update. I do it before the reboot just so I don't forget. The first reboot will still have the last booted kernel selected, but after that which ever entry was selected last is the default). While not related, I keep my UEFI partition umounted (noauto in fstab) unless doing a kernel update or the grub2-mkconfig, since hibernating between dual boot windows and fedora will corrupt that partition. (Windows doesn't have it mounted, but some Windows updates do touch it.) So for fedora updates I mount the UEFI partition, do the updates, run the grub2-mkconfig (reboot into the new kernel). This way I can dual boot and hibernate between Windows and Fedora In a ideal world, grubby would mount the efi partition, do it's updates then dismount it like Windows apparently does, but it's not an ideal world.
Executing "sudo grubby --set-default-index=0" after booting back to Fedora 31 from Windows seems to be a good work around on my system. It boots into the most recent kernel on subsequent boots, until I boot Windows. Gene
DUPLICATE of https://bugzilla.redhat.com/show_bug.cgi?id=1704926
*** This bug has been marked as a duplicate of bug 1704926 ***
Iĺl explain how i managed to fix this on my laptop Run the following line: sudo gedit /etc/default/grub Then change the following lines (if there are not, add them): GRUB_TIMEOUT="10" <--This might not be necessary for you but i needed to GRUB_DEFAULT="saved" <--This option loads the last entered entry GRUB_SAVEDEFAULT="true" <--This option makes grub save the entry youre bootin in Then save and run the following to apply the changes: sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
(In reply to thechexmo from comment #8) > Iĺl explain how i managed to fix this on my laptop > > Run the following line: > sudo gedit /etc/default/grub > > Then change the following lines (if there are not, add them): > GRUB_TIMEOUT="10" <--This might not be necessary for you but i > needed to > GRUB_DEFAULT="saved" <--This option loads the last entered entry > GRUB_SAVEDEFAULT="true" <--This option makes grub save the entry youre > bootin in > > > Then save and run the following to apply the changes: > sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg Edit: at the time i posted that i did not realized i was having the same issue shown in bug 1704926