2

I've been running Windows 10 and Ubuntu 16.04 next to eachother for quite a while. I could boot into either OS with Grub bootloader. Unfortunatly my Windows 10 install broke and I needed to reinstall it.

After reinstalling Windows 10 I could not boot into it anymore with Grub bootloader. So I ran used my bootable Windows USB to execute the following commands to regain acces to Windows:

bootrec.exe /fixmbr
bootrec.exe /fixboot  
bootrec.exe /rebuildbcd 

After that I've used easyBCD to create a new Bootloader menu for Windows 10 and Ubuntu. This got it kind of working again. What I have to do now is to use Windows 10 boot menu to select either Windows 10 or Ubuntu, if I choose Windows 10 it sends me straight into the OS. If I choose Ubuntu however I get send to Grub bootloader with the broken link(?) to my old(?) Windows 10. And selecting Ubuntu boots me into the Ubuntu OS.

What I would like to achieve is that I have everything under the Grub Bootloader again but I'm very confused to what is happening here, so I was hopefull somone could help me out here.

Here are my current partitions: enter image description here

Edit: It seems like Grub Customizer is removing /etc/grub.d/40_custom when I try saving in Grub Customizer. When I add those lines in the original file and save it there, the boot option won't show in Grub Customizer.

3 Answers 3

0

Try this workaround

Perform these these commands:-

/etc/grub.d/

gedit 40_custom

add following lines in 40_custom file:

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

If that fails try this instead:

menuentry "Windows 10" {
      set root='(hd0,msdos1)'
      chainloader +1
    }

after edit save file and run following command :

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

It add windows entry in the main configuration file.

then type:

reboot
3
  • I don't have a file named "40_custom" in that directory. :/
    – user672243
    May 28, 2017 at 20:40
  • Sorry I fixed the command, try as sudo May 28, 2017 at 20:49
  • other variations of root depend on your BIOS for gpt it can also be set root='(hd0,gpt1)' May 29, 2017 at 21:07
0

Try os-prober. Since you have installed another bootloader, you will also need to reinstall GRUB. Run the following commands to install os-prober and update your GRUB configuration:

sudo apt-get update
sudo apt-get install os-prober
sudo grub-install /dev/sda
sudo update-grub

Now reboot and your GRUB menu should be fixed!

2
  • 1
    I've already installed os-prober apparently. And I should run sudo grub-install /dev/nvme0n1p5 instead right? When I do, I get the following error message: grub-install: warning: File system 'ext2' doesn't support embedding. grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.. grub-install: error: will not proceed with blocklists.
    – user672243
    May 29, 2017 at 7:35
  • All those "errors" are actually warnings and can be ignored. I myself get them often.
    – fosslinux
    May 29, 2017 at 8:04
0

It seems grub successfully locates the Windows EFI loader, then stops to add one boot entry, which however links to an invalid (old) windows installation.

Can you find out under which mode, i.e., UEFI or Legacy, Windows boot manager now is working? Since grub may have detacted and used an (old) EFI image rather than probed further for another Legacy alternative.

P.S. Given that you want to boot either OS from either boot manager,the more fair way is to use a third-party boot manager. rEFInd is a good choice. It's stable and powerful enough to handle potential changes due to system updates of either side.

You must log in to answer this question.