Tool to manage ZFS clones with history metadata
Project description
ZFS Clone Manager
Tool 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 clone
- Create new clone (zcm clone)
- Make changes in new clone
- Activate new clone (zcm activate)
- [Remove older clones (zcm rm)]
- Go to step 2
Usage
-
Initialize a ZCM manager
$ zcm init rpool/directory /directory ZCM initialized ZFS rpool/directory at path /directory
"rpool/directory" -> root of the ZFS for clones and snapshots. "/directory" -> path of the filesystem (mountpoint of the active clone).
-
Show ZCM information
$ zcm info /directory Path: /directory Root ZFS: rpool/directory Root ZFS size: 63.00 KB Total clone count: 1 Older clone count: 0 Newer clone count: 0 Oldest clone ID: 00000000 Active clone ID: 00000000 Newest clone ID: 00000000 Next clone ID: 00000001 $ zcm ls /directory MANAGER A ID CLONE MOUNTPOINT ORIGIN DATE SIZE rpool/directory 00000001 rpool/directory/00000000 /directory 2021-02-16 10:46:59 32.00 KB
-
Create new clones (derived from active)
$ zcm clone /directory Created clone 00000001 at path /directory/.clones/00000001 $ zcm clone /directory Created clone 00000002 at path /directory/.clones/00000002 $ zcm ls /directory MANAGER A ID CLONE MOUNTPOINT ORIGIN DATE SIZE rpool/directory * 00000000 rpool/directory/00000000 /directory 2021-02-20 06:51:14 32.00 KB rpool/directory 00000001 rpool/directory/00000001 /directory/.clones/00000001 00000000 2021-02-20 06:57:01 18.00 KB rpool/directory 00000002 rpool/directory/00000002 /directory/.clones/00000002 00000000 2021-02-20 06:57:02 18.00 KB
-
Activate the previously created clone, mounting it at ZCM path
$ zcm activate /directory 00000002 Activated clone 00000002
The activate command can not be executed from inside the path, therefore the parameter -p
-
All the clones are visible at
$ ls /directory/.clones 0000000 00000001 00000002
-
Show differences of a clone from it's origin
$ mkdir /directory/tmp $ mkfile 10m /directory/tmp/file $ zcm diff /directory MOUNTPOINT DATE CHANGE FILE FILE_TYPE /directory 2021-02-22 06:19:34.094470 Modified . directory /directory 2021-02-22 06:21:07.236145 Added tmp directory /directory 2021-02-22 06:21:07.309059 Added tmp/file file
-
Remove clones
$ zcm rm /directory 00000001 WARNING!!!!!!!! All the filesystems, snapshots and directories associated with clone 00000001 will be permanently deleted. This operation is not reversible. Do you want to proceed? (yes/NO) yes Removed clone 00000001
-
Destroy ZCM related data
This is dangerous, you should backup data first.
$ zcm destroy /directory WARNING!!!!!!!! All the filesystems, clones, snapshots and directories associated with rpool/directory will be permanently deleted. This operation is not reversible. Do you want to proceed? (yes/NO) yes Destroyed ZCM rpool/directory
-
Initialize a ZCM manager based on an existing directory:
$ zcm ls /directory There is no ZCM manager at /directory $ mkdir -p /directory/tmp $ mkfile 10m /directory/tmp/file $ zcm init -M rpool/directory /directory ZCM initialized ZFS rpool/directory at path /directory $ zcm ls rpool/directory MANAGER A ID CLONE MOUNTPOINT ORIGIN DATE SIZE rpool/directory * 00000000 rpool/directory/00000000 /directory 2021-02-22 13:37:28 10.04 MB $ ls /directory .clones/ tmp/ $ ls /directory/tmp file
-
Initialize a ZCM manager based on an existing ZFS:
$ zfs create -o mountpoint=/directory rpool/directory $ mkdir /directory/tmp $ mkfile 10m /directory/tmp/file $ zcm init -m rpool/directory /directory ZCM initialized ZFS rpool/directory at path /directory $ zcm ls rpool/directory MANAGER A ID CLONE MOUNTPOINT ORIGIN DATE SIZE rpool/directory * 00000000 rpool/directory/00000000 /directory 2021-02-22 13:39:43 10.04 MB $ ls /directory tmp $ ls /directory/tmp file
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zfs-clone-manager-3.4.0.tar.gz.
File metadata
- Download URL: zfs-clone-manager-3.4.0.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b558c7c3a42fb361b6b39257c81ae50e971d97d49bf3159a004ae3d269eef713
|
|
| MD5 |
12a050b018a1094c2f05f7ed227e2d89
|
|
| BLAKE2b-256 |
d67946f0861aa054119062c7f913b7b3317f30b264aa80ce6a272abc18d5cccb
|