How to Install Arch Linux with Btrfs Filesystem and Snapshot-Ready Subvolumes

How to Install Arch Linux with Btrfs Filesystem and Snapshot-Ready Subvolumes

How to install Arch Linux with Btrfs Filesystem and Rollback Features Enabled

Installing Arch Linux is only half the battle, setting it up the right way from the start is the real game. Here is how to install Arch Linux with Btrfs partitions and properly configured subvolumes for a clean, flexible, and snapshot-ready Linux system.

This guide is part of the MusaBase Linux Series. For a complete overview, explore our Arch Linux Roadmap and the Advanced Linux Distributions Guide.

Welcome back to MusaBase!. Now, in my previous Arch Linux Installation guide, I installed Arch Linux manually from scratch and set up everything on the CLI environment. But there was one thing missing. Whenever my Arch Linux system broke, and why wouldn't it? (because of "rolling release distro"). I either had to fix the problem manually or wait for the next system update to arrive and hope it wouldn't break my system further. That's when I switched to Btrfs as my filesystem of choice, and in today's guide, I'm going to show you how to install Arch Linux on a properly structured Btrfs filesystem, with subvolumes laid out and ready for snapshots and rollback in the next guide.

Let's uncover what we can do on Linux that we can't experiment with otherwise. The things that we will cover:

  • Creating storage drive partitions using cfdisk.
  • Formatting partitions for boot, swap (optional), and root (btrfs).
  • Mounting the filesystem and Btrfs subvolumes correctly in the live Arch Linux ISO environment.
  • Installing the base Arch Linux system.
  • Chrooting into the installed Arch Linux system from the live ISO.
  • Setting up the base Arch Linux system.
  • Booting into the installed Arch Linux system.






Prerequisites

This guide assumes that you already have the Arch Linux ISO and have created a bootable USB stick. Plus, you have also disabled Secure Boot and Fast Boot in your PC's UEFI/BIOS settings. Even if you only know your way around the tty1 or CLI (non‑graphical interface) a little, you are good to go. Then just plug in your Arch Linux USB, reboot your PC, boot into the live Arch Linux ISO environment, and jump to storage drive partitioning and formatting.




⚡ TL;DR: Arch Linux with Btrfs (Snapshot‑Ready)

A quick reference for the essential steps to install Arch Linux on a properly structured Btrfs filesystem with subvolumes ready for snapshots and rollback.

  1. Partition with cfdisk: Create a 1 GB EFI boot partition, an optional swap, and the rest as root (/dev/sda3).
  2. Format:
    mkfs.fat -F32 /dev/sda1
    ,
    mkfs.btrfs -L ArchRoot /dev/sda3
    ,
    mkswap /dev/sda2
    .
  3. Create subvolumes: Temporarily mount root, then
    btrfs subvolume create /mnt/@{,@home,@log,@cache}
    , unmount.
  4. Mount properly:
    mount -o compress=zstd:1,noatime,subvol=@ /dev/sda3 /mnt

    Create dirs:
    mkdir -p /mnt/{boot/efi,home,var/log,var/cache}

    Mount subvols + boot,
    swapon /dev/sda2
  5. Install base system:
    pacstrap -K /mnt base linux linux-firmware base-devel btrfs-progs grub efibootmgr nano git sudo networkmanager
  6. Generate fstab:
    genfstab -U /mnt >> /mnt/etc/fstab
    , then
    arch-chroot /mnt
  7. Configure system: timezone, locale, hostname, root passwd, user with sudo, enable NetworkManager
  8. Install GRUB:
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
    , then
    grub-mkconfig -o /boot/grub/grub.cfg
  9. Reboot:
    exit
    umount -R /mnt
    reboot
    . Log in and you’re done

πŸ’‘ After booting, run sudo btrfs subvolume list / to verify your layout. In the next guide we’ll install Snapper and grub‑btrfs for automatic snapshots and rollback.




Step 1: Storage Drive Partitioning and Formatting

