Fedora now uses Grub 2. Whenever it does a kernel upgrade, it loses my default boot option (Windows). How can I fix this?

I resent Grub 2 over this, because the old Grub respected my choices.


I'm not sure whether there have been any changes/improvements with grubby or anaconda pertaining to this issue. Has anyone tried to follow these guidelines from fedora's wiki page:

Manual changes might however be overwritten with grub2-mkconfig next time the >system is upgraded with anaconda. Some customizations can be placed in /etc/grubd/40_custom or /boot/grub2/custom.cfg and will survive running grub2-mkconfig.

Otherwise, what specifically could be placed in the above-mentioned files that would survive kernel upgrades and/or running grub2-mkconfig?

This is taken from Fedora's Grub wiki page:

Due to grub2-mkconfig (and os-prober) we cannot predict the order of the entries in /boot/grub2/grub.cfg, so we set the default by name/title instead.

Open /etc/default/grub and ensure this line exists:


Apply the change to grub.cfg by running:

grub2-mkconfig -o /boot/grub2/grub.cfg

Now list all possible menu entries

grep "submenu\|^\smenuentry" /boot/grub2/grub.cfg | cut -d "'" -f2

Now set the desired default menu entry

grub2-set-default "<submenu title>><menu entry title>"

Verify the default menu entry

grub2-editenv list

In Fedora you currently can't make this permanently default.

If the kernel is being updated the grubby software used to add Grub2 menu item. And it definitely doesn't pay attention to /etc/default.

Citation from Fedora wiki:

Grubby in Fedora patches the configuration when a kernel update is performed and will try to not make any other changes than what is necessary.

btw, after kernel updated I do package-cleanup --oldkernels --count=1 and grub2-mkconfig -o /boot/grub2/grub.cfg to get rid of old kernels.


I don't use fedora, and I'm not 100% sure if the changes will be permanent (after kernel upgrades), but I think you need to edit the file /etc/default/grub. On row number 6 you will see:


Where 0 is the first entry of your grub list. Edit it the way you want. Then afterwards, run sudo update-grub2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.