Description of problem: With default setup, two kernel images, 'grub2-reboot 1' updates grubenv, but this settings is not honoured, kernel 0 is booted instead. Version-Release number of selected component (if applicable): grub2-1.99-0.2.fc16.x86_64 How reproducible: Always Steps to Reproduce: 1. setup 2 kernels 2. grub2-reboot 1 3. reboot Actual results: kernel 0 is booted Expected results: kernel 1 is booted once Additional info: Same with grub2-set-default
My fault, it needs a bit grub2 config tweaking: $ cat /etc/default/grub GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true Then it works OK. Could we go with it by default in Fedora? I need this functionality in pm-utils 01grub hook. I can also only document this requirement. Or is there any other possibility how to emulate the --once in grub2 with default config?
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Note that anaconda by default will overwrite /etc/default/grub with GRUB_DEFAULT=saved but no GRUB_SAVEDEFAULT. grubby will however be invoked with --make-default and replace set default="${saved_entry}" with set default="0" I guess the best way to get "boot once" would be to create some /etc/grub.d/01_pm that set the default based on the boot environment variables in another way. grub2-set-default is apparently a bad fit for Fedora where that usually is handled by grubby.
I just noticed that anaconda runs grub2-set-default.
*** Bug 753633 has been marked as a duplicate of this bug. ***
(In reply to comment #3) > I guess the best way to get "boot once" would be to create some > /etc/grub.d/01_pm that set the default based on the boot environment variables > in another way. > I can reinvent the wheel and implement own /etc/grub.d/01_pm, but I think the boot once functionality should be there out of the box as was in previous fedoras. Other packages could also benefit from it, not only the pm-utils.
What I just discovered after doing a fresh install of F16 is that it keeps booting the kernel which came with the installation, even after it installed a new kernel through the updates. Is my problem related to this bug or should I file a new bug? I also don't understand why GRUB_DEFAULT is set to 'saved' (which I assume has something to do with this problem)? On my Kubuntu machine it is set to '0' so that the latest kernel is always booted, why does Fedora do it differently?
Alexander, please file a new bug for the grubby component and attach your grub.cfg.
Done, bug #757712.
*** Bug 757712 has been marked as a duplicate of this bug. ***
*** Bug 761055 has been marked as a duplicate of this bug. ***
I have a workaround for this... You have to add these two lines to your "/etc/default/grub" file: GRUB_DEFAULT=0 GRUB_SAVEDEFAULT=true (Maybe you already have "GRUB_DEFAULT" but with "saved" value, change it to 0, the other line I'll bet you don't have it by default in that file...) We can also change "GRUB_TIMEOUT" to 0 if we don't want to see the kernels list when booting. Then, we have to run: su - grub2-mkconfig -o /boot/grub2/grub.cfg And that's it, You'll be always booting into the last kernel without any problems. That fixed the bug for me, in my case, I noticed same thing than Alexander van Loon.
*** Bug 758627 has been marked as a duplicate of this bug. ***
I'd like to support Jaroslav's request, that $ cat /etc/default/grub GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true become the default. The problem with the current configuration is that grub2 works in an easy-to-understand way out-of-the-box, but making any change - just changing kernel parameters, for example - requires running grub2-mkconfig, which then changes the behaviour in completely unexpected ways (just look at the number of bugs marked as duplicates of this one). Changing a kernel parameter should not require a detailed understanding of grub2 and how it differs from grub.
grub2-1.99-13.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/grub2-1.99-13.fc16
(In reply to comment #12) > I have a workaround for this... It is only a partial workaround. It will only work until the first time a new kernel is installed, as mentioned in comment 3. I don't know if that is by design or not. A solution could be if new-kernel-pkg used grubby --default-kernel to see if it should use grubby --make-default or grub2-set-default. (That might require a fix for bug 736188 first.)
Package grub2-1.99-13.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing grub2-1.99-13.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-16975/grub2-1.99-13.fc16 then log in and leave karma (feedback).
@Mads Kiilerich: the workaround I posted is actually permanent I tested it in two different computers updating their kernels after applying the workaround... Anyway the update pushing is better ;)
grub2-1.99-13.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
Are anybody here really sure that GRUB_SAVEDEFAULT=true is needed? I am sure it isn't. GRUB_SAVEDEFAULT=true will just update 'grubenv' from the boot loader and do that any kernel that has been chosen manually in the menu will be used for the next boot too. (GRUB_DEFAULT=saved should work even without GRUB_SAVEDEFAULT.) Updating grubenv from grub will however only work if it is placed on a plain disk. It will not work if LVM or RAID is involved. Fedora can thus not rely on it and shouldn't try to use it by default ... and it doesn't, because anaconda (f17) overwrites the grub2 /etc/default/grub. The default in the grub2 rpm should however also not have this line. A related and bigger problem might be that when grub2 on LVM or RAID can't update grubenv then the 'once' part of grub2-reboot doesn't work and grub2-reboot shouldn't be used.
Fedora 17: grub-set-default has no visible effect for me. It always boots kernel 0, no matter what I set the default to. $ cat /etc/default/grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="Fedora" GRUB_DEFAULT=saved GRUB_CMDLINE_LINUX="rd.lvm.lv=vg_trick/lv_swap rd.md=0 rd.dm=0 SYSFONT=True rd.lvm.lv=vg_trick/lv_root KEYTABLE=uk rd.luks=0 LANG=en_US.UTF-8 rhgb quiet" $ cat /boot/grub2/grubenv # GRUB Environment Block saved_entry=Fedora Linux, with Linux 3.3.1-3.fc17.x86_64 ############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################## (Note: correct kernel is selected in grubenv) No combination of settings or grub2-mkconfig fixes this. It appears to always boot kernel 0 whatever.
(In reply to comment #21) > Fedora 17: grub-set-default has no visible effect for me. > > It always boots kernel 0, no matter what I set the default > to. That sounds a lot like Bug 768106 > No combination of settings or grub2-mkconfig fixes this. It appears > to always boot kernel 0 whatever. That is strange and makes it different from Bug 768106. Are you sure you are generating the right grub.cfg? Can you verify by making some manual changes to some title and reboot? How does your generated grub.cfg look like? (Your issue seem to be different from what is discussed here - it would perhaps be better to file a new issue.)
I think I've worked this out. It's because the menus are nested in Fedora 17, so you have to set the default entry to: Advanced options for Fedora Linux>Fedora Linux, with Linux 3.3.1-3.fc17.x86_64 (not just the part after the > sign).
Have same issue with Richard. Filed as #823253