In this step, we will manually partition the storage drive for Arch Linux. We will create a total of three partitions:

Since we are installing Arch Linux manually, we can choose our selected storage drive, create and allocate custom storage space to each partition, and install the base Arch Linux on root partition. I'm going to use cfdisk utility to create partitions on my sda drive. If you have multiple storage drives connected to your PC, then first run the lsblk -f command to identify each connected storage device and select the drive you want to create partition (e.g., sdb, sdc, etc). Always double the name of your storage drive before partition because after accidental data removal getting that data back is not impossible but the effort is very tiring. Now, if everything is set, lets get to it. Run the following command:

cfdisk /dev/sda
Cfdisk /dev/sda to create custom disk partition for Arch Linux
  • Next, on the partition layout table screen, select GPT and you will be in the cfdisk interface with your selected storage drive, ready to create custom partitions for Arch Linux.
Navigating Cfdisk Interface
  • Press ⬆️ and ⬇️ arrow keys to navigate Up and Down (for navigating through the storage drive section).
  • Press ⬅️ and ➡️ arrow keys to navigate Left and Right (for navigating through the bottom menu section).
  • Tab key can also be used to select different options in the bottom menu section.
  • Use ENTER to confirm.

1.1: Creating Boot Partition for Arch Linux

  • Select Free Space and press ENTER on [ NEW ] from bottom menu.
  • Allocate around 1 GB of storage space by typing 1G and press ENTER to confirm.

1.2: Creating Swap Partition for Arch Linux (Optional)

  • Select Free space and press ENTER on [ NEW ] from bottom menu.
  • Allocate the amount of space you want your Arch Linux system to use as Virtual memory when the physical RAM limit is exceeded. For my system, I'm allocating around 9G.

1.3: Creating Root Partition for Arch Linux

  • Select Free space and press ENTER on [ NEW ] from bottom menu.
  • Allocate the remaining storage space (normally pre‑selected) and press ENTER.

1.4: Writing Partitions Table Changes to Disk

  • Select [ Write ] from the bottom menu and press ENTER.
  • Type yes at the prompt "Are you sure you want to write the partition table to disk?" and press ENTER.

Now, with everything set, let's head to formatting and mounting the Linux filesystem.




Step 2: Creating Btrfs Subvolumes and Mounting Filesystem

In this step, we will format each partition into the Linux filesystems needed for the Arch Linux installation. Here's what it's actually going to be:

After formatting these partitions, we will mount them and also create the btrfs subvolumes. But first, run lsblk. It's just a recommendation that makes partition detection easier while running formatting or mounting commands.

2.1: Formatting Partitions

  • Run these commands consecutively:
mkfs.fat -F 32 /dev/sda1 #formatting boot partition
mkfs.btrfs -L ArchRoot /dev/sda3 #formatting root partition
mkswap /dev/sda2 #turning on swap area
Manually formatting partitions in boot, swap, root (btrfs) order for Arch Linux

2.2: Mounting Filesystem Temporarily

First we have to temporarily mount the root partition, then create the btrfs subvolumes, then unmount the root partition and mount them properly. We do so because the mount point for btrfs subvolumes does not exist yet. Make sure to run lsblk again to double-check the partition names.

2.2.1: Mounting Root Partition Temporarily to Create Subvolumes

  • Run:
mount /dev/sda3 /mnt
Mounting root partition to create subvolumes

2.2.2: Create Btrfs Subvolumes

  • Run these consecutively:
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@log
btrfs subvolume create /mnt/@cache
umount /mnt
Creating btrfs subvolumes on root partition for Arch Linux installation

2.3: Mounting Filesystem Properly

With the groundwork laid out, we can now properly mount the filesystem and begin the base Arch Linux installation.

2.3.1: Mounting Root Partition Properly

  • Run:
mount -o compress=zstd:1,noatime,subvol=@ /dev/sda3 /mnt
Mounting btrfs root partition on the filesystem to manually install Arch Linux

