19

I recently got a computer from school. It came with Windows 8.1 installed. I then installed another copy of Windows 8.1 (so it would use the built-in Windows Pro license) and upgraded it to Windows 10. I then installed Ubuntu alongside both Windows 8 and 10.

Note that I made a separate 255MB ext2 partition for /boot.

Now, when I boot the computer, I first see a GRUB prompt (I already un-hid the grub prompt 'cuz I like it that way) with Windows 8 and Ubuntu options. However, there is no Windows 10 option. If I select Ubuntu, the computer boots into Ubuntu. However, if I select the Windows 8 option, I then get sent to the Windows bootloader, where it then gives me options to boot either Windows 8 or Windows 10. (However, by this point, the computer has already loaded the kernel and all. Apparently Microsoft misunderstood the concept of a bootloader and decided that that meant "boot practically the entire system before actually showing the bootloader". Typical Microsoft.)

How can I disable the Windows bootloader and add a Windows 10 option to GRUB? EDIT: Someone has answered telling me to disable the Windows bootloader. However, I still do not know how to add Windows to the GRUB OS list. Can anyone help with this?

EDIT 2: After removing Windows 10 from the Windows bootloader with EasyBCD, it seemed that, after a few reboots, it would continually unhide itself and Windows 10 would reappear. However, I then later deleted Windows 10 from the list of OSes in msconfig, and it seems to have stayed deleted.

However, I STILL have not managed to get Windows 10 to appear in GRUB. It's as if GRUB simply doesn't detect it.

Also, I'll put this in the question so that people see it - I have tried using boot-repair, however, it has NOT helped any.

  • @daltonfury42 Stop believing if you don't listen or don't understand what the requirements of the OP are! Recommending a tool that mostly addresses common problems in typical legacy boot setups, for untypical UEFI installations with special requirements is misleading and counter productive. – LiveWireBT Nov 14 '15 at 13:09
  • 2
    @LiveWireBT I am so sorry. I saw your answer. I've deleted my comment (and stopped believing :P). Thanks! – daltonfury42 Nov 14 '15 at 15:18
  • I think I'm going to just delete the entire Windows 10 partition and move it to a VM, anyways. – Hitechcomputergeek Nov 14 '15 at 15:33
  • Honestly not sure why people are still upvoting this, as IMO it's not a great question. However, this year I solved this in another way - by converting from MBR to GPT and UEFI boot. Basically, I converted the partitioning scheme to GPT, resized the Windows partition, added an EFI System Partition and put rEFInd on it, and created a Windows BCD using a Windows install disk. Now the system boots using UEFI boot, making it easier to play with OSes. Contrary to what the internet says, it wasn't too hard to convert the Windows install from BIOS to UEFI, but it wasn't easy either. – Hitechcomputergeek Nov 30 '16 at 14:51
  • For anyone in the future who wants to do something like this and wants to stick with BIOS - I believe the answer lies in the Windows BCD. I believe that the Windows 10 install doesn't have a proper bootloader or BCD or something, and is not actually capable of booting independently. If done properly, I have a hunch that GRUB should start automatically finding the Windows 10 partition. – Hitechcomputergeek Nov 30 '16 at 15:08
18

Use:

sudo update-grub
sudo grub-install /dev/[BOOT PARTITION eg. Sda6]

commands in terminal of Ubuntu, probably it will solve your problem.

By this command system will automatically detect window installation and add them to grub list.

  • 1
    This didn't work unfortunately. It does not seem to detect the Windows 10 partition. – Hitechcomputergeek Sep 12 '15 at 23:53
  • 1
    Actually I have had same problem with my system(have windows 10 and ubuntu 14.04), And it was solved by this commands. – Neel Shah Sep 14 '15 at 4:41
  • Which command solved it, the update-grub or grub-install? And do you have a separate /boot partition? The thing is I have a separate boot partition on I think it actually is sda6. – Hitechcomputergeek Sep 14 '15 at 7:10
  • Doing those two commands (obviously) didn't solve it. – Hitechcomputergeek Sep 14 '15 at 7:11
  • 6
    sudo update-grub did it. – thameera Nov 22 '16 at 13:35
10

Sometimes os-prober is wrong.

Look at the UUID of your Windows 10 partition, for exemple:

sudo blkid /dev/sda2

Then edit /etc/grub.d/40_custom, and at the end of the file add:

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

Don't forget to change the UUID.

And finally update your grub config file:

sudo update-grub

Source

  • 1
    worth to note that for windows 10, usually the first partition is NOT the Windows system one, (i.e sdb2 is correct and sdb1 is NOT) This is because of how the windows 10 is stored on the disk during install, and the system reserved partition or system repair is always first). Grub often fails to find the second partition if the first one on the disk already provides something bootable. the easiest way to find the correct UUID is finding the biggest partition via sudo fdisk -l and match it with the result of blkid. – janmyszkier Apr 9 '17 at 14:28
