Arch Linux is known for its simplicity, flexibility, and control. But with great power comes great responsibility—especially when it comes to partitioning and file systems. In this guide, we’ll walk through installing Arch Linux with BTRFS as the root filesystem and full disk encryption using LUKS.
This setup offers a modern, feature-rich filesystem with compression, snapshots, and subvolumes—while keeping your data safe with encryption.
Prerequisites
- A UEFI-capable machine.
- Arch Linux ISO (latest).
- USB stick for installation media.
- Familiarity with command line and basic Linux tools.
Step 1: Boot into the Arch Installer
Download the latest Arch ISO, flash it to a USB drive, and boot into it. Make sure you’re in UEFI mode.
Check with:
ls /sys/firmware/efi/efivars
If the directory exists, you’re in UEFI mode.
Step 2: Connect to the Internet
For Wi-Fi:
iwctl
> station wlan0 connect YourSSID
Verify with:
ping archlinux.org
Step 3: Prepare the Disk
Let’s assume your drive is /dev/nvme0n1
. Replace with your actual device.
Partitioning
Use fdisk
or cgdisk
. Example layout:
- EFI System Partition (ESP): 512M
- Linux encrypted partition: rest of the disk
gdisk /dev/nvme0n1
# Partition 1: EFI (type ef00)
# Partition 2: Linux filesystem (type 8300)
Step 4: Set Up Encryption
Encrypt the second partition using LUKS:
cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 cryptroot
Step 5: Create BTRFS Filesystem
mkfs.btrfs /dev/mapper/cryptroot
Mount it:
mount /dev/mapper/cryptroot /mnt
Create subvolumes:
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@log
btrfs subvolume create /mnt/@snapshots
Unmount and remount with options:
umount /mnt
mount -o noatime,compress=zstd,subvol=@ /dev/mapper/cryptroot /mnt
mkdir /mnt/{boot,home,var/log,.snapshots}
mount -o noatime,compress=zstd,subvol=@home /dev/mapper/cryptroot /mnt/home
mount -o noatime,compress=zstd,subvol=@log /dev/mapper/cryptroot /mnt/var/log
mount -o noatime,compress=zstd,subvol=@snapshots /dev/mapper/cryptroot /mnt/.snapshots
Format and mount the EFI partition:
mkfs.fat -F32 /dev/nvme0n1p1
mount --mkdir /dev/nvme0n1p1 /mnt/boot
Step 6: Install the Base System
pacstrap -K /mnt base linux linux-firmware btrfs-progs vim
Step 7: Configure the System
Generate fstab:
genfstab -U /mnt >> /mnt/etc/fstab
Change root:
arch-chroot /mnt
Set timezone, locale, hostname:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "archbox" > /etc/hostname
Step 8: Initramfs and Encryption Hook
Edit /etc/mkinitcpio.conf
:
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)
Then run:
mkinitcpio -P
Step 9: Set Root Password
passwd
Step 10: Install a Bootloader
Install systemd-boot:
bootctl install
Create a loader entry at /boot/loader/entries/arch.conf
:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=<UUID-of-partition>:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw
Find the UUID:
blkid /dev/nvme0n1p2
Create the loader config at /boot/loader/loader.conf
:
default arch
timeout 3
editor no
Step 11: Reboot
Exit, unmount, and reboot:
exit
umount -R /mnt
reboot
Remove the installation media.
Wrapping Up
You now have a clean Arch Linux installation with:
- BTRFS subvolume layout for better organization and snapshotting.
- LUKS full disk encryption for privacy and security.
- systemd-boot for a fast and modern UEFI bootloader.
From here, you can add a desktop environment, configure snapshots with Snapper or Timeshift, and start tailoring the system to your needs.
Leave a Reply