Ubuntu – Will installing Windows break grub in this case

dual-bootgrub2uefiwindows

I have a computer with two 500 GB SSDs, sda and sdb. I'm running Ubuntu 14.04 on sda, and there's nothing on sdb. My motherboard has UEFI firmware. I want to install Windows 10 on sdb.

There are many answers to the question of how to install Windows after Ubuntu, but they assume the two systems with be on separate partitions on the same disk. They go on to explain that Windows will break Grub and how to go about fixing this.

If I install Windows onto sdb, a completely separate drive, will it still break grub?

Thanks a lot.

Best Answer

Installing Windows doesn't actually break GRUB on an EFI-based installation; it just makes the Windows boot loader the default. In the case of a BIOS-based system, this is done by Windows overwriting GRUB (which could be considered a type of breakage), but in the case of an EFI-based system, this happens by Windows installing its own boot loader next to GRUB and then telling the computer to boot using the Windows boot loader by default. In this second (EFI) case, GRUB remains untouched, and the default boot loader can be changed in any number of ways:

  1. Using the EFI firmware's user interface -- Details vary from one EFI to another, and some don't even offer this feature; but some let you permanently change the boot order using the EFI setup utility. Most let you make a temporary change by activating the boot manager's user interface, typically by pressing Esc, Enter, or a function key soon after powering on.
  2. Using an EFI shell -- The EFI shell program, version 2 (built into a handful of EFIs, and available as a separate binary for others) has a command called bcfg that manipulates boot variables. You can use this tool to change the boot order. See here for more on this subject.
  3. Using bcdedit in Windows -- Typing bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi in a Windows Administrator Command Prompt window will set Ubuntu as the default. (If Secure Boot is disabled, grubx64.efi can work as well as shimx64.efi, and in a few cases may be required; but shimx64.efi is more likely to work.)
  4. Using EasyUEFI in Windows -- The third-party EasyUEFI program provides a (relatively) easy-to-use GUI method of manipulating EFI boot entries.
  5. Using efibootmgr in Linux -- The efibootmgr command can display and change EFI boot entries. You'd type sudo efibootmgr -v to view the current entries, then use -o to change the boot order, as in sudo efibootmgr -o 2,7,4 to boot Boot0002 first, followed by Boot0007 if that fails, and a final attempt at Boot0004.
  6. Using bless in OS X -- OS X's tool for manipulating EFI boot entries is bless. It's a bit complex, and Macs are a bit weird, so I won't describe it in detail here.

Note that on an EFI system, use of one disk vs. two or more disks is largely irrelevant. This is because the EFI boot process involves NVRAM-based pointers to boot loaders. The NVRAM entries include identifiers of the disks and partitions on which the boot loaders are stored. Any partition can hold as many boot loaders as you like (up to some very high theoretical limit); or you can spread them across as many partitions and disks as you like. It's all pretty much the same. One caveat, though: One strategy that's often used in handling BIOS-mode multi-boots is to remove the disk of an already-installed OS while installing a second OS. This can still have a safety benefit on EFI systems, but there is a catch: If you remove a disk, some EFIs will notice that it's gone and remove NVRAM entries for boot loaders stored on that disk. Thus, swapping disks as on a BIOS system can make it harder to boot the second OS, since you'll need to re-create its EFI boot manager entry.

Related Question