6

use this app EasyBCD for windows http://neosmart.net/EasyBCD/ download the free version and install it.

when you open it you will see an entry for windows 8 and one for windows 10.

delete the windows 8 entry and you'll be good to go.

Update after doing the steps above go back to Ubuntu,

open the terminal by pressing ctrl+alt+T

then copy past this commands to it one after another,

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair

and by this you will install a tool called boot-repair.

open boot repair from dash and you'll get this window

enter image description here

choose the recommended repair and follow the steps.

Note you have to be connected to the Internet when using boot-repair.

  • @Hitechcomputergeek if you need more help, let me know I'll boot to windows and make you some screen-shots. – RonnieDroid Aug 15 '15 at 22:32
  • Does that add Windows 10 to GRUB? (Let me guess: no) I want to be able to access all three OSes from GRUB, and that only solves part of the problem. – Hitechcomputergeek Aug 15 '15 at 23:35
  • I updated the question to ask how to add Windows 10 to the GRUB OS list. I upvoted your answer because it fixed part of the problem, but since I still need to add Windows 10 to GRUB, I'm not accepting the answer yet. – Hitechcomputergeek Aug 16 '15 at 1:08
  • 1
    Also, I noticed you say to open Boot Repair from the dash, but the line sudo apt-get install -y boot-repair && boot-repair would already have opened it. – Hitechcomputergeek Aug 17 '15 at 0:45
  • 1
    You can also use this tool in "test mode of ubuntu (live cd mode)" iso where you can install, run and use it after connecting to internet or wife. – Alamjit Singh Mar 7 '17 at 16:58
4

This solution provides a proper entry in the grub2 menu and chainloads directly into Windows 10 without reference to the BIOS. It comes from https://ihaveabackup.net/article/grub2-entry-for-windows-10-uefi so I claim no credit. It was such a relief to find a working solution

Briefly, edit /etc/grub.d/40_custom and add:

