Skip to main content

Zfs

@randybias/zfsv2026.10.17.1beta· 14d agoBEHAVIORSACCEPTED WARNINGS
01README

Manage a ZFS pool, datasets, sparse zvols, snapshots, clones and rollback on a Linux host over SSH. One model type serves any host; state is keyed by the SSH identity plus the pool or dataset name, and create_pool refuses any device that carries the running system.

02Behaviors1
@randybias/zfsv2026.10.17.1zfs.ts
fn create_pool()
DESTRUCTIVE. Create a pool from the named vdevs, refusing any device that is mounted, named in /etc/fstab, or part of an md or ZFS array. Idempotent: an existing pool with the same vdev set is a no-op. Returns the pool, its vdevs and its GUID.
fn create_dataset()
Create a dataset, or set only the properties that differ when it already exists. Idempotent by property diff. Returns the dataset name and the properties changed.
fn create_zvol()
Create a sparse zvol of the given size. Idempotent: the same size is a no-op; a different existing size is refused. Returns the name, size and that it is sparse.
fn snapshot()
Create a snapshot dataset@tag. Idempotent: an existing snapshot is a no-op. Returns the full snapshot name and whether it was created.
fn clone()
Clone a snapshot to a new dataset or zvol. Idempotent: an existing clone of the same origin is a no-op; a different origin is refused. Returns the source and target.
fn rollback()
DESTRUCTIVE. Roll a dataset back to a snapshot. Refuses when later snapshots exist unless destroy_later_snapshots is set; with it, those snapshots are destroyed. Returns the snapshot and how many later snapshots were destroyed.
fn destroy()
DESTRUCTIVE. Destroy a dataset, zvol or snapshot. Idempotent: destroying an absent target is a clean no-op. Returns the target and whether it was destroyed.
fn destroy_pool()
DESTRUCTIVE. Destroy a pool and everything in it, refusing while datasets, zvols or snapshots exist unless recursive is set. Destroying an absent pool is a clean no-op. Returns the pool and whether it was destroyed.
fn export_pool()
DESTRUCTIVE. Export a pool so it can be imported on another host, refusing a pool that carries the running system. Idempotent: exporting an absent pool is a clean no-op. Returns the pool and whether it was exported.
fn get()
READ-ONLY. Report pool health and vdevs, datasets and snapshots for a pool, or a single dataset. Stores the observed state.
fn sync()
READ-ONLY. Compare recorded ZFS state with the live host and report drift, refreshing the stored state. Returns whether the record is in sync and each difference.

Resources

state(infinite)— Observed ZFS pool, dataset and snapshot state
03Stats
A
93 / 100
Downloads
2
Archive size
73.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned

05Platforms
06Labels