(Last Updated On: January 12, 2019)

Previously we talked about How To Install Gnome Desktop Environment in CentOS 7.0. I have realized that you cannot boot into Windows Operating System if you install CentOS after Windows Installation.

To have CentOS GRUB2 bootloader manage all Windows operating systems like Windows 10, Windows 7, Windows 8, then you must manually configure GRUB to account for Windows installed. It is a simple process that anyone can do. So let’s get started.

By default, CentOS anaconda installer won’t configure grub to handle NTFS filesystem or partitions. This makes dual booting of  Windows and CentOS 7 a severe pain on the neck. If you forgot root password on CentOS and want to recover it then see How To Reset Root And User Password In CentOS 7 and RHEL 7

There are two methods which can be used to solve this problem.

How To Dual Boot CentOS 7 with Windows


Boot into your CentOS 7 machine and Mount the partition containing Windows installation. You can install gparted disk partition Manager to help you take a note of Windows Partition, just type the following command in the terminal

sudo yum -y install epel-release
sudo yum install gparted
sudo gparted

To mount the NTFS filesystem, install the following programs.

sudo yum ntfs-3g fuse ntfsprogs ntfsprogs-gnomevfs

Edit the  /etc/grub.d/40_custom file. Make a backup of it first.

sudo cp /etc/grub.d/40_custom  /etc/grub.d/40_custom.original

Then edit the /etc/grub.d/40_custom file, open it with vi editor or nano.

sudo vi /etc/grub.d/40_custom

Add the following Lines at the bottom

 Menuentry "Windows" {
set root=(hd0,3)
 chailoader +1
}

You can change the menu entry title menu within the  ” ” to reflect your windows os version though not necessary.

The line root=(hd0, 3)  means the fourth partition on the first hard drive. Replace 3 with your windows partition number taken from gparted since my WIndows 10 partition on the picture below is at /dev/sda3

Run

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

Check the new configuration if it contains windows details

sudo cat  /boot/grub.cfg

Reboot your system

 sudo reboot

You should now be able to dual-boot CentOS 7 with Windows.