Skip to main content

Zfs

@bixu/zfsv2026.04.23.1· 1mo agoMODELS
01README

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

02Models1
@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
fn import(deviceDir?: string)
Import 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)
fn export(force: boolean)
Export 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)
fn sync()
Fetch pool status, dataset list, and snapshot list — safe for periodic launchd runs
fn snapshot(dataset?: string, name: string, recursive: boolean)
Create 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
fn autoSnapshot(prefix: string, datasets?: array, recursive: boolean)
Create 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
fn destroySnapshot(snapshot: string)
Destroy a specific ZFS snapshot
ArgumentTypeDescription
snapshotstringFull snapshot name including dataset (e.g. tank/data@daily-2026-04-01-09-00)
fn pruneSnapshots(dataset?: string, prefix: string, keepDays: number, keepCount: number, dryRun: boolean)
Destroy 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
fn scrub()
Start a ZFS pool scrub to verify data integrity
fn trim()
Start 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
03Previous Versions2
2026.02.27.5Feb 27, 2026
2026.02.27.4Feb 27, 2026
04Stats
A
100 / 100
Downloads
9
Archive size
16.2 KB
  • 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
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels