22

I have an SSD with 2 partitions. The first partition belongs to Windows 10 and it worked fine. I installed Ubuntu 15.10 on the second partition and it also works fine.

When I boot, grub is correctly displayed and shows both Windows and Ubuntu. If I select Ubuntu it can boot without issue and I can even access the Windows partition from Ubuntu, but if I try to boot Windows 10 it displays a black screen (like it will start normally) for a few seconds (perhaps 2 or 3 seconds) and then it goes back to grub without showing any message.

karel
  • 114,770
Jovana
  • 641
  • If you start the windows boot loader whitout grub does windows start. (press F12, F9, F10, etc. while your PC boots; boot device order and select windows boot loader) – Info-Screen Jan 25 '16 at 08:49
  • I tried but I only have 2 options : SSD and normal drive. Didn't work. – Jovana Jan 25 '16 at 19:06

4 Answers4

32

Edit /boot/grub/grub.cfg

Find the Windows menu entry (looks like)

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 10 (loader) (on /dev/sdXX)'

After

chainloader +1

Write

ntldr /bootmgr 

It did the trick.

Jovana
  • 641
  • I used this method, but I had to do it through Grub Customizer. – Alexiy Apr 11 '16 at 11:39
  • 3
    My bloody word!! This worked lol 3 hours later and 1 line fixes me – Jamie Hutber Oct 10 '16 at 15:13
  • Excuse me, I was setting up for a few times 'ntldr /bootmgr', What should I do to leave it forever? (I did it by 'sudo' but sometimes it resets!) – M. Mariscal Dec 04 '16 at 22:09
  • 7
    Coming in a bit late, but in order to fully persist these, you can't edit grub.cfg, as suggested initially. You need to edit /etc/grub.d/40_custom and add the whole Windows entry there, creating a new one (as suggested here: https://ubuntuforums.org/showthread.php?t=2305787&p=13404285#post13404285). This one will stay there even if you upgrade your Linux or run 'upgrade-grub' – ravemir Aug 12 '17 at 17:22
  • This answer fixed it for me. This page is marked as a duplicate, but the page it points to does not have ntldr anywhere on the page. – clusterdude Sep 08 '18 at 01:32
  • @ravemir Coming in even later ;-) I did as you suggested and it works fine. However I now have two entries for Windows: the one it automatically detected, which doesn't work, and the one I added with the 40_custom file, which works fine. How do I make the automatic one disappear from my boot menu? – Andyc Jan 19 '19 at 16:17
  • @Andyc : according to the following post, you can disable the OS prober: https://askubuntu.com/questions/874186/remove-windows-entry-in-grub-menu ; this will stop the entry from popping up the next time update-grub shows up (probably after a kernel update). – ravemir Jan 21 '19 at 16:52
  • @ravemir I thought about doing that, but my best guess is that it then will not check for any other (possibly in the future) installed operating systems and I would have to add them manually. Am I wrong? Or is there maybe a way to hack the 30_os_prober file to add the ntldr /bootmgr line automatically (and get rid of the 40_custom)? It seems to be all shell script, which I'm not very good at. Therefore above me. – Andyc Jan 22 '19 at 03:37
  • Not really sure at this point. The answer has a vibe that OS prober is only there for other Operating Systems on the drive, meaning that it would only apply to either other Windows installations or another parallel Linux installation (which I find unlikely). If you're using a Mac, not sure if it would pick up macOS entries as well, as I am unfamiliar with boot management there. – ravemir Jan 22 '19 at 09:39
  • Thank you, this worked, but as @Alexiy said, I had to use the grub customizer – Ahmed U3 Jun 11 '19 at 21:55
  • 2
    Did not work for me on Ubuntu 19.04. I have to use my EFI loader menu ("BIOS" sort of thing) to load my Windows :) – kolypto Aug 01 '19 at 08:30
  • All of this is about Grub BIOS, not GRUB UEFI, right? ( litmus test [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS ) – Frank N Aug 22 '19 at 19:52
  • This fixed it. Should be the accepted answer – Abhi Aug 25 '19 at 11:39
  • I have a dual boots windows 7 with ubuntu, while windows was installed first in the first partition, ubuntu was second. Recently I reinstalled ubuntu, a fresh installation to replace the old one. However, after successful reinstallation, I cannot boot into my windows -- the Grub menu containing both ubuntu and windows entries does show up and works fine for ubuntu, but if I select windows entry, it restarts again without booting windows. After did many search, tried boot-repair, in the end I found this solution worked for me, thank you! – Ingch Oct 21 '21 at 19:35
  • However, do bear in mind what other user (ravemir) mentioned above, modifying /boot/grub/grub.cfg is not a permanent good idea, as when one runs update-grub, it will overwrites this file. So the ultimate solution should be modifying the /etc/default/grub file. – Ingch Oct 21 '21 at 19:36
3

First of all you upgrade your grub.

    sudo update-grub2

If the above command didn't work, Then you download a windows iso file and also install 'winusb' application which is used to make bootable images of windows, if you have a cd it's fine.

Remember the partition name of your ubuntu. Now you from from windows usb or cd. Now you click on repair this pc and troubleshooting startup options.

It will automatically replace your grub and now you will be able to boot into windows but not into ubuntu.

Now you either install a brand new ubuntu or try working around with reparing it.

If you are going to install brand new ubuntu then i would suggest you to install the boot-loader(Grub2) on the root file system itself.

Then you install EasyBcd application for windows and then link the boot loader to the ubuntu partition, as this the safest way to go on, so that if you have any updates of grub or windows boot-loader there wouldn't be any trouble for you in future.

Click here To watch a video about installing in the safest way.

I have installed 5 Linux Systems and 1 Windows os using the method mentioned above, I haven't got any problem till now.

  • Oh. Thank you. If possible, I would avoid to reinstall ubuntu again, as I already have a bunch of files and config on it, but I will definitely try to follow your advice. Thanks again. – Jovana Jan 25 '16 at 10:18
1

This problem is of windows not ubuntu.

I solved this problem by following steps:

1.First selected windows at grub boot menu.
2.Sometimes it go to automatic repair and from that select Troubleshoot -> Advanced options.
3.Select startup repair and it will repair windows.
4.Now simply open windows from boot and it will boot windows normally.
-1

this worked for me:

  1. install win 8/10
  2. boot on a live linux cd (i used boot-repair-disk-64bit.iso), any from where you can run gparted.
  3. shrink the win partition to make room for your linux.
  4. AND NOW THE REALLY IMPORTANT: restart windows, and then open file explorer (the yellow one) and see that your drive C: still thinks it owns the whole disk.
  5. right click on drive C: and chose properties/tools and click check.
  6. now windows will check and verify the new size of the win partition.
  7. you may have to reboot in to win a couple of times, but finally win knows the size and position of its partition(s)
  8. now you can install ubuntu or whatever - and should it not work, boot-repair-disk-64bit.iso will make it work fast.