0

I have a Window 10 laptop. To install CentOS 7 on it, I shrunk the C drive (that is the only drive I saw). This gave me 100+ GB unallocated space. I went ahead and installed CentOS. After reboot, I do not see Windows 10 as an option to boot in the menu.

What did I do wrong? Is there a way to recover form it and see Windows 10?

1
  • People usually install Windows as the last option. The Boot Menu has been overwritten by the CentOS Installer. You should seek a Software Utility that is able to rewrite the Master Boot Record in order to allow Windows to be seen.
    – user1018743
    Commented Nov 29, 2019 at 17:13

2 Answers 2

1

Looks like Windows wasn't detected before installation. Boot into your CentOS installation and run these two commands:

sudo os-prober
sudo update-grub

If it says "command not found", replace update-grub with grub-mkconfig. You may have to install os-prober before doing this with

sudo yum install os-prober

If all else fails, you can add a custom entry to /etc/grub.d/40_custom that says this:

On BIOS systems: (replace n with Windows partition number)

menuentry "Windows 10" {
    insmod ntfs
    set root=(hd0,n)
    chainloader +1
}

On UEFI systems (replace n with EFI partition number)

menuentry "Windows 10" {
    set root=(hd0,n)
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Depending on where your bootloader is in the EFI partition, the location can change for the EFI entry.

Run sudo grub-mkconfig after and you should be good to go.

0

I am not an experienced Linux user. I am simply listing what I did to get this to work for me. This was mostly trial and error based. I am not recommending this one way or another. There may be proper way to resolve the problem. @Varun Narravula's reply may be more appropriate. Note that I am using Legacy/BIOS.

I tried commands in the following order:

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

then

os-prober

os-prober did not return anything.

Then I tried to see if I could mount the NTFS systems.

To do that I needed to install ntfs-3g. But for ntfs-3g, EPEL Repo is a prerequisite.

Please refer to the following:

https://www.tecmint.com/how-do-i-access-or-mount-windows-ntfs-partition-in-linux/

I installed EPEL Repo on CentOS 7.x

yum search epel-release
yum info epel-release
yum install epel-release

(I did not actually run a yum update)

Then installed ntfs-3g

yum -y install ntfs-3g

Then

yum install fuse
modprobe fuse

I could see the NTFS file systems with

fdisk -l 

(I did not actually mount the NTFS systems.) After this, I ran

os-prober

This did list Windows 10. Final step, I ran again

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

Not sure if the last step was necessary. When I rebooted my machine Windows 10 option was available. I am not sure if the steps I did related to mounting made any difference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .