% zelta-revert(8) | System Manager's Manual
NAME¶
zelta revert - rewind a ZFS dataset tree in place by renaming and cloning
SYNOPSIS¶
zelta revert [OPTIONS] endpoint[@snapshot]
DESCRIPTION¶
zelta revert rewinds a dataset to a previous snapshot state by renaming the current dataset and creating a clone from the specified snapshot. This technique is a non-destructive alternative to zfs rollback, preserving the current state for forensic analysis, testing, or recovery scenarios.
As with other Zelta commands, zelta revert works recursively on a dataset tree. The endpoint may be local or remote via ssh(1).
After reverting, the original dataset remains accessible under a new name, allowing you to examine both the reverted state and the preserved current state.
Before renaming anything, Zelta checks that every dataset in the tree is included in the revert plan and has its selected snapshot. If a child was created after the requested snapshot, lacks a snapshot, or is excluded by a filter or depth limit, the entire revert is rejected. Revert eligible child endpoints individually instead of rewinding a mixed-snapshot tree.
Revert Process¶
zelta revert performs these operations:
- Snapshot Selection: If a
@snapshotname is specified at the end of the endpoint, that snapshot is used. Otherwise, the most recent snapshot is selected. - Dataset Preservation: The target dataset is renamed by appending the snapshot name. For example,
pool/dsreverted to snapshot@yesterdaybecomespool/ds_yesterday. Note that no properties, including mountpoint and readonly status, are altered. - Clone Creation: For each child dataset, Zelta creates a clone from the selected snapshot at the original dataset path.
Remote endpoint names follow scp(1) conventions. Dataset names follow zfs(8) naming conventions.
Examples:
Local: pool/dataset
Local: pool/dataset@snapshot
Remote: user@example.com:pool/dataset
Remote: user@example.com:pool/dataset@snapshot
OPTIONS¶
Endpoint Argument (Required)
- endpoint
- The endpoint name to revert, optionally specifying a snapshot. If no snapshot is specified, the most recent snapshot is used.
Output Options
- -v, --verbose
- Increase verbosity. Specify once for operational detail, twice (
-vv) for debug output. - -q, --quiet
- Decrease log level. Specify once to suppress notices, twice (
-qq) to suppress warnings. - -n, --dryrun, --dry-run
- Display
zfscommands without executing them.
Revert Safety Override
- -f, --force
- Skip the whole-tree preflight and attempt a best-effort revert. Clone failures do not stop unaffected siblings. A dataset without a source snapshot is skipped; descendants of any failed or skipped parent are also skipped rather than creating empty replacement parents. The original tree is preserved in full, including every failed or skipped dataset. Zelta reports those paths and the preserved-tree location, and exits non-zero if the result is incomplete. It does not snapshot an incomplete result or recommend rotating it. This option never overwrites datasets or forces a receive. Dry runs also require this option to display an otherwise blocked plan; execution may reveal failures a dry run cannot predict.
EXAMPLES¶
Revert a dataset to its most recent snapshot to investigate a bug while preserving the current state:
zelta revert sink/source
The current dataset is renamed to sink/source_<snapshot> and a clone is created at the original path.
Revert a remote dataset to a specific snapshot:
zelta revert production-host.example:sink/dataset@2025-12-31
After reverting a source dataset, rotate its backup targets to restore sync continuity:
zelta revert sink/source/dataset
zelta rotate sink/source/dataset backup-host.example:tank/target/dataset
The original diverged datasets remain accessible as sink/source/dataset_<snapshot> and tank/target/dataset_<snapshot>.
EXIT STATUS¶
Returns 0 on success, non-zero on error. A forced best-effort revert also returns non-zero if any selected dataset failed or was skipped, even when other datasets were restored successfully. Inspect the reported paths before continuing a workflow that replaces intentionally omitted children.
NOTES¶
See zelta-options(7) for environment variables, zelta.env configuration, and zelta policy integration.
SEE ALSO¶
zelta(8), zelta-options(7), zelta-match(8), zelta-backup(8), zelta-policy(8), zelta-clone(8), zelta-rotate(8), ssh(1), zfs(8)
AUTHORS¶
Daniel J. Bell _bellhyve@zelta.space_
WWW¶
https://zelta.space