Auto-detect BTRFS device instead of hardcoding nvme0n1p3

This commit is contained in:
Joey Yakimowich-Payne 2026-02-24 20:10:47 -07:00
commit 919caa935d
2 changed files with 5 additions and 3 deletions

View file

@ -11,7 +11,8 @@ LUKS_DEVICE="/dev/disk/by-id/usb-Seagate_Portable_NT3D9HDX-0:0-part1"
LUKS_KEYFILE="/etc/backup-drive.key"
LUKS_NAME="backup-drive"
BACKUP_MOUNT="/mnt/backup-drive"
BTRFS_DEVICE="/dev/nvme0n1p3"
BTRFS_DEVICE="$(findmnt -n -o SOURCE /var/home 2>/dev/null | sed 's/\[.*//')"
[ -b "${BTRFS_DEVICE:-}" ] || BTRFS_DEVICE="$(findmnt -n -o SOURCE / 2>/dev/null | sed 's/\[.*//')"
BTRFS_TOP="/mnt/btrfs-root"
SNAP_DIR="snapshots"
KEEP_LOCAL=2 # local snapshots (need at least 1 for incremental parent)