Friday, January 1, 2021

Installing Windows after Linux On Separate Disks

*** Update Feb. 28, 2021 ***

After having gotten both Linux and Windows dual-booting, I had to wipe and reinstall Windows 10.  This time, however, Windows 10 refused to install and gave a message saying "We couldn't create a new partition or locate an existing one."

This is caused by Windows being confused because there is another drive with a primary partition.  Even though you can tell Windows which drive you want it to be installed on, it still can't figure out how to install itself.  After trying a few different things, the solution was to unplug the other drive, install Windows and the plug the other drive back in.

If you are using GRUB as the boot manager the Windows entry will need to be updated or you'll get an error message when trying to boot into Windows.  To update the GRUB configuration with the proper Windows values you'll need to run grub2-mkconfig and write the results to the configuration file.

For MBR setups:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

For EFI setups:

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg 

Leaving out the -o option will print the config to screen so you can see it first before overwriting the config.


*** Original Post ***

For my new system, I also added a second SSD that is intended for installing Windows 10.  My primary daily driver is Fedora Linux so I installed it first and it's on the primary drive.  

I don't use Windows very often but I might use it to play some games with the family so I'm okay with dual booting for this purpose.  I've not played with  dual-booting Linux and Windows in a very long time.  It's not something I recommend to someone who switch between the two operating systems frequently nor to someone who very rarely use one of them.  Rarely using one operating systems means it isn't updated so when it is needed there might be a lot of lost time getting the operating system updated and running again.

Setting up dual booting can also be a pain as one operating system might mess with the booting of the others (Windows tends to be the more frequent offender here as it doesn't really like to recognize non-Windows systems).  Most documentation I found suggests installing Windows first and then Linux so that the Linux boot manager (GRUB) can find Windows and add it to the boot options.   However, there's still a possibility that a Windows update can mess up GRUB and then it needs to be restored.  Another slight disadvantage is that it adds additional time for booting since there needs to be some pause to let users pick the right OS they want to run.

What I did was to install Linux first on one drive and then install Windows on complete separate drives so the boot manager of each drive is not effected by the other operating system.  I rely on the BIOS (yes, I know, force of habit to call it the BIOS) to select which drive to boot.  

After Linux was installed on disk "1", I installed Windows on disk "2" (Windows called it disk 0).  Whenever it rebooted, I made sure to tell the BIOS to boot of the Windows drives and not the default Linux drive.

Fortunately, the Asus BIOS's boot options include an Boot Override option to boot a specific drive without having to permanently change the boot order.  The other nice thing is that GRUB has the option to go back to the BIOS boot if I missed hitting the DEL key to get into the BIOS.  When I run Linux it is a no-op and when I need to run Windows it's a an extra 1-2 key strokes during boot.

The only issue that I had was that after Windows was installed there was an error message because of Secure Boot.  The simplest work-around is to disable Secure Boot in the BIOS so it can continue the booth process into either Linux or Windows.  I'm still learning about Secure Boot to see how to make it work with this configuration.

No comments:

Post a Comment