Skip to main content

@bixu/zfs

v2026.04.23.1

ZFS pool management for swamp — import/export pools, sync health status, snapshot datasets, prune retention, scrub, and TRIM

Repository

https://github.com/bixu/swamp-extensions

Labels

zfsstoragemacoslinux

Contents

Quality score

How well-documented and verifiable this extension is.

100%

Grade A

  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Has description1/1earned
  • At least one platform tag (or universal)1/1earned
  • Two or more platform tags (or universal)1/1earned
  • License declared1/1earned
  • Verified public repository2/2earned

Install

$ swamp extension pull @bixu/zfs

@bixu/zfsv2026.04.23.1zfs.ts

Global Arguments

ArgumentTypeDescription
pool?stringZFS pool name (e.g. tank). Required for sync, snapshot, scrub, and trim. Leave unset to import all discovered pools on attach.
zpoolBinstringPath to zpool binary
zfsBinstringPath to zfs binary
importImport ZFS pools from attached devices. Uses 'zpool import -a' when no pool is configured — designed for IOKit launchd triggers on device attach. If a pool requires forced import, a native macOS dialog is shown and the user must confirm before proceeding.
ArgumentTypeDescription
deviceDir?stringSearch for devices in this directory instead of the default (e.g. /dev)
exportExport the ZFS pool — unmounts all datasets and prepares drives for safe removal. Requires globalArguments.pool to be set.
ArgumentTypeDescription
forcebooleanForce export even if pool is busy (will terminate active I/O)
syncFetch pool status, dataset list, and snapshot list — safe for periodic launchd runs
snapshotCreate a ZFS snapshot
ArgumentTypeDescription
dataset?stringDataset to snapshot (e.g. tank/data). Omit to snapshot the pool root.
namestringSnapshot name (e.g. manual-2026-04-05). Will be suffixed to dataset@
recursivebooleanRecursively snapshot all descendant datasets
autoSnapshotCreate timestamped snapshots of all datasets in the pool — designed for scheduled launchd runs
ArgumentTypeDescription
prefixstringSnapshot name prefix (e.g. daily, hourly, weekly). Timestamp appended automatically.
datasets?arraySpecific datasets to snapshot (default: all filesystems in pool)
recursivebooleanRecursively snapshot each dataset's descendants
destroySnapshotDestroy a specific ZFS snapshot
ArgumentTypeDescription
snapshotstringFull snapshot name including dataset (e.g. tank/data@daily-2026-04-01-09-00)
pruneSnapshotsDestroy snapshots matching a prefix that are older than keepDays — designed for scheduled launchd retention runs
ArgumentTypeDescription
dataset?stringDataset to prune (e.g. tank/data). Omit for pool root.
prefixstringOnly prune snapshots whose name starts with this prefix (e.g. daily)
keepDaysnumberRetain snapshots newer than this many days; destroy older ones
keepCountnumberAlways keep at least this many matching snapshots regardless of age
dryRunbooleanList snapshots that would be destroyed without actually destroying them
scrubStart a ZFS pool scrub to verify data integrity
trimStart a ZFS pool TRIM to reclaim freed space on SSDs

Resources

status(infinite)— ZFS pool status, health, capacity, and device states
datasets(infinite)— ZFS datasets (filesystems and volumes) in the pool
snapshots(infinite)— ZFS snapshots in the pool
snapshotResult(7d)— Result of a snapshot create, destroy, or prune operation
scrubResult(7d)— Result of a scrub or trim operation
importResult(7d)— Result of a pool import or export operation