#!/usr/bin/env bash ROOT_DATASET=$(zfs list -H -o name,mountpoint | awk '$2 == "/" { print $1 }') if [ -z "$ROOT_DATASET" ]; then echo "Error: Could not detect ZFS dataset mounted at /" >&2 exit 1 fi # Usually the pool name is the first component (rpool/ROOT/ubuntu → rpool) POOL_NAME="${ROOT_DATASET%%/*}" # Create zfs snapshots before apt operations using apt hooks # 1. Create a Snapshot Script # Create /usr/local/sbin/snapPrepApt conf_print_snapPrepApt() { cat <