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
$ iw dev # Get WiFi interface name $ wifi-menu # Open graphical interface to select WiFi network $ ping google.com # Check connection, might take a few seconds
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/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
$ gdisk /dev/nvme0n1 # Open gdisk partitioning utility $ n # Create new partition (for boot) $
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
$ cryptsetup open --type plain -d /dev/urandom /dev/nvme0n1pX to_be_wiped # opens a temporary crypt device $ lsblk # Check that there is a crypt device under /dev/nvme0n1pX $ dd if=/dev/zero of=/dev/mapper/to_be_wiped status=progress # Wipes the drive with /dev/zero $ cryptsetup close to_be_wiped # Close the temporary crypt device
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
$ cryptsetup benchmark # Choose your cipher settings $ cryptsetup -y -v luksFormat --type luks2 /dev/nvme0n1pX # Set up cryptdevice on the partition $ cryptsetup open /dev/nvme0n1pX cryptroot # Open the device as cryptroot $ mkfs -t ext4 -L "Arch Linux" /dev/mapper/cryptroot # Make the filesystem on the encrypted device $ mount /dev/mapper/cryptroot /mnt # Mount the filesystem to /mnt (/mnt is on the USB)
Now, check the mapping to make sure it works.
1 2 3 4
$ umount /mnt $ cryptsetup close cryptroot $ cryptsetup open /dev/nvme0n1pX cryptroot $ mount /dev/mapper/cryptroot /mnt
We refer to the swap partition created above as
1 2 3
$ mkswap -L "Linux Swap" /dev/nvme0n1pY # Make the swap partition $ swapon /dev/nvme0n1pY # Turn on the swap partition $ free -m # Check whether swap is on
We refer to the boot partition created above as
1 2 3 4 5 6
$ mkfs -t ext4 /dev/nvme0n1pZ # Create boot partition filesystem $ mkdir /mnt/boot # Create boot mount point $ mount /dev/nvme0n1pZ /mnt/boot $ mkdir /mnt/boot/efi # Create efi boot folder $ gdisk -l # Find the partition number of the existing EFI partition (from Windows) - U $ mount /dev/nvme0n1pU /mnt/boot/efi # Mount the EFI partition
Use pacstrap to install the basic system:
$ pacstrap /mnt base # Just install the basic set of packages
$ genfstab -pU /mnt >> /mnt/etc/fstab
Make sure that
/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
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.
$ arch-chroot /mnt
First we setup the time system. Refer to Arch Wiki Time for more information.
$ ln -s /usr/share/zoneinfo/
Now, we set the locale. Uncomment
en_US.UTF-8 UTF-8 in
/etc/locale.gen and run
/etc/locale.conf Now, we set the hostname with
$ echo MYHOSTNAME > /etc/hostname
1 2 3
127.0.0.1 localhost ::1 localhost 127.0.1.1 MYHOSTNAME.localdomain MYHOSTNAME # optional, as far as I can tell
See Arch network configuration for more information.
Finally, reset the
Install the relevant packages:
pacman -Syu grub efibootmgr dosfstools
Now, we will make sure all of the partitions are properly mounted.
$ mount -a # Mount all of the partitions listed in fstab $ lsblk # List block devices, and check that /, /boot, /boot/efi are listed
If they are properly mounted, we will edit
/etc/mkinitcpio.conf to include relevant hooks and kernel parameters.
HOOKS = (... keymap encrypt filesystems keyboard ...)
We will now generate the initrd with
$ mkinitcpio -p linux
Now, we will setup GRUB by setting the following in
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
$ grub-install --target=x86_64-efi --efi-director=/boot/efi --bootloader-id=grub $ grub-mkconfig -o /boot/grub/grub.cfg # GRUB configuration
intel-ucode in order to enable Intel microcode.
$ pacman -S intel-ucode # Install relevant package $ grub-mkconfig -o /boot/grub/grub.cfg # regenerate GRUB configuration to use intel-ucode
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).
$ pacman -S os-prober
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
$ pacman -S wpa_supplicant $ cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa # copy the interface file $ vim /etc/netctl/wireless-wpa # fill out the relevant fields $ wpa_passphrase SSID passphrase # hash passphrase for network
psk field from the
wpa_passphrase command as the
Key in the
Finally, unmount everything and reboot the system - go back into Arch.
1 2 3
$ exit # exit out of chroot back to the archiso $ umount -R /mnt # unmount all the devices $ reboot
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
$ os-prober # detects the Windows installation and adds it to GRUB config $ grub-mkconfig -p /boot/grub/grub.cfg
Then, make sure you can connect to WiFi with
$ sudo netctl start wireless-wpa # use the profile created above $ ping google.com # may take a few moments
Finally, create a new (non-root) user for general use.
$ useradd -m -G wheel
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
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):