Ask Your Question

How to change which partition boots from GRUB on dual-boot F22/RHEL7?

asked 2015-08-20 14:34:15 -0500

xmetax gravatar image

updated 2015-08-20 14:41:55 -0500

I have installed RHEL 7 and F22 on the same HD. My system now shows both OS's on the GRUB menu during boot but now defaults to RHEL7. How can I make GRUB work as it was before installing RHEL7? So that I boot to F22 by default but have the options to boot to RHEL7 for training stuff. Please let me know if you need to see the grub2.cfg file, I wasn't sure if it would be needed and it is very long.



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-20 16:21:32 -0500

Rabin gravatar image

To force a system to always use a particular menu entry, use the menu entry name as the key to the GRUB_DEFAULT directive in the /etc/default/grub file. To list the available menu entries, run the following command as root:

# or with EFI
awk -F\' '$1=="menuentry " {print $2}' /boot/efi/EFI/fedora/grub.cfg
# or w/o EFI
awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg

   # output
    Fedora (4.1.4-200.fc22.x86_64) 22 (Twenty Two)
    Fedora (4.1.3-201.fc22.x86_64) 22 (Twenty Two)
    Fedora (4.1.3-200.fc22.x86_64) 22 (Twenty Two)
    Fedora (0-rescue-319c6208ee0647b586bd714b54e23e99) 22 (Twenty Two)

So you need to add this line to the file /etc/default/grub

GRUB_DEFAULT='Fedora (4.1.4-200.fc22.x86_64) 22 (Twenty Two)'

and then update the grub config file

# w/o EFI the path is /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg

More reading, CUSTOMIZING GRUB 2 MENU from RH System Administrators Guide.

edit flag offensive delete link more


That worked. Thank you for the well structured answer!

xmetax gravatar imagexmetax ( 2015-08-21 11:40:07 -0500 )edit

Question Tools

1 follower


Asked: 2015-08-20 14:34:15 -0500

Seen: 429 times

Last updated: Aug 20 '15