/easy-arch

Script for boostrapping Arch Linux with BTRFS, snapshots and LUKS encryption (UEFI only).

Primary LanguageShellApache License 2.0Apache-2.0

Introduction

easy-arch is a bash script made in order to boostrap a basic but modern Arch Linux environment, with a few cherry-picked features:

  1. BTRFS bootable snapshots from GRUB
  2. LUKS2 encryption
  3. ZRAM as swap
  4. systemd-oomd
  5. Autodetect VMs and provide guest tools (if available)

How does it work?

  1. Download an Arch Linux ISO from here
  2. Flash the ISO onto an USB Flash Drive
  3. Boot the live environment
  4. Set the keyboard layout by using loadkeys <kblayout>
  5. Connect to the internet
  6. Run this bash <(curl -sL bit.ly/easy-arch)

Partitions layout

Partition Number Label Size Mountpoint Filesystem
1 ESP 512 MiB /boot/ FAT32
2 Cryptroot Rest of the disk / BTRFS Encrypted (LUKS2)

The partitions layout is simple and it's inspired by this section of the Arch Linux Wiki. As you can see there're only two partitions:

  1. A FAT32, 512MiB sized, mounted at /boot/ for the ESP.
  2. A LUKS2 encrypted container, which takes the rest of the disk space, mounted at / for the rootfs.

BTRFS subvolumes layout

Subvolume Number Subvolume Name Mountpoint
1 @ /
2 @home /home
3 @root /root
4 @srv /srv
5 @snapshots /.snapshots
6 @var_log /var/log
7 @var_pkgs /var/cache/pacman/pkg

The BTRFS subvolumes layout follows the traditional and suggested layout used by Snapper, you can find it here. Here's a brief explanation of the BTRFS layout I chose:

  1. @ mounted at /
  2. @home mounted at /home
  3. @root mounted at /root
  4. @srv mounted at /srv
  5. @snapshots mounted at /.snapshots
  6. @var_log mounted at /var/log
  7. @var_pkgs mounted at /var/cache/pacman/pkg