Skip to main content

Btrfs Fresh Install Adventure

· One min read
Max Kaido
Architect

Here's your awesome guide to a clean Btrfs installation:

Chapter 1: Preparation

# Backup your precious 10GB
rsync -avzP /home/dev /mnt/capsule/backup_feb2025/

Chapter 2: The Magic Layout

During Ubuntu 24.04 installation:

  1. Choose "Advanced" partitioning
  2. Create this simple but powerful structure:
EFI:      /boot/efi    (fat32)  512MB
SWAP: [SWAP] (swap) 16GB
ROOT: / (btrfs) REST OF DISK

Chapter 3: The Enchanted Commands

After installation, transform your Btrfs into awesomeness:

# Create the magical subvolumes
sudo mount /dev/sda3 /mnt # Adjust sda3 to your root partition
cd /mnt
sudo btrfs subvolume create @
sudo btrfs subvolume create @home
sudo btrfs subvolume create @snapshots

# The sacred mount options (add to /etc/fstab)
UUID=your-uuid / btrfs defaults,noatime,compress=zstd:1,subvol=@ 0 0
UUID=your-uuid /home btrfs defaults,noatime,compress=zstd:1,subvol=@home 0 0
UUID=your-uuid /.snapshots btrfs defaults,noatime,compress=zstd:1,subvol=@snapshots 0 0

Chapter 4: The Power Spells (Aliases)

Add to your .zshrc:

# Quick snapshot before dangerous stuff
alias snap-save='sudo btrfs subvolume snapshot / /.snapshots/$(date +%Y-%m-%d_%H-%M)'

# Check your storage magic
alias btrfs-status='sudo btrfs filesystem usage /'

Chapter 5: The Wisdom

  • Keep root and home separate (but on same Btrfs)
  • Compression happens automatically
  • Snapshots are instant and space-efficient
  • No need for complex RAID - Btrfs handles it

Epilogue: Quick Health Check

# Run this occasionally
sudo btrfs scrub start /

Remember: With great power comes great responsibility... but Btrfs makes it hard to mess up! 🧙‍♂️