menuentry 'Windows 10' {
    search --fs-uuid --no-floppy --set=root CC66-4B02
    chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

To find the UUID for the --set=root line (CC66-4B02 in the example) you use sudo fdisk -l to identify the EFI partition then sudo blkid /dev/sda1 (or whatever) to find the UUID of the EFI partition. Note it's not the Windows partition but the EFI one you need. Once you've saved the edit, run sudo update-grub to generate the /boot/grub/menu.cfg file and then restart to test.

  • I guess the sudo /dev/sda1 command should be sudo blkid /dev/sda1 – makapuf Mar 25 '18 at 21:18
  • @makapuf - you're absolutely right, thank you. Corrected. – peterthevicar Mar 26 '18 at 23:13
  • I have followed that exact tutorial, and I get "Error: Partition not found" when i try to boot the entry. Upon mounting the partition, it seems that "EFI/Microsoft/Boot/bootmgfw.efi" does not exist on that partition. – Xerus 2 days ago
3

As far as I understood your question you have two different Windows installations on one or more harddrives and you don't want the Windows loader to get in the way or managing both Windows installations. I remember that it was possible on legacy setups to directly boot the Windows kernel from Grub (I may be wrong here) but I haven't been able to do this on UEFI setups. Having two independent Windows bootloader configurations that can be called from Grub independently should be very close to what you are looking for.

It came with Windows 8.1 installed.

I'm going to assume that this is a UEFI capable computer.

  1. Please check that the computer actually is UEFI capable (I will remove my answer if it is not) and familiarize yourself with the differences between BIOS and UEFI (different boot modes, efibootmgr, different partition tables, EFI system partition (ESP), EFI loaders…).
  2. Then check that all OSes are installed in UEFI mode and check that you have a GPT partition table. You can use Windows' dism to backup and restore partitions to a new partition table layout and use the command prompt from latest Windows installation media to reinstall the bootloader, more details on this in the next point.
    • Since you have been recommended to try various other tools that don't address your issue you have to revert these changes to a pristine condition, otherwise this will get more and more confusing. Sorry about that. :(
  3. You can use my answer from How to boot Windows 8 from a legacy MBR partition in UEFI mode via GRUB?
    • This answer does install an independent Windows boot loader configuration through bcdboot in a different location where Grub will call it. For convenience I have chosen the Windows root partition. You will need to do this for every Windows installation, so that every Windows installation has its own and will only boot itself (clean the individual Windows boot menus from other entries).
    • Remember that you need to create an individual entry for each Windows installation you want to boot in /etc/grub.d/40_custom and follow the instructions and explanations about UUIDs, partitions and partition tables.
    • Probably disable every semi-smart feature that detects different OSes like OS-prober in Grub (GRUB_DISABLE_OS_PROBER) or troubleshooting boot issues with Windows or boot-repair (or manually clean up after them).

N.B.: Your request was to be able to manage all OSes with Grub, however with UEFI, the traditional "dualboot" term becomes almost a misnomer. UEFI allows coexistence of several bootloaders on the ESP and you can choose which one to boot (if they have been registered in the UEFI firmware and the manufacturers firmware doesn't do out of spec patronizing like only booting Windows). The sad thing here is that only very few people can think about installing more than one (independent) version of Windows, Linux or one release of Ubuntu onto one computer (or a harddrive that is used with several computers and boots a different installation of the same OS release on each computer). Most of this is already possible, but mechanisms in Windows and Ubuntu (Fedora,…) plainly choose to overwrite what is in their namespace under the false assumption that there can only be one.

(I do boot Windows8/10, Ubuntu, Ubuntu LTS and Fedora on one computer and have tinkered a few times with UEFI booting under different requirements.)

  • 1
    I do not use Windows. But has anyone tried copying /EFI/Windows to /EFI/Windows10 and/or /EFI/Windows8 and edit each BCD to be only for that version? And then in UEFI create entires for each. If that works from UEFI then grub can chain to each directly. – oldfred Nov 14 '15 at 15:05
  • @oldfred That's sort of what I wanted to point to in the lower section and there may be even a parameter for bcdboot to specify another target directory, but I'm not sure. Chainloading the other EFI binaries from only one ESP greatly simplifies 40_custom and make it less error-prone, you are right with that. I think was focused too much on multi-harddrive scenarios (in that case you should still be able tell bcdboot to boot Windows on hdd2 from ESP on hdd1, I think). m( – LiveWireBT Nov 14 '15 at 15:24
  • The computer is UEFI capable, but I honestly have no idea wtf is up with the partitions right now. The school had a custom Windows 8 image installed, and although it was using UEFI and Secure Boot (I believe the BIOS is configured to allow both UEFI and legacy boot right now; I remember disabling Secure Boot), the hard disk itself is formatted using MBR. Here, have a screenshot: imgur.com/1vDS4jf (Yeah, I'm planning on resizing a bunch of the partitions soon.) Also, Ubuntu itself (from grepping dmesg) doesn't appear to have been started in EFI mode, but I don't know if GRUB itself can – Hitechcomputergeek Nov 19 '15 at 4:22
  • @Hitechcomputergeek The screenshot shows an msdos/MBR partition table with an extended partition and no EFI partition. As I said earlier you should have GPT and you can use dism for the Windows partitions. – LiveWireBT Nov 19 '15 at 4:33
  • be started as UEFI, but then start other OSes as not-UEFI or something. UEFI is confusing. EDIT: GRUB is not being started as UEFI. I have no idea what happened with the original Windows. Actually, come to think of it, I guess it's possible it WASN'T UEFI in the first place. I assumed it was because it was basically impossible to get into the BIOS because of Windows 8's hibernation thing, unless you first booted it, then hit "Restart", THEN tried to get into the BIOS. I haven't needed to do that again at all since installing Ubuntu (and GRUB). – Hitechcomputergeek Nov 19 '15 at 4:40
1

Just login to your Ubuntu OS, open a terminal:

sudo update-grub

reboot

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.