Disaster recovery script for Arch Linux. Boot from any Arch ISO, run this script, get a working system.
"So you want to be the captain?"
This is a bare-metal recovery system. If your laptop dies, gets stolen, or you just want to nuke and start fresh:
- Boot any Arch ISO (USB, netboot, whatever)
- Connect to WiFi
- Run this script
- Reboot into a working i3 desktop
- Formats boot (FAT32) and root (ext4) partitions
- Installs base system + i3 + sddm + essential packages
- Creates user
benwith passwordchangeme - Sets up systemd-boot
- Enables NetworkManager and sddm
- Auto-detect disks/partitions
- Handle dual-boot scenarios
- Matrix screen animations
┌─────────────────────────────────────────────────────────────────┐
│ 1. ARCH-RESTORE (~15 min) │
│ Boot ISO → partition → ./install.sh → reboot │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 2. PERSONALIZATION (~45 min) │
│ git clone https://github.com/benthayer/arch-personalization.git ~/.ben │
│ ~/.ben/setup/configure.sh │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 3. AUTH DANCE (~10 min) │
│ ssh-keygen, gh auth, gcloud auth, az login, doctl auth │
└─────────────────────────────────────────────────────────────────┘
↓
DONE
Total recovery time: ~1 hour
| Component | Handled by |
|---|---|
| Base Arch system | arch-restore/install.sh |
| i3 + sddm + NetworkManager | arch-restore/install.sh |
| All packages (pacman + AUR) | ~/.ben/setup/configure.sh |
| Dotfiles + configs | ~/.ben/setup/configure.sh |
| oh-my-zsh, nvm, node, bun | ~/.ben/setup/configure.sh |
| toggl CLI | ~/.ben/setup/configure.sh |
| Docker, CUPS, Bluetooth | ~/.ben/setup/configure.sh |
| System configs (/etc) | ~/.ben/setup/configure.sh |
| What | Why |
|---|---|
| SSH key generation | Passphrase decision |
gh auth login |
OAuth browser flow |
gcloud auth login |
OAuth browser flow |
az login |
OAuth browser flow |
doctl auth init |
Token input |
.passwords file |
Contains secrets |
# Boot Arch ISO, connect to WiFi
iwctl station wlan0 connect "YourWiFi"
# Get the script
curl -O https://raw.githubusercontent.com/benthayer/arch-restore/main/install.sh
chmod +x install.sh
# Partition your disk first (if needed)
# Example: fdisk /dev/nvme0n1
# - Partition 1: 256MB, EFI System
# - Partition 2: Rest, Linux filesystem
# Run it
./install.sh /dev/nvme0n1p1 /dev/nvme0n1p2
# Reboot
reboot# Login as ben (password: changeme)
# Connect to WiFi
nmcli device wifi connect "YourWiFi" password "YourPassword"
# Get the deploy key (from USB, this repo, wherever you stashed it)
# The encrypted key is in this repo at deploy_key
# Passphrase: memorized (10k rounds = ~2 min to decrypt = ~$30M to crack)
# Set up SSH agent with deploy key
eval "$(ssh-agent -s)"
ssh-add deploy_key # enter passphrase
# Clone with deploy key
git clone git@github.com:benthayer/ben.git ~/.ben
~/.ben/setup/configure.sh
# Reboot
rebootssh-keygen -t ed25519 -C "ben@benthayer.com"
gh auth login
gcloud auth login
az login
doctl auth init- Download the Arch ISO: https://archlinux.org/download/
- Download Rufus: https://rufus.ie/
- Insert USB drive
- Open Rufus:
- Select your USB drive
- Select the Arch ISO
- Partition scheme: GPT
- Target system: UEFI
- Click Start
- Boot from USB (usually F12 or F2 at startup)
Alternative tools:
- balenaEtcher — simpler, just select ISO and drive
- Ventoy — install once, then just drag ISOs onto the USB
- Phase 1: MVP base system install
- Phase 2: Personal config bootstrap (dotfiles, packages, tools)
- Phase 3: Auto-detect disks, handle different hardware
- Phase 4: Secrets via Keybase
- Phase 5: Custom ISO with script baked in
- Phase 6: Windows-to-Linux exe installer
- Phase 7: Matrix boot screens
- Phase 8: Voice activation ("Captain on deck")
Your entire local computer is a cache. Everything that matters is:
- On GitHub
- In Keybase
- Re-downloadable
This script rebuilds the cache from nothing.
"What disaster?"