Skip to main content

ZFS pool + dataset operations

v0.1.17

Pool status, dataset inventory, snapshot listing, scrub status, ARC stats, plus operator surface for storage incident response: scrub start/stop, clear pool errors, take/destroy snapshots, dataset rollback.

9 allowed by default 3 need approval by default 1 denied by default
Pack ID
zfs
Vendor
emisar
OS
linux
Actions
13
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
zpool zfs

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install zfs --hash sha256:9f8a21f18197cb00a0a49c733ad6af68d651ced12bb3a43b78e83eef1f01b528

Setup

Operates on the ZFS pools of the local runner host — no credentials needed.

Host access

Run these commands yourself on the runner host. Emisar shows and copies setup recipes; it never runs them.

Change ZFS pool and dataset state as root.

zfs.start_scrubzfs.take_snapshotzfs.scrub_stopzfs.clear_pool_errorszfs.snapshot_destroyzfs.dataset_rollback

Run the Emisar service as root

Grant access
sudo install -d -m 0755 /etc/systemd/system/emisar.service.d
printf '%s\n' '[Service]' 'User=root' 'Group=root' | sudo tee /etc/systemd/system/emisar.service.d/10-zfs-host-access.conf >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart emisar
Verify access
test "$(systemctl show emisar --property=User --value)" = root

Impact: Every Emisar action on this runner executes as root. ZFS mutations can destroy snapshots, roll datasets back, or change pool recovery state.

Notes

  • Status/list/iostat reads work as any user that can run zpool/zfs.

Verify it works

Runs zfs.pool_list, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify zfs

Install and configure a pack walks through the whole sequence on a host.

Actions 13 total

View on GitHub
  • zfs.arc_stats exec low Low — read-only or trivially reversible

    /proc/spl/kstat/zfs/arcstats

    Show ARC cache statistics — size, hit ratio, eviction counts.

    View source on GitHub
  • zfs.clear_pool_errors exec high High — service-affecting

    zpool clear <pool> [device]

    Clear pool error counters and re-online any FAULTED device that has come back. Use after replacing a failed disk, or after a transient I/O storm cleared. Does NOT touch on-disk data.

    View source on GitHub
  • zfs.dataset_list exec low Low — read-only or trivially reversible

    zfs list

    List all datasets with used + avail + refer + mountpoint.

    View source on GitHub
  • zfs.dataset_rollback exec critical Critical — data loss or irreversible

    zfs rollback <dataset>@<snap>

    Roll a dataset back to an earlier snapshot. ALL changes after the snapshot are PERMANENTLY discarded. Intermediate snapshots between current and target are also destroyed (require -r flag). Use only after confirming current data is salvageable from elsewhere or the loss is acceptable.

    View source on GitHub
  • zfs.pool_iostat exec low Low — read-only or trivially reversible

    zpool iostat (5s sample)

    Show one 5-second iostat sample per pool.

    View source on GitHub
  • zfs.pool_list exec low Low — read-only or trivially reversible

    zpool list

    List all pools with size + alloc + free + fragmentation.

    View source on GitHub
  • zfs.pool_status exec low Low — read-only or trivially reversible

    zpool status -v

    Show per-pool vdev tree, scrub state, errors. Use to debug DEGRADED pools.

    View source on GitHub
  • zfs.properties exec low Low — read-only or trivially reversible

    zfs get all <dataset>

    List all properties of one dataset (compression, dedup, atime, quota, etc).

    View source on GitHub
  • zfs.scrub_stop exec medium Medium — changes state, easily reversible

    zpool scrub -s <pool>

    Stop an in-progress scrub. Use when scrub is impacting workload and the verification can wait for a maintenance window.

    View source on GitHub
  • zfs.snapshot_destroy exec high High — service-affecting

    zfs destroy <pool>/<dataset>@<snap>

    Delete one ZFS snapshot. Reclaims the snapshot-exclusive blocks immediately. Irreversible. Confirm the snapshot is not the only thing protecting against a recent ransomware/oops event before destroying.

    View source on GitHub
  • zfs.snapshot_list exec low Low — read-only or trivially reversible

    zfs list -t snapshot

    List all snapshots with used + refer + creation.

    View source on GitHub
  • zfs.start_scrub exec high High — service-affecting

    zpool scrub <pool>

    Start a scrub on one pool. Re-reads every block and verifies checksums.

    View source on GitHub
  • zfs.take_snapshot exec medium Medium — changes state, easily reversible

    zfs snapshot <dataset>@<name>

    Take an atomic snapshot of one dataset. Copy-on-write, instant.

    View source on GitHub