Files
2025-12-19 22:14:51 -07:00

2.0 KiB

title, slug, date, .. tags, .. category, .. link, .. description, draft
title slug date .. tags .. category .. link .. description draft
rEFInd refind 2017-06-02T20:56:04-06:00 linux,uefi,boot,secureboot,bootloader false

Booting linux requires a boot loader. I chose to use rEFInd vs GRUB or systemd boot. Installing is easy once the partitioning is setup. My partition scheme is a vfat esp partition of 512MB a ext2 boot partition 512MB and the rest of the disk for root on btrfs encrypted with dm-crypt and LUKS. This works for a bootable usb as well as internal drive. BTRFS was chosen for the subvolume feature. In the BTRFS root I create a /archroot and /home subvolume. On major system changes/upgrades I snapshot the /archroot subvolume to /archroot-date making a rollback simpler.

To configure kernels for rEFInd add a file called refind_linux.conf in the same folder(/boot) as the kernel(s). Add kernel command lines here.

#refind_linux.conf
"Boot with standard options"        "root=UUID=123456 rw rootfstype=btrfs rootflags=subvol=arch acpi_backlight=video initrd=/intel-ucode.img initrd=initramfs-linux.img i915.enable_psr=0"
"Boot to single-user mode"          "root=UUID=123456 single"
"Boot with minimal options"         "root=UUID=123456"

additional options for LUKS would be added here. change subvol=arch to subvol=arch-date to boot from snapshot

btrfs commands that I use frequently:

mount /dev/sdaX /mnt #mount the btrfs root(not /)
cd /mnt #change to the btrfs root
btrfs subvolume snapshot name-of-subvolume(arch) name-of-snapshot(arch-date)

update: Figured out how refind determines which kernel to boot automatically, it's the one with the most recent date. Thinking about putting a hook into pacman or something to run touch on vmlinuz after kernel upadtes.