Adding Windows Loader To grub2

30 May 2016

I recently switched from ElementaryOS to CentOS. The install process went smoothly despite an initial issue while using a bootable SD card. I cannot detail the issue here but Google suggested using a DVD rather than SD card or any USB drive. Everything are working perfectly except I cannot go back to my Windows. It's embarassing to admit that we are using Windows for our open-source development but this is the reality. So when I'm away from work and testing things out, I'm rebooting to my CentOS and switch to Windows when I'm at work.

This is not grub2 specific issue by the way, grub2 should be able to add the loader but it has no knowledge of how to read ntfs partitions. The solution is install ntfs-3g and rebuild grub2 after.

$ yum info ntfs-3g
Installed Packages
Name        : ntfs-3g
Arch        : x86_64
Epoch       : 2
Version     : 2016.2.22
Release     : 1.el7
Size        : 659 k
Repo        : installed
From repo   : epel
Summary     : Linux NTFS userspace driver

Updating grub2

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.18.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.18.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-058c8d86e1464d46b2ae177e34dac6a4
Found initrd image: /boot/initramfs-0-rescue-058c8d86e1464d46b2ae177e34dac6a4.img
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
ERROR: sil: invalid metadata checksum in area 3 on /dev/sda
ERROR: sil: invalid metadata checksum in area 4 on /dev/sda
Found Windows 7 (loader) on /dev/sda2
done

Not sure about the ERROR sil but I rebooted and have Windows 7 (loader) on /dev/sda2 at the bottom of my grub.