Skip to content

Instantly share code, notes, and snippets.

View almightiest's full-sized avatar

Paul almightiest

View GitHub Profile
@kimono-koans
kimono-koans / gist:7641ee7bc7ce91f520b324bb08d699c8
Last active October 3, 2024 15:36
How I purged zsys and lived to tell the tale
You're going to need to snap your root according to zsys convention (just using a date won't work), like this:
#!/bin/bash
DATE_HASH="$( date | cksum | cut -f1 -d' ' | tr -d '\n' | xargs -0 printf '%x\n' )"
zfs snapshot -r bpool@snap_"$DATE_HASH"_prepApt
zfs snapshot rpool@snap_"$DATE_HASH"_prepApt
zfs snapshot -r rpool/ROOT@snap_"$DATE_HASH"_prepApt
zfs snapshot -r rpool/USERDATA@snap_"$DATE_HASH"_prepApt
@dadatuputi
dadatuputi / zfs_smart.sh
Last active January 11, 2025 15:42
Run SMART tests on a ZFS pool
#!/bin/bash
usage() { echo "Usage: $0 -p <POOL> (-s|-l)" 1>&2; exit 1; }
while getopts ":p:sl" o; do
case "${o}" in
p)
p=${OPTARG}
;;
s)