ABOUT
Recently, I dual-booted my computer (Razer Blade 14" 2017, Intel 7700HQ - GTX1060) with Arch Linux, and I wanted to document the process here to make it easier for any others who are planning on a similar process. Note that this is for a UEFI machine that already runs Windows 10 (although the instructions may easily translate to some other setups).
Before beginning the dual boot process, I decided to first read about the boot process and Linux in general; although not strictly necessary, this reading was interesting and helped me understand all the steps involved in the dual boot process. I have listed some basic links I would recommend reading before, in order to get a clear understanding the boot process and related technologies.
First, just to be safe, it is important to completely back up any important files you have saved on your computer.
Then, open up Disk Management (open Command Prompt as Administrator and type in diskmgmt.msc
) (see the figure below) and create space for the Linux installation. There should be at least 3 basic partitions: EFI System Partition, OEM, and Windows (the main partition that takes most of the space). In addition, there may be an extra recovery partition - beyond the first 3, you can choose whether or not to delete the extra partitions (consider the warranty and other aspects specific to your computer, I chose to leave my recovery partition). Choose the large Windows partition, right click it, and choose shrink - the amount by which you shrink is the amount of space you will have for your Linux installation. This new space will show up as unpartitioned space - this is what we want.
Now, we will prepare for the actual Linux boot process. First, turn off Windows Fast Startup. Then, hold down shift and press the restart button to open the troubleshooting menu. Choose Troubleshoot > Advanced Options > UEFI Firmware Settings. Then, on restart, the UEFI options will open. Disable Intel Fast Boot and Secure Boot (details here).
Download an Arch Linux ISO from the Downloads Page (verify the checksums, noting the Master Signing Keys). Then, download Rufus, a USB drive formatting utility (alternatively, you can use dd
if you have a machine running Linux or MacOS). Get a USB drive that doesn't have any data you need (it will be wiped by the boot drive formatting process), and plug it in. Start up Rufus; it should automatically recognize the USB drive. After ascertaining that it has the correct drive, choose the Arch Linux ISO and start the format process (I also chose FAT32, the UEFI/GPT partition scheme, check device for bad blocks with 1 pass and unchecked quick format). Make sure to choose DD Image mode after choosing Start (see more here).
Plug in the USB (the computer will not recognize it because of the DD formatting). Restart Windows, and press the correct key to go into the Boot Menu (on the Razer Blade, smash F12). In the Boot Menu, choose your USB (will show up as something relating to EFI USB). In the Arch Linux boot screen that shows up next, choose the first default option, "Arch Linux archiso x86_64 UEFI USB". Now, we are entered into an Arch Linux shell running off the USB - it will recognize the laptop's internal hard drive as an attached device.
1 2 3 |
|
Use lsblk -f
or fdisk -l
to identify the block devices. You should see at least two devices (the USB and the internal hard drive) - identify the name (e.g. /dev/sda
or /dev/nvme0n1
) of your internal hard drive. This is the device file where the hard drive is mounted.
We need to create 3 partitions for the Linux installation - the main filesystem, the boot partition, and the swap partition. We will now use gdisk
to create the partitions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Now, use gdisk -l /dev/nvme0n1
to find the number of the swap partition.
First, securely wipe the data on the machine to prepare for the encryption. We do this as follows (where X
refers to the partition number of the partition(s) you wish to wipe (at minimum, do the main filesystem partition)).
1 2 3 4 |
|
Now, we will encrypt the partition. See the related Arch wiki pages for details. We use X
to refer to the partition number of the Linux root filesystem (third partition created above). Use this answer to choose encryption options.
1 2 3 4 5 |
|
Now, check the mapping to make sure it works.
1 2 3 4 |
|
We refer to the swap partition created above as Y
.
1 2 3 |
|
We refer to the boot partition created above as Z
.
1 2 3 4 5 6 |
|
Use pacstrap to install the basic system:
1 |
|
Create an fstab file for the system, using UUID naming:
1 |
|
Make sure that /mnt/etc/fstab
lists /boot
and /boot/efi
as filesystems. If it doesn't, you will have to add them manually, look that up online. Use ls -l /dev/disk/by-uuid/
. Optionally, change relatime
to noatime
on SSD disks to reduce the wear and tear.
Arch Linux is now completely installed on the system. We are ready to begin setting up the system directly. First, chroot
into the newly installed system.
1 |
|
First we setup the time system. Refer to Arch Wiki Time for more information.
1 2 |
|
Now, we set the locale. Uncomment en_US.UTF-8 UTF-8
in /etc/locale.gen
and run
1 |
|
Then, set LANG=en_US.UTF-8
in /etc/locale.conf
Now, we set the hostname with
1 |
|
and update /etc/hosts
1 2 3 |
|
See Arch network configuration for more information.
Finally, reset the root
password:
1 |
|
Install the relevant packages:
1 |
|
Now, we will make sure all of the partitions are properly mounted.
1 2 |
|
If they are properly mounted, we will edit /etc/mkinitcpio.conf
to include relevant hooks and kernel parameters.
1 |
|
We will now generate the initrd with
1 |
|
Now, we will setup GRUB by setting the following in /etc/default/grub
(where
is the UUID of the encrypted partition from ls -l /dev/disk/by-uuid/
):
1 2 3 |
|
Install GRUB and generate the config file with
1 2 |
|
Now, install intel-ucode
in order to enable Intel microcode.
1 2 |
|
Also install os-prober
so that Windows will be properly set in GRUB on reboot (alternatively, you could create a Windows entry in the GRUB config manually).
1 |
|
Before starting up the new machine, we will also install necessary packages to connect to WiFi on restart. We will use netctl
to manage the WiFi connection. First, we install WPA Supplicant to manage secure WiFi connections.
1 2 3 4 |
|
Copy the psk
field from the wpa_passphrase
command as the Key
in the wireless-wpa
profile.
Finally, unmount everything and reboot the system - go back into Arch.
1 2 3 |
|
You will now boot directly into the Arch install (rather than the archiso
on the USB). There is some basic setup remaining. First, run os-prober
and update the GRUB config with
1 2 |
|
Then, make sure you can connect to WiFi with netctl
.
1 2 |
|
Finally, create a new (non-root) user for general use.
1 2 |
|
You should also set up sudo
and use visudo
to allow the wheel
group to use sudo.
Restart one more time, and make sure that Windows is listed as an option in the initial GRUB boot window. Choose to boot into it and make sure everything works. Notably, the clock will be off because of the hardware clock settings in Linux - to remedy this, see here. You will have to use regedit
to add the DWORD
1 |
|
with value 1
to the registry. In addition, turn off Internet time synchronization in Control Panel > Clock and Region > Date and Time > Internet Time. Reboot to put these changes into effect.
Check back for Part 2 to read about basic system configuration, including (but not limited to):