Arch Linux with Windows 10 Dual Boot

I’ve installed and reinstalled Arch Linux about 4 times now over the past 2-3 months since getting my ThinkPad x220. I’ve been an on and off Linux user for a few years now, but I hardly used the CLI except in cases where I couldn’t use a GUI to do what I needed to do. While setting up my R710 (which I need do a writeup on..) with ESXi and Windows, I’ve had plans in my head to fully convert to Linux for a while. I just didn’t have the balls to fully commit because it would leave my server in a state of chaos for months while I try and figure out how to fully utilize Linux. That’s where Arch came in. It was advertised as a Linux system I could build to meet whatever I needed and also forced the user to dive into the command line to install everything. Seems fitting to learn the inner workings of Linux.

I want to start out the installation guide by saying this is my setup and you shouldn’t follow it step by step because it probably won’t work for you. This is just a guide to see what I did so you can craft your own Arch Linux setup. Read the official installation guide, it’s the most complete guide on Arch you’ll ever read. It’ll go much more in-depth on topics than I ever will. That being said, when I did my first Arch install I had YouTube tutorials up and a bunch of other guides as references while following the guide and wrote notes along the way so I can go back on them to figure out what I did or what went wrong to fix it. It always helps to have references!

1. Dual Booting Windows 10

I use my x220 primarily for school so my setup involves dual booting Windows 10. I hardly use the Win10 partition, but Linux is obviously not widely adopted in the world so it’s comforting to know I have something else to fall back on ‘just in case’. I created a 100GB partition and installed Win10 on it. The rest of my 250GB SSD was for Arch.

2. Prep

Ensure that your ethernet cable is connected. Download the latest Arch ISO and create a bootable USB. You can use dd on Linux or Rufus if you’re on Windows. From your bios settings, select to boot from USB.

3. Verify the Boot Mode

#efivar -l

If the output is normal and lists a bunch of UEFI variables, it is booted in UEFI mode.

4. Check if Connected to the Internet

#ping archlinux.org

[CTRL+C] to stop pinging

5. Update the System Clock

#timedatectl set-ntp true
#timedatectl status

6. Partitioning the Disks

fdisk -l
cfdisk /dev/sda
mkfs.ext4 /dev/sda6
mount /dev/sda6 /mnt

List out all the disks available. Make note of which disk you’re going to use – in my case it was /dev/sda. Create a partition for Arch & Swap File using cfdisk. mkfs.ext4 will format whatever partition you want to ext4 file format. Lastly, mount it to /mnt.

7. Swap File

The general ‘rule of thumb’ has been for the swap file to be half of however much ram you had. On most modern systems there is plenty of ram to go around and a swap file isn’t needed, but I included it anyways because why not? Allocating 2gb to swap won’t hurt and better safe than sorry.

mkswap -L "Linux Swap" /dev/sda5
swapon /dev/sda5
free -m

Check if swap has been turned on.

8. Installing Base Packages

pacstrap /mnt base base-devel

9, Mount the EFI Partition

mkdir -p /mnt/boot/efi
fdisk -l /dev/sda
mount /dev/sda2 /mnt/boot/efi

Check which partition the EFI is on, in my case it was ‘2’

10. Generate the fstab file

genfstab -p /mnt >> /mnt/etc/fstab
sudo nano /mnt/etc/fstab

Use nano to check the fstab file just incase of errors

11. Chroot

arch-chroot /mnt

Chroot into your new system!

12. Timezone

ln -sf /usr/share/zoneinfo/Canada/Eastern /etc/localtime
hwclock --systohc

Set the time zone, then run hwclock to generate /etc/adjtime

13. Locale

nano /etc/locale.gen
locale-gen

Find ‘en_US.UTF-8 UTF-8’ and uncomment, then generate the locale

14. Hostname

sudo nano /etc/hostname

Add your desired hostname.

15. Enable Networking

systemctl enable dhcpcd

16. Root Password

passwd

17. Generate initial RAM disk

mkinitcpio -p linux

18. GRUB – Bootloader

Since this system is being dual booted with Windows, we have to install a bootloader. My choice is GRUB.

pacman -Syu grub efibootmgr os-prober
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
ls -l /boot/efi/EFI/arch/

Generate the grub configuration, then confirm that grub has been installed

19. Create a User Account

useradd -m -g users -s /bin/bash 'nn'
passwd nn
sudo EDITOR=nano visudo

Add a user, in this case it’s ’nn’, create password for user, then add user to sudo. Scroll down to ‘Root’ and press insert, then type…

’nn ALL=(ALL) ALL’

20. Install terminator and sudo

Two basic packages need to be installed before rebooting into the system.

pacman -Syu
pacman -S terminator sudo
reboot

21. Add Windows to GRUB

Once rebooted into Arch, you should login as whatever user you made.

su
pacman -Syu
grub-mkconfig -o /boot/grub/grub.cfg

Log in as root, update Arch, then add Windows to GRUB.

22. Intel Microcode

As I have an Intel CPU, I need to enable microcode updates.

sudo pacman -S intel-ucode
sudo grub-mkconfig -o /boot/grub/grub.cfg

Verify that the microcode got updated on boot.

dmesg | grep microcode

Final Words

And that’s it! You should have a fully functioning Arch install to play around in. This is an extremely barebones setup as it was just my basic installation notes. In future posts, I’ll explain how to setup other packages and my Arch setup more in depth.

Why ThinkPad?

My 2011 Macbook Pro has been my primary laptop for years, but I quickly learned that it was too heavy as an everyday school laptop. I thought about buying a keyboard case for my iPad Air, but the cases were already $50~$70 for a decent keyboard. I didn’t want to spend too much on something that was essentially going to be a glorified typing machine so I first looked at Chromebooks. They’re great, but they looked like cheap toys and had quite terrible keyboards unless you went higher end, which I wasn’t willing to do.

That’s when I found ThinkPads. I’ve always liked the sleek black look of ThinkPad’s, but I moved away from Windows years ago and didn’t want to go back. Apparently ThinkPad’s were really great machines to run Linux on with full driver support and while I’ve used Linux on and off on my home servers, I never really dived in as I still based my servers on Windows.

4 main points brought me to buying an x220.

1. Durable.
2. Repairable.
3. Cheap
4. Linux.

Durability is a huge point as I wanted the x220 to be a daily driving laptop. I didn’t want it to easily be decommissioned. If I was without a laptop in the middle of exams.. I don’t even want to think about it. Repair-ability also goes hand in hand with upgradability. Parts are easily had on eBay if anything ever breaks and there are plenty of upgrades available for this old laptop to bring it to usable in 2017. At around $200 for a used x220, that’s as cheap as laptops get. Pure Linux baby! Time to fully make the switch to Open Source goodness.