2.3.2: Make Directories for Boot Partition and Btrfs Subvolumes

  • Run:
mkdir -p /mnt/{boot/efi,home,var/log,var/cache}
Making directories for boot partition and Btrfs subvolumes in live Arch Linux ISO to manually install Arch Linux

2.3.3: Mounting Btrfs Subvolumes

  • Run these commands consecutively:
mount -o compress=zstd:1,noatime,subvol=@home /dev/sda3 /mnt/home
mount -o compress=zstd:1,noatime,subvol=@log /dev/sda3 /mnt/var/log
mount -o compress=zstd:1,noatime,subvol=@cache /dev/sda3 /mnt/var/cache
Mounting btrfs subvolumes on the filesystem

2.3.4: Mounting Boot Partition and Turning on Swap Area

  • Run the following commands sequentially:
mount /dev/sda1 /mnt/boot/efi
swapon /dev/sda2
Mounting boot partition at /boot/efi and turning on Swap area manually for Arch Linux

The final layout for the mounted filesystem should look like this:

Final layout of mounted filesystem for Arch Linux installation For me this is:
  • sda1: My boot partition mounted at /mnt/boot/efi.
  • sda2: My swap partition, this partition doesn't need to be mounted anywhere, we just have to turn it on with swapon /dev/partitionname.
  • sda3: My root partition mounted at /mnt with btrfs subvolumes mounted at the respective mountpoints:
    • @home: Mounted at /mnt/home.
    • @log: Mounted at /mnt/var/log.
    • @cache: Mounted at /mnt/var/cache.

With everything in order, let's jump right into the installing the base Arch Linux system.




Step 3: Installing Base Arch Linux System

In this step, we will install the base Arch Linux system with the pacstrap utility. Pacstrap is a powerful tool designed to create a new system installation from scratch.

  • Run the following command:
pacstrap -K /mnt base linux linux-firmware base-devel btrfs-progs grub efibootmgr nano git sudo networkmanager

Troubleshooting

If you get an error like:

error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded
==> ERROR: Failed to install packages to new root
Error PGP signature while installing base Arch Linux system

This means either your Arch Linux ISO is old, which often leads to unverified PGP Signatures. We can easily fix this by running:

pacman -Sy archlinux-keyring

After the PGP signature update finishes, run the base Arch Linux installation command again.

If the issue persists


#1
pacman-key --init
pacman-key --populate archlinux

#2
timedatectl set-ntp true
hwclock -w

#3
pacman -Syy

With the base system installation is done the remaining steps are the same as i covered in Complete Arch Linux Installation Guide's Step: 8 Generating Fstab, however in this guide we can do all these steps in quick setting up base Arch Linux system.




Step 4: Quick Setting Up the Base Arch Linux System

In this step, we will quickly set up our installed Arch Linux system from the Live ISO environment. We are going to perform:

4.1: Generate and Store Fstab

  • Run:
genfstab -U /mnt >> /mnt/etc/fstab
Generating and storing fstab in installed Arch Linux system

4.1.2: Verify Fstab (Optional)

  • We can also verify if our fstab stored correctly with correct filesystem entries by running:
cat /mnt/etc/fstab
Running cat /mnt/etc/fstab to verify fstab

4.2: Chroot into Arch Linux

  • Run:
arch-chroot /mnt

4.3: Set Timezone

  • Run these commands consecutively:
ln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime
hwclock --systohc
Setting up timezone and syncing hardware clock

4.4: Configure Locale

  • Open locale.gen file with:
nano /etc/locale.gen
  • Find your preferred locale line (e.g., #en_US for English, #fr-FR for French, etc.) and delete the # from the start of the line by either using DEL or Backspace key.
  • Press CTRL + O to save the file then press ENTER to apply, then press CTRL + X to exit the file.
  • Next, generate locale by running:
locale-gen
  • Finally, create locale.conf so your system can use it by running:
echo "LANG=en_US.UTF-8" > /etc/locale.conf

4.5: Set Hostname

  • Run:
echo "MusaBase" >> /etc/hostname

4.6: Set Root Password

  • Run:
passwd
  • Enter and re-enter password and your root password will be set.

4.7: Create User

  • Run:
useradd -m -G wheel -s /bin/bash musabase

4.7.1: Set User Password

  • Run:
passwd musabase

4.8: Enable Sudo

  • Run:
EDITOR=nano visudo
  • In the opened file, uncomment the following line by removing # from the start:
# %wheel ALL=(ALL:ALL) ALL
  • Press CTRL + O to save the file then press ENTER to apply, then press CTRL + X to exit the file.

4.9: Enable NetworkManager

  • Run:
sudo systemctl enable NetworkManager
Enabling NetworkManager for Arch Linux system in arch-chroot

4.10: Install Grub

  • Run:
grub-install /dev/sda
# OR
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
Installing GRUB on Arch Linux in arch-chroot

4.10.1: Initialize Grub

  • Run:
grub-mkconfig -o /boot/grub/grub.cfg
Initializing GRUB with grub-mkconfig command to generate GRUB files

4.11: Reboot

  • Run these commands consecutively:
exit
umount -R /mnt
reboot



Step 5: Boot into Installed Arch Linux System

If everything went right, then after rebooting you should have a similar screen:

GRUB menu with Arch Linux entry

Select Arch Linux and press ENTER. After a few seconds you will be prompted to enter your username and password that you set during user creation, and then you will be logged into your freshly installed Arch Linux system.

Successfully logged into a freshly installed Arch Linux system

And we are in! Run sudo btrfs subvolume list / to confirm your subvolumes are mounted correctly before moving on.




❓ Frequently Asked Questions: Arch Linux with Btrfs Filesystem

What is Btrfs and why should I use it for Arch Linux?

Btrfs (B-tree filesystem) is a modern Linux filesystem with advanced features like snapshots, rollback, compression, and subvolumes. For Arch Linux, a rolling release distro, Btrfs is especially useful because you can take a snapshot before a system update and roll back if something breaks. It gives you a safety net that ext4 simply cannot provide.

What are Btrfs subvolumes and why do I need them?

Subvolumes are independent logical sections inside a single Btrfs partition. Think of them as flexible folders that can be snapshotted, rolled back, or mounted separately. By creating subvolumes like @, @home, @log, and @cache, you isolate system files from user data, logs, and cache. This means a system rollback will not touch your personal files or erase recent logs.

Why create separate @home, @log, and @cache subvolumes?

Each subvolume serves a specific purpose:

  • @home: Stores your personal files, downloads, and documents. Keeping it separate ensures system rollbacks never affect your data.
  • @log: Stores system and journal logs. Excluding logs from snapshots keeps snapshot sizes small and preserves recent log entries after a rollback.
  • @cache: Stores pacman package cache and temporary application data. Excluding cache from snapshots prevents restoring outdated or unnecessary files.
What is the difference between Btrfs and ext4 for Arch Linux?

ext4 is a stable, well-tested filesystem with no snapshot or compression support. Btrfs offers snapshots, rollback, transparent compression, and subvolumes. On a rolling release like Arch Linux, Btrfs gives you the ability to undo a bad update instantly. ext4 requires external backup tools and manual recovery. For most Arch users, Btrfs is the better choice.

Do I need a swap partition with Btrfs on Arch Linux?

No, a swap partition is entirely optional. However, it is recommended if you have limited RAM or want hibernation support. You can also use a swap file on Btrfs instead of a dedicated partition, but that requires additional configuration. The guide includes a swap partition for completeness.

What is pacstrap and how is it different from pacman?

pacstrap is a wrapper script designed specifically for installing Arch Linux. It uses pacman under the hood but simplifies the process by handling keyring initialization, package downloading, and installation to a target mount point like /mnt. You cannot use pacstrap on an already installed system; it is only available on the live ISO.

Why do I need to mount the root partition twice during installation?

During a Btrfs installation, you first mount the root partition temporarily to create the subvolumes. After creating them, you unmount it and then mount it again properly with the subvol=@ option. This is necessary because the subvolumes must exist before you can mount them. The temporary mount gives you access to create them.

What does the compress=zstd mount option do?

compress=zstd enables transparent compression on your Btrfs filesystem using the Zstandard algorithm. zstd:1 uses compression level 1, which is fast and lightweight. This reduces disk usage and can even improve read speeds on slower storage devices without a noticeable CPU overhead.

Can I install Arch Linux with Btrfs on an existing dual-boot system?

Yes. This guide uses manual partitioning with cfdisk, so you can create Btrfs partitions alongside existing Windows or other Linux installations. Just make sure you have free unallocated space on your drive and do not overwrite your existing partitions. Always double-check partition names before formatting.

What if I forget to create the @home subvolume?

If you skip creating @home, your home directory will live inside the @ subvolume. This means system snapshots will include your personal files, making snapshots larger, and a rollback could overwrite recent changes to your documents. You can still create @home later, but it requires manual data migration.

How do I verify my Btrfs subvolumes are mounted correctly?

After completing the mounting steps, run lsblk or findmnt /mnt to see the full mount tree. You should see /mnt with subvolumes mounted at /mnt/home, /mnt/var/log, and /mnt/var/cache. You can also check cat /mnt/etc/fstab after generating it to verify the entries.

What is GRUB and why do I need efibootmgr?

GRUB (GRand Unified Bootloader) is the bootloader that loads your Arch Linux kernel at startup. efibootmgr is a tool that manages UEFI boot entries. When you run grub-install, it uses efibootmgr to create a boot entry in your motherboard's UEFI firmware so your system knows where to find Arch Linux.

Can I skip creating a swap partition?

Yes. If you have sufficient RAM (8 GB or more) and do not need hibernation, you can skip the swap partition entirely. Simply skip the swap creation step in cfdisk and the swapon command. The rest of the guide works without swap.

How much space should I allocate for the boot partition?

For a UEFI system, 1 GB is more than enough. The boot partition only stores GRUB and kernel images. Even with multiple kernels, you will rarely exceed 200–300 MB. Allocating 1 GB gives you a comfortable buffer for future needs without wasting significant disk space.




Congratulations, your Arch Linux system with Btrfs is installed and ready!

At this point, you have a solid Btrfs foundation with separate subvolumes for home, logs, and cache. From here, you can move forward depending on how you want to use your system.

What's Next?

Next Guide: Enable Snapshots and Rollback

Snapper & GRUB-Btrfs: Install and configure automatic Btrfs snapshots and system rollback to protect your Arch Linux from breaking updates, coming up in the next guide.


Desktop Environments and Post Install Guide

KDE, GNOME, XFCE and more: Set up a full desktop environment on your fresh Arch install, and to enhance your Arch Linux experience, explore the Arch Linux Roadmap.


Try Hyprland Dotfiles

ML4W, HyDE, JaKooLit, Caelestia, End 4 and more: Find the perfect Hyprland setup for your workflow, explore the Hyprland Dotfiles Hub.


Advanced Virtualization

QEMU/KVM & GPU Passthrough: Eliminate dual-booting and get native graphics speed inside a VM, explore the QEMU/KVM Hub.


Gaming on Linux

Steam, Proton, Bottles and more: Run Windows games on your Arch Linux system, explore the Linux Gaming Hub.


A slightly more complicated Linux distro

Gentoo, and beyond: Go deeper into the world of advanced Linux distributions, explore the Advanced Linux Distributions Guide.

That's it for this guide. In the next one, we'll set up Snapper and GRUB-Btrfs to give your Arch Linux system full rollback capability. If you run into any issues, feel free to leave a comment – I'll be happy to help.
101 out, I'll see you in the next one! πŸš€

Load comments