GRUB2 : Fixing Windows and RHEL7/CentOS7 Dual Boot Problem


I’m consulted by the PC maintenance team to troubleshoot a PC that has Windows-7 and RHEL-7 installed in dual boot mode. Whenever you want to dual boot Linux and Windows,

  1. Install Windows first.
  2. Make a separate partition for Linux.
  3. Make sure Windows has been installed on the first partition of the hard disk.
  4. Install Linux on the separate partition that you have created.

With all that being done, there’s this problem consistent in newer GRUB2 boot loader. GRUB stands for Grand Unified Bootloader by the way. And it’s the most advanced boot loader out there. When you dual Windows and Linux, GRUB takes control on booting the two operating systems and lists OSes during booting in the GRUB boot menu. With GRUB2, Windows doesn’t show up on the GRUB boot menu by default. Here’s what should be done to get Windows listed in the GRUB boot menu.

Step #1 : Boot into RHEL7 and edit the /etc/grub.d/40_custom file with the following content:

menuentry "Windows 7" {
	set root='(hd0,1)'
	chainloader +1

The menu entry “Windows 7” is telling the GRUB to look for the bootloader at the first hard disk(hd0) and in the first partition of the disk(hd0,1). The Windows 7 is added to the GRUB chainloader, to load the OS of user on boot.

Step #2 : Update the GRUB.
Update the GRUB menu entry by running,

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

Step #3 : Reboot the system.

init 6

You should be able to see both RHEL-7 and Windows-7 in the GRUB boot menu.

About Deepak Devanand

Seeker of knowledge
This entry was posted in GRUB, Linux, Uncategorized, Windows and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s