Skip to content

debelio/arch-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Arch Linux Automated Installation Script

Automated installer for Arch Linux with LUKS2 encryption, BTRFS filesystem, and UEFI support.

Inspired by: easy-arch, Archinstall and SysGuides

Features

  • Full Disk Encryption (LUKS2)
  • BTRFS with Subvolumes (snapshots, compression)
  • UEFI Boot (GRUB with encryption support)
  • Performance (zram swap, optimized mount options)
  • Snapshot Management (snapper for root and home, grub-btrfs for bootable snapshots, snap-pac for automatic pacman snapshots)

Prerequisites

  • Boot from Arch Linux live image
  • UEFI-capable system
  • Internet connection configured (the easiest way is via iwctl or wifi-menu on the Arch ISO), e.g.:
    iwctl --passphrase "Passphrase" station wlan0 connect <NetworkName>

Installation Steps

  1. Initial Setup:
# Download and run
curl -O https://raw.githubusercontent.com/debelio/arch-install/refs/heads/main/arch-install.sh
chmod +x arch-install.sh
# Run with sudo (if not already root)
./arch-install.sh

What the Script Does

  1. Preparation: Checks permissions, checks internet connection
  2. User Input: Passwords (LUKS, root, user), hostname, user account, disk selection
  3. Partitioning: Creates ESP (1GB) + encrypted root partition
  4. Encryption: LUKS2 with keyfile for passwordless boot (after GRUB unlocks it)
  5. Filesystem: BTRFS with subvolumes (@, @home, @opt, etc.)
  6. Installation: Base system + linux kernels (stable & lts) + firmware + grub + btrfs-progs + snapper + snap-pac + zram-generator + networkmanager + vim + sudo
  7. Configuration: Fstab, Timezone, Locales, Users, Sudoers, Mkinitcpio (systemd hooks), GRUB (cryptodisk enabled)
  8. Boot Setup: EFIBootMgr entry, GRUB configuration with BTRFS integration
  9. Finalization: Services enabled (NetworkManager, snapper timers, etc.)

BTRFS Layout

The installation creates separate BTRFS subvolumes for different parts of the filesystem:

/                  (@)
/home              (@home)
/home/.snapshots   (@home/.snapshots)   - snapper snapshots for home
/opt               (@opt)
/.snapshots        (@.snapshots)        - snapper snapshots for root
/var/cache         (@var/cache)
/var/lib/docker    (@var/lib/docker)
/var/lib/libvirt   (@var/lib/libvirt)
/var/log           (@var/log)
/var/spool         (@var/spool)
/tmp               (@tmp)

This layout allows:

  • Separate snapshots for root and home directories via snapper
  • Selective exclusion of cache, logs, and temporary data from snapshots
  • Optimized mount options (compression, noatime, SSD support)
  • Boot into any snapshot via GRUB menu (grub-btrfs integration)

Post-Installation

Network Configuration

The script enables NetworkManager by default. After rebooting into the new system, you can use nmcli or nmtui to set up your network connection if it doesn't auto-connect.

Snap-Pac Integration

The installation script installs snap-pac, a pacman hook that automatically creates Btrfs snapshots before and after package operations using snapper.

How it works:

  • Pre-snapshot: Creates a snapshot before package installation/removal
  • Package operation: Runs the pacman command
  • Post-snapshot: Creates a post-snapshot after successful operations
  • Automatic cleanup: Snapper manages snapshot retention based on configured limits

Usage: Simply use pacman as usual. Snapshots are created automatically:

sudo pacman -S neovim
# Output includes snapshot creation messages

Manual snapshot management: Use snapper commands to manage snapshots:

# List snapshots
sudo snapper -c root list

# Rollback to a snapshot
sudo snapper -c root rollback <snapshot-number>

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

An automated installation of Arch Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages