Feature #3696
openwant a way to roll back a zfs clone to its origin
0%
Description
Sometimes, one would like a way to refer the the origin of a
cloned ZFS data set, i.e. for rollback or diff. If there were
perhaps a special name for the origin like ".origin" one could:
zfs diff pool/cloned-ws@.origin pool/cloned-ws zfs rollback pool/cloned-ws@.origin
Currently, the only way to do this rollback is to
destroy and re-create the clone.
Updated by Matthew Ahrens over 9 years ago
You can already do this with "zfs diff":
zfs diff pool/origin-fs@origin pool/clone
The rollback can be accomplished with the libzfs_core interface (lzc_rollback()), but there's no user interface. Perhaps we should expose the underlying primitive ("rollback to most recent snapshot") through the CLI. You could do "zfs rollback <fs|vol>" and it would roll back to the most recent snapshot (which could be the origin).
Updated by Andrey Kachalin about 6 years ago
You can rollback the clone using the following steps:
# promote clone to "move" snapshot to it zfs promote pool/clone-fs # rollback to that snapshot zfs rollback pool/clone-fs@origin # promote origin back zfs promote pool/origin-fs
Updated by Andriy Gapon over 5 years ago
Andrey Kachalin wrote:
You can rollback the clone using the following steps:
[...]
Or even simpler:
zfs destroy pool/clone-fs zfs clone pool/clone-fs pool/clone-fs@origin
But that's non-atomic, of course.
Still would be nice if zfs rollback supported this scenario.