Arch installation on a BTRFS root filesystem with LUKS encryption
Arch Linux Installation Guide (UEFI, GPT, systemd-boot, LUKS, Btrfs)
1. Initial Setup
1.1 Laptop Model
Identify the model for compatibility, especially for Wi-Fi and graphics.
1.2 ISO Download
Download the latest Arch ISO from: https://archlinux.org/download/
1.3 Set Console Font (Optional)
If the console font appears too small, set a larger one:
1setfont ter-v24b
To copy the font for persistence:
1cp /usr/share/kbd/consolefonts/ter-v24b.psf.gz /mnt/usr/share/kbd/consolefonts
Other font options (located in /usr/share/kbd/consolefonts
):
ter-132n
lat9w-16
sun12x22
ter-u28b
1.4 Set Alias for Clear Command
1alias c=clear
1.5 Set Keyboard Layout
Default layout is us
. To change (e.g. to UK):
1loadkeys uk
2. Network Configuration
2.1 Connect to Wi-Fi
Use iwctl
or nmtui
to connect to a wireless network.
2.2 Verify Internet Access
1ping archlinux.org
2.3 Set Root Password
1passwd
2.4 SSH Access (Optional)
1ip a
2ssh root@<ip-address>
3. Time and Locale Configuration
3.1 Check and Set Time
1timedatectl
3.2 Set Timezone
1timedatectl list-timezones
2timedatectl set-timezone Africa/Blantyre
4. UEFI Mode Verification
1cat /sys/firmware/efi/fw_platform_size
5. Partitioning Scheme (GPT)
Partition | Size | Type | Mount Point |
---|---|---|---|
p1 | 512MB | EFI | /boot |
p2 | Rest | LUKS+Btrfs | / (subvolumes) |
p3 | 2–4GB | Linux Swap | swap |
6. LUKS and Btrfs Setup
6.1 Encrypt Root Partition
1cryptsetup luksFormat /dev/nvme0n1p2
2cryptsetup open /dev/nvme0n1p2 luks_btrfs
6.2 Format Btrfs
1mkfs.btrfs /dev/mapper/luks_btrfs
2mount /dev/mapper/luks_btrfs /mnt
6.3 Create Btrfs Subvolumes
1btrfs subvolume create /mnt/@
2btrfs subvolume create /mnt/@home
3umount /mnt
6.4 Setup Swap and EFI
1mkswap /dev/nvme0n1p3
2swapon /dev/nvme0n1p3
3mkfs.fat -F32 /dev/nvme0n1p1
6.5 Mount Subvolumes and Boot
1mount -o subvol=@ /dev/mapper/luks_btrfs /mnt
2mkdir -p /mnt/{home,boot}
3mount -o subvol=@home /dev/mapper/luks_btrfs /mnt/home
4mount /dev/nvme0n1p1 /mnt/boot
6.6 Verify Subvolumes
1btrfs subvolume list /mnt
7. Install Arch Linux Base
1pacstrap -K /mnt base base-devel linux linux-firmware git btrfs-progs efibootmgr inotify-tools timeshift neovim networkmanager pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber reflector zsh zsh-completions zsh-autosuggestions openssh man sudo iwd hyprland intel-ucode tmux
8. System Configuration (Inside chroot)
8.1 Generate Fstab
1genfstab -U /mnt >> /mnt/etc/fstab
2arch-chroot /mnt
8.2 Timezone & Clock
1ln -sf /usr/share/zoneinfo/Africa/Blantyre /etc/localtime
2hwclock --systohc
8.3 Locale
1nvim /etc/locale.gen
2# Uncomment en_US.UTF-8
3locale-gen
4echo "LANG=en_US.UTF-8" > /etc/locale.conf
9. Hostname and Console Font
1echo "jarvis" > /etc/hostname
2cp /usr/share/kbd/consolefonts/ter-v24b.psf.gz /usr/share/kbd/consolefonts
3echo "FONT=ter-v24b" > /etc/vconsole.conf
10. Initramfs Configuration
What is initramfs?
initramfs (initial RAM filesystem) is a temporary root filesystem loaded into memory during the boot process. It provides essential drivers and scripts that allow the real root filesystem to be mounted. In encrypted or complex setups, it is crucial for unlocking LUKS containers and mounting Btrfs subvolumes before handing control to the main OS.
10.1 Configure initramfs
Edit /etc/mkinitcpio.conf
:
1HOOKS=(base systemd autodetect microcode modconf keyboard sd-vconsole kms sd-encrypt block btrfs filesystems fsck)
10.2 Rebuild initramfs
1mkinitcpio -P
11. Install Bootloader (systemd-boot)
1mount /dev/nvme0n1p1 /mnt/boot
2arch-chroot /mnt
3bootctl install
4bootctl update
Create Boot Entry
Create /boot/loader/entries/arch.conf
:
1title Arch Linux
2linux /vmlinuz-linux
3initrd /initramfs-linux.img
4options rd.luks.name=<UUID>=luks_btrfs root=/dev/mapper/luks_btrfs rw
Get the UUID:
1blkid /dev/nvme0n1p2