CentOS 7.x Add Windows 7 boot option to grub2

From Notes_Wiki

Home > CentOS > CentOS 7.x > System Administration > CentOS 7.x Add Windows 7 boot option to grub2

In case of non-UEFI Windows and Linux dual-boot, add Windows 7 boot option to grub2 via:

  1. Enable epel-release and install ntfs-3g
    yum -y install epel-release
    yum -y install ntfs-3g
  2. Generate a new configuration using:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    #grub2-mkconfig -o /etc/grub2.cfg #Note that /etc/grub2.cfg is wrong file
    See if Windows was found as part of output generated by above command.

If Windows option was not found then add an entry manually in =/etc/grub.d/40_custom= as:

   menuentry "Windows 7" {
   set root='hd0,msdos1'
   chainloader +1
   }

Refer: https://www.centos.org/forums/viewtopic.php?t=49200

Avoid older format given below which may not work:

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


Home > CentOS > CentOS 7.x > System Administration > CentOS 7.x Add Windows 7 boot option to grub2