Crates.io | libzetta |
lib.rs | libzetta |
version | 0.5.0 |
source | src |
created_at | 2019-08-12 05:44:05.456822 |
updated_at | 2023-05-13 00:52:26.624476 |
description | libzetta is a stable interface for programmatic administration of ZFS |
homepage | |
repository | https://github.com/Inner-Heaven/libzetta-rs |
max_upload_size | |
id | 156048 |
size | 375,153 |
libzetta-rs is a stable interface for programmatic administration of ZFS
Not yet. It won't break your pool or kill your brother, but API might change. Wait until 1.0.0. I have a pretty decent roadmap to 1.0.0.
Public API for zpool
stable. Public API for zfs
might change after I actually get to use it in other projects. Consult the documention on usage.
This library focused on FreeBSD support. This should work on any FreeBSD version since 9.2. No intention on supporting legacy versions. Supported versions:
NOTE: FreeBSD 13.0 borked libzfs_core
dependencies. Until it's fixed solution is to use LD_PRELOAD
to load libzfs_core
from ports.
NOTE: Since FreeBSD switched to OpenZFS, support for "legacy" will be dropped at first breakage.
Verified on what is avaiable for Ubuntu 20.04 at the time of writting it's 0.8.3
.
ZFS doesn't have stable API at all.libzfs_core
(lzc
) fills some gaps, but not entirely. While lzc
provides stable APi to some features of zfs, there is no such thing for zpool. This library resorts to zfs(8)
and zpool(8)
where lzc
falls shorts.
Vagrantfile
has 3 VMS: ubuntu-20.04, FreeBSD 12 and FreeBSD 13 to use them:
just
just test-ubuntu
or just test-freebsd12
to run tests in the VMjust test-ubuntu "-- easy_snapshot_and_bookmark"
NOTE: Integration tests must be run as a root. Zpools and datasets will be created/modified/destroyed. If it wipes your system datasets that's on you for running it outside of VM.
Project is nix-flake enabled, but it flake itself isn't enough: you need to provide libzfs_core
and its dependencies yourself. This is on-purpose.
Create | Destroy | Get Properties | Set Properties | Scrub | Export | Import | List Available | Read Status | Add vdev | Replace Disk | |
---|---|---|---|---|---|---|---|---|---|---|---|
open3 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔¹ | ✔ | ✔ |
Reads the status, but api isn't stable and does poor job at reporting scrubbing status.
Create | Destroy | List | Get Properties | Update Properties | |
---|---|---|---|---|---|
open3 | ❌ | ❌ | ✔ | ✔ | ❌ |
lzc | ✔¹ | ✔ | ❌ | ❌ | ❌ |
Create | Destroy | List | Get Properties | Send | Recv | |
---|---|---|---|---|---|---|
open3 | ❌ | ❌ | ✔ | ✔ | ❌ | ❌ |
lzc | ✔¹ | ✔ | ❌ | ❌ | ✔ | ❌ |
Unlike them LibZetta doesn't link against private libraries of ZFS. libzetta
also has more documention.
LibZetta has zpool APIs. LibZetta shares -sys
crates with this library. LibZetta also will delegate certain features of zfs(8)
to open3 implementation.