Bug 1708455
Summary: | Dual Boot grub with bootloader spec doesn't save last booted in menu | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Andrew Duggan <lists> |
Component: | grub2 | Assignee: | Peter Jones <pjones> |
Status: | CLOSED DUPLICATE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 30 | CC: | calaver4, fmartine, fritz, genes1122, laurent.chrismann, lkundrak, markkelly0808+redhatbugzilla, pjones, thechexmo |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-01-15 17:05:52 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Andrew Duggan
2019-05-10 01:06:57 UTC
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 |