Friday, May 27, 2016

dual boot - GRUB has no option for Windows 10


I installed Ubuntu 18.04.01 LTS alongside Windows 10 but GRUB doesn't have an option to boot Windows.


When I hold shift to bring up GRUB there is no option for Windows 10.


I tried to boot to the Windows drive from BIOS and it just opened GRUB and booted Ubuntu instead, so then I used boot-repair to restore the MBR and booted straight to the Windows drive and it said, "Operating System not found".


https://ubuntuforums.org/showthread.php?t=1451149


This answer recommended creating a custom entry at /etc/grub.d/11_windows using this code:


#! /bin/sh -e
echo "Adding Windows" >&2
cat << EOF
menuentry "Windows 10" {
insmod ntfs
insmod chain
insmod drivemap
set root=(hd0,1)
drivemap -s (hd0) (hd1)
chainloader +1
}
EOF

When I loaded it from GRUB it said something like, "error: invalid signature".


Since none of that worked I used boot-repair's recommended repair and now it's back to booting Ubuntu when I try to boot the Windows drive.


Here's the pastebin it generated: http://paste.ubuntu.com/p/ztH5MSVts9/


Sorry if this seems like a duplicate question, but I've tried all of the answers I can find, and none of them have worked.


Update


I can't find them all but here's a few of the answers that I have tried:


https://ubuntuforums.org/showthread.php?t=1451149
(When I loaded this answer from GRUB it said something like, "error: invalid signature".)


No Windows 10 option in GRUB and Windows drive seems empty from Ubuntu
(This issue isn't exactly the same as mine, my Windows drive is not empty from Ubuntu. But update-grub didn't change anything when I rebooted.)


GRUB does not detect Windows
(os-prober gave no response when I used it here. Then update-grub didn't change anything.)


Unable to boot into Windows after installing Ubuntu, how to fix?
(The approved answer didn't work for me, I think because my PC isn't running UEFI. Karel's suggestion to use boot-repair to fix Windows boot files didn't work either, it still boots into GRUB with no Windows option when I load either hard drive.)


https://askubuntu.com/a/890562/880950
(When I make and load a custom entry, like in this answer, it says, "error: file "/bootmgr" not found".)
Here is the code I used at /boot/grub/custom.cfg:


menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid 4A42271C42270C6F
ntldr /bootmgr
}

Update 2


I loaded up the Windows Recovery drive and tried the following:


C:
Bootrec /fixmbr
“This operation completed successfully.”
Bootrec /fixboot
“The volume does not contain a recognized file system.”
Bootrec /rebuildbcd
“Scanning all disks for Windows installations.
Total identifies Windows installations: 1
[1] C:\windows
Add installation to boot list?”
Yes
“This volume does not contain a recognized file system.”
bcdedit
“The boot configuration data store could not be opened.
The system cannot find the file specified.”

https://www.bleepingcomputer.com/forums/t/634635/window-10-will-not-start/
I found this forum where they seem to be having a similar issue, and recommend using “chkdsk C: /r” so I tried that and it returned:


“Windows has scanned the file system and found no problems.”


If you run a dual boot with say Windows and Ubuntu, sometimes Ubuntu's Grub can mess with the Windows System Boot and change the disk's MBR or interfere with Windows Boot Manager, making it impossible to boot into Windows from either the Grub menu options or from the BIOS boot menu. In such a case it is relatively easy to repair the MBR and/or Windows Boot Manager from a Windows command prompt found on the Windows Recovery and Repair disk/drive, which every Windows user should make and have at their disposal. The standard command used is bootrec together with its various switches used to fix the MBR and Windows Boot Manager if necessary. A good guide to using this command for Windows 10 and earlier versions can be found here.


However you may find once you've fixed things for Windows that you can only boot directly there and not into Grub. If that is the case boot into your Ubuntu Live UFD and run boot-repair. A good guide to doing this is found here. Once this has been done most times there should be no further booting issues, and Grub should appear on restart with the option to successfully boot to either system.


Last and not least you should always back up both Windows and Ubuntu systems by imaging, as this is the quickest way to dig yourself out of any system corruption issues, as well as useful for rolling back your system. Although Windows 7 - 10 has its own imaging system built-in, it is not recommended as it sometimes proves unreliable, as the OP found out to his cost. Ubuntu has its own GUI for this being Disks, which allows you to image individual partitions, the root \ being the most important one. But the best and most versatile imaging system is Macrium Reflect as this free GUI will back up both Windows and Ubuntu. For imaging Ubuntu, you have to make a Macrium Recovery USB first from within Windows. But once you've made this USB you can happily image either system once booted into it. It is very reliable and can be used to backup systems running on a UEFI or Legacy BIOS. It even includes a Windows command prompt so that you can run bootrec or any of Windows repair commands from there. Details of how to make the USB are shown here.


No comments:

Post a Comment

11.10 - Can&#39;t boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...