Arch Guide

03. Installing the basics

Identifying your partitions

Run: lsblk -o NAME,SIZE | grep [DISK]

The output will look similar to this:
sda 128G
-sda1 512M
-sda2 127.5G

Here's another example (with other partitions in the front):
nvme0n1 250G
-nvme0n1p1 1G
-nvme0n1p2 512M
-nvme0n1p3 100G
-nvme0n1p4 512M
-nvme0n1p5 148G

The partition's names end with a number. In the case of drives that start with nvme, there is usually a p between the disk name and partition number.

The second last partition (e.g. sda1 / nvme0n1p4 in the examples) is the boot partition. The device path would be something like /dev/sda1.

The last partition (e.g. sda2 / nvme0n1p5 in the examples) is the data/root partition. The device path would be something like /dev/sda2.

Remember those two partition names! Whenever you see [BOOT], replace it with the name of the boot partition (e.g. sda1). Replace [DATA] with the data/root partition (e.g. sda2).

Do you want disk encryption?

If you use disk encryption, you will have to enter the disk's password every time you boot Arch for added security. If you don't want that, skip this step and future steps for disk encryption.

The data/root partition will be encrypted, the boot partition will not.

Note: This guide will not help you set this up if you choose GRUB as a boot loader - only if you use EFISTUB (direct kernel booting), which isn't available on legacy BIOS!

Load the necessary modules:
modprobe dm-crypt
modprobe dm-mod

Format the data partition for encryption:
cryptsetup luksFormat -v -s 512 -h sha512 /dev/[DATA]

Enter a password of your choice. Make sure that it's secure and you'll remember it.

Load the encrypted partition:
cryptsetup open /dev/[DATA] root
Enter the same password.

From now on, [DATA] will be mapper/root, so if /dev/[DATA] comes up, you need to use /dev/mapper/root instead of something like /dev/sda2. The old [DATA] will be called [DATA_OLD] in the next disk encryption steps.

Formatting the partitions

Format the boot partition as FAT32:
mkfs.fat -F 32 /dev/[BOOT]

Format the data partition as EXT4 (remember to use /dev/mapper/root if you're using encryption):
mkfs.ext4 /dev/[DATA]

Mounting the partitions

We are going to use the directory /mnt (already exists but it's empty) as the path that will be the root path / (we can't use that since the ISO stuff is in there). In the future, the current /mnt/some/path will be /some/path.

So first, let's mount the root partition to /mnt (will be /):
mount /dev/[DATA] /mnt

The boot partition will be mounted at /boot in the future, so we have to mount it in /mnt/boot. That directory doesn't exist yet, so we have to create it first:
mkdir /mnt/boot

Now we can mount the boot partition, too:
mount /dev/[BOOT] /mnt/boot

Installing the basics

Now it's time to actually install something:
pacstrap -K /mnt base linux linux-firmware nano

The packages are:

  • base: The very basic Arch installation.
  • linux: The standard Linux kernel (instead of linux, you can use another kernel like linux-lts, linux-hardened, linux-zen, ..., just remember which one you installed because we'll need it later!).
  • linux-firmware: The necessary firmware.
  • nano: A simple text editor, we'll need it for the setup.

If that command fails, try the troubleshooting solution below!

Generating the file system table

The file system table (fstab) tells the system what partitions to mount during the startup and where to mount them.

You can generate it by running:
genfstab -U /mnt >> /mnt/etc/fstab

Next: Initial configuration

[Troubleshooting] pacstrap is failing!

Skip this step if the pacstrap... command above didn't fail.

If you have an issue with pacstrap, it might be because your time is messed up, at least that happened to me before. Here's how I managed to resolve it...

Edit the time sync configuration:
nano /etc/systemd/timesyncd.conf

Modify it to look like this (you only need to remove # from two lines):
[Time]
NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org

Exit nano while saving by pressing Ctrl+X, then y to save and press enter to confirm the file name.

Now run the following command to restart the time service:
systemctl restart systemd-timesyncd.service

You can check if the time (at least UTC) is correct now by running timedatectl. If it is, try the pacstrap... command from above again and continue from there.