Windows – Installing Windows 10 on another hard drive alongside Ubuntu 18.04

grubUbuntuwindows 10

I'm currently running Ubuntu as my operating system but wanted to install Windows as my secondary OS for a couple of games I miss. I have Ubuntu on my 256gb SSD and I have a 2tb HDD, and I was wondering if I can install Windows 10 to that drive without breaking my current OS or the loader (grub I think). I didn't find any articles on this (probably because I'm searching for the wrong things. I don't know) so if anyone can link me an article or tell me straight in the comments, that would be appreciated. Thanks in advance and sorry for my bad English I'm Finnish.

Best Answer

The current recommendation when installing Windows 10 on any system with multiple disk seems to be to temporarily disconnect all the disks except the one you are planning to install Windows to, and reconnect them only after the installation is complete.

This is because the modern versions of windows will use multiple partitions, and although the installer asks which disk/partition to use for the Windows C: drive, it doesn't necessarily use the same disk for those other partitions (and no, it won't ask about those other partitions specifically). Disconnecting the other disks will remove the unpredictability. After the installation is complete, you should check the boot order in the UEFI/BIOS settings, and adjust as necessary.

Running sudo update-grub in Linux might be enough to allow Ubuntu to detect the presence of Windows and add it as a menu item in GRUB.

If UEFI boot scheme is being used

If your system uses UEFI, the Windows' installer will register a new bootloader setting in the system NVRAM, typically named Windows Boot Manager and place it as the first in the boot order. And if your system firmware auto-deletes any boot entries referring to non-existent disks, disconnecting your Ubuntu system disks will cause the bootloader registration for it to be removed from the system NVRAM.

Before installing a second OS to a dual-boot system that's currently booting Linux in UEFI mode, you should familiarize yourself with the efibootmgr command, record the current UEFI bootloader entry used by Linux (run efibootmgr -v and save the output!) and make sure you have a live Linux media, or a Linux installation media that you can use to boot the system in rescue mode, in UEFI mode. That way, if your system firmware removes Ubuntu's bootloader registration when the Linux system disk is disconnected for Windows installation, you'll be easily restore it by booting from an external media and using efibootmgr to restore the boot registration. The required command would be similar to this:

efibootmgr -c -d /dev/sda -L "Ubuntu Linux" -l \\EFI\\Ubuntu\\grubx64.efi

(The bootloader registration in NVRAM is based on GPT partition UUIDs, so it won't be a problem if your Linux system disk is not detected using the same device name when booting from an external media. Just tell efibootmgr what the device containing your UEFI bootloader is currently known as, and it will do the job correctly.)

But that's the worst case. In the best case, the firmware won't auto-delete the boot entry, and the only thing you'll need to do after installing Windows and reconnecting the other disk is to visit the firmware settings ("BIOS settings") and flip the "Ubuntu" boot entry back into the first priority slot.

Related Question