Package: zfs-clone-manager
ZFS Clone ManagerTool to add version control and historic data of a directory with ZFS. The functionality is similar to Solaris beadm but generalized for any ZFS filesystem, not just ROOT and VAR.The suggested workflow is:Initialize a manager (zcm init)Make changes in active cloneCreate new clone (zcm clone)Make changes in new cloneActivate new clone (zcm activate)[Remove older clones (zcm rm)]Go to step 2UsageInitialize a ZCM manager$zcminitrpool/directory/directory
ZCMinitializedZFSrpool/directoryatpath/directory"rpool/directory" -> root of the ZFS for clones and snapshots.
"/directory" -> path of the filesystem (mountpoint of the active clone).Show ZCM information$zcminfo/directory
Path:/directory
RootZFS:rpool/directory
RootZFSsize:63.00KB
Totalclonecount:1Olderclonecount:0Newerclonecount:0OldestcloneID:00000000ActivecloneID:00000000NewestcloneID:00000000NextcloneID:00000001$zcmls/directory
MANAGERAIDCLONEMOUNTPOINTORIGINDATESIZErpool/directory00000001rpool/directory/00000000/directory2021-02-1610:46:5932.00KBCreate new clones (derived from active)$zcmclone/directory
Createdclone00000001atpath/directory/.clones/00000001
$zcmclone/directory
Createdclone00000002atpath/directory/.clones/00000002
$zcmls/directory
MANAGERAIDCLONEMOUNTPOINTORIGINDATESIZErpool/directory*00000000rpool/directory/00000000/directory2021-02-2006:51:1432.00KB
rpool/directory00000001rpool/directory/00000001/directory/.clones/00000001000000002021-02-2006:57:0118.00KB
rpool/directory00000002rpool/directory/00000002/directory/.clones/00000002000000002021-02-2006:57:0218.00KBActivate the previously created clone, mounting it at ZCM path$zcmactivate/directory00000002Activatedclone00000002The activate command can not be executed from inside the path, therefore the parameter -p  is mandatory.All the clones are visible at /.clones$ls/directory/.clones00000000000000100000002Show differences of a clone from it's origin$mkdir/directory/tmp
$mkfile10m/directory/tmp/file
$zcmdiff/directory
MOUNTPOINTDATECHANGEFILEFILE_TYPE
/directory2021-02-2206:19:34.094470Modified.directory
/directory2021-02-2206:21:07.236145Addedtmpdirectory
/directory2021-02-2206:21:07.309059Addedtmp/filefileRemove clones$zcmrm/directory00000001WARNING!!!!!!!!
Allthefilesystems,snapshotsanddirectoriesassociatedwithclone00000001willbepermanentlydeleted.
Thisoperationisnotreversible.
Doyouwanttoproceed?(yes/NO)yes
Removedclone00000001Destroy ZCM related dataThis is dangerous, you should backup data first.$zcmdestroy/directory
WARNING!!!!!!!!
Allthefilesystems,clones,snapshotsanddirectoriesassociatedwithrpool/directorywillbepermanentlydeleted.
Thisoperationisnotreversible.
Doyouwanttoproceed?(yes/NO)yes
DestroyedZCMrpool/directoryInitialize a ZCM manager based on an existing directory:$zcmls/directory
ThereisnoZCMmanagerat/directory
$mkdir-p/directory/tmp
$mkfile10m/directory/tmp/file
$zcminit-Mrpool/directory/directory
ZCMinitializedZFSrpool/directoryatpath/directory
$zcmlsrpool/directory
MANAGERAIDCLONEMOUNTPOINTORIGINDATESIZErpool/directory*00000000rpool/directory/00000000/directory2021-02-2213:37:2810.04MB
$ls/directory
.clones/tmp/$ls/directory/tmp
fileInitialize a ZCM manager based on an existing ZFS:$zfscreate-omountpoint=/directoryrpool/directory
$mkdir/directory/tmp
$mkfile10m/directory/tmp/file
$zcminit-mrpool/directory/directory
ZCMinitializedZFSrpool/directoryatpath/directory
$zcmlsrpool/directory
MANAGERAIDCLONEMOUNTPOINTORIGINDATESIZErpool/directory*00000000rpool/directory/00000000/directory2021-02-2213:39:4310.04MB
$ls/directorytmp
$ls/directory/tmp
file