Dual Booting Windows 10 Arch Linux

Published on June 18, 2022 at 5:45 pm by LEW

Introduction

The time has come to dual boot my NUC 8. This time instead of going with Windows and Debian Linux, I will be doing Windows and Arch Linux.

I added a SSD to increase drive storage, as the original M2 was getting full. So I am taking this opportunity to set up a dual boot system.

I have set up a number of Debian/Windows dual boot systems in the past, but am still a bit of a noob with Arch, so this should be good experience.

Why Dual Boot

For those that may be wondering, a dual (or even multi) boot system has two (or more) Operating Systems (OS), any of which can be selected at start up or restart.

There are a lot of reasons for doing this, but there can also be some issues. One big reason is to use a new OS with full resources available, while still retaining the original OS.

There are also other ways of accomplishing similar outcomes that don’t involve dual booting. One of the most common is a Hypervisor and Virtual Machines (VM). Both Type 1 and Type 2 Hypervisors are great for this. Type 1 involves setting up a hypervisor on bare metal, and provides best performance. Type 2 is easier to setup and involves running the hypervisor under an existing OS. However hypervisors do add some complexity and additional hardware requirements.

I have determined that dual booting tends to be a better option for my current use case. You will have to evaluate what will work best for you.

Preparing for Dual Booting

In my particular case I keep my data segregated from my OS, and backed up to an external drive. So I have no problem wiping my computer and starting from scratch. If this is not your case, you may need to do some partition resizing, which is out of scope for this post.

The computer I am using is an Eighth Generation NUC with an I5 processor and 16 GB of RAM. I have a 256 GB M2 drive (in reality about 233 GB of usable space) and a 1 TB 2.5” SSD (in reality about 932 GB of usable space). Please see this post for actual vs advertised drive sizes.

In my case, preparation is simple, I create new partition tables on both drives, effectively wiping out all existing data. This is where things get a little tricky, as Windows does not play nice with others. This is the procedure I followed.

  1. Using a “Live GPARTED Distro”, I made sure both drives were set to GPT.
  2. On drive 1 (233 GB) I created a 512 MB EFI system partition. Make sure to label it “System”.
  3. On Drive 2 (932 GB) I created an Application partition, swap partition, and Data Partition.

The sizes of your partitions will depend on your particular use case. Microsoft claims Windows 10 can be installed in 30 GB. But that is assuming you are not adding any applications. Note in some cases you can offload applications to another partition. I would recommend at least 100 GB for Windows, if not more. A fully loaded Arch installation will easily fit into a much smaller space.

The swap partitions will be used by Linux and are related to the amount of RAM installed. There are arguments all over the internet about the need for swap, multiple vs single swap partitions, the size of swap, and whether they will trash a SSD. In my limited experience, swap really only comes into play when editing large graphics files or using hibernation.

Now we need to format all the partitions.

Note we are using a lot of NTFS. As previously observed, Windows does not play nice, so in some cases we have to use formats that Windows recognizes. That limits our shared drives to either FAT or NTFS. While FAT is a good format, because of its age it has some limitations on modern systems. So this leaves us with the somewhat less than stellar, but usable, NTFS.

Installing Windows

Generally we need to install Windows first, as its proprietary boot loader will not recognize any other OS out of the box. There are work around for this, but it is simpler to just install Windows first.

In my case I will be using Windows 10. I will switch to Windows 11 when I have absolutely no choice in the matter. My issue is the need for a Microsoft account and all the monitoring/tracking. Windows 10 is bad enough, but Windows 11 takes it to a whole new level.

Speaking of Microsoft accounts, you should probably jump into your BIOS and secure all networking devices. This will allow you to install Windows 10 with a local account only. Once Windows is installed, you can turn networking back on.

Do a normal install of Windows, I created a 140 GB partition on drive 1. Note this will also create a Microsoft reserve partition of around 16 MB. If you did not label your EFI partition as System, another EFI partition will have been created.

After Windows is loaded and you are actually logged in, do any configuration you want to. I will make a suggestions at the end of this post.

One thing you will want to do is make sure Windows actually shuts down and does not go into hibernation. Hibernation will cause issues with accessing NTFS partitions.

And that is it for the Windows part. Don’t forget to turn networking back on in the BIOS.

Installing Arch

This is where things get a little complicated, but nothing we can’t handle. For the most part, I will be following the procedure in my Arch Install series of posts, which can be found here. Because this is dual boot there will be some minor variations.

I will be creating a swap partition and an Arch partition (as type ext4) using the rest of Drive 1. don’t forget to format the Arch Partition.

Once the drives have been partitioned, I boot with an ARCH install image. Then I walk through some validation steps for Arch (see this post).

First some basic stuff. I setup both swap partitions using the commands mkswap and swapon. Then I mount the Linux partition to /mnt. See this post for more information. As usual when doing an Arch install, you should update the repositories with pacman -Sy.

Now we come to a variation, I want to mount the data partition on drive 2 to a folder in the Linux file tree. I chose the /srv folder. Since this is not a server, it will not be used for anything else. I mount the partition to /mnt/srv.

Now we can use the pacstrap command to load Arch onto our file system. We will include the following packages in the command; base, linux, vi, networkmanager, ntfs-3g, and os-prober.

The ntfs-3g package will give Linux the ability to read and write to NTFS partitions. The os-prober package will be what finds our windows installation. Note that os-prober is considered a security risk by some, which is why it might be missing form various install media.

Once pacstrap completes, I create the fstab file with the genfsatab program. Then I can do an arch-chroot to /mnt. I quickly walk through the standard configurations (fond in this post). Up to and including installing grub and efibootmgr.

Before generating the boot loader, I need to edit the following file; /etc/default/grub. I want to find the line containing “GRUB_DISABLE_OS_PROBER=false”. It should be commented out. I want to remove the comment to activate the line. Once this is done, you can finish off setting up the boot loader as outlined in this post.

Smoke Test

If everything went according to plan, when you reboot, you should enter the GRUB boot loader screen which should show both Arch and Windows. Simply use the up and down arrow keys to select what you want to load.

Suggested Additional Configuration

In windows, I have reassigned some of the special folder locations (Video, Music, Pictures, Documents, Downloads) to my data drive (right click on folder and chose Location). In Arch, you can create links from your home directory to these also (remember that the data partition is mounted at /srv if you followed my example). That way both Windows and Arch are using the same folders, and the data is kept on the data partition, and not in the home directories on the respective system partitions.

Note some desktop environments you might install on Arch use XDG User Directories. If you find that after changing the directory to a link, the directory returns on the next reboot, it may be necessary to disable XDG in the user-dirs.conf file located in the /etc directory.

Conclusion

I now have a dual boot system with both Windows 10 and Arch Linux. I have shared some common folders between the two OS on a separate data partition. I also have a application partition to offload some things from Windows when its partition starts getting full. Games are a good candidate, as both the Steam and Origin installers allow setting up game folders on other partitions.

I still have a lot of configuration to do on Arch. It needs a GUI, as at this point it is strictly command line. I think I am going to use KDE Plasma, rather than a lightweight window manager this time around.

 

 

Add New Comment

Your email address will not be published. Required fields are marked *