Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

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.

share|improve this answer

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:

GRUB_DEFAULT=saved

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
share|improve this answer

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:

GRUB_DEFAULT="0"

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

Hope this helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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