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:
- 12.1
Right now it verified works with 0.7.13
and entire 0.7.x
branch.
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.
Note that integration tests do a lot of zpool and zfs operations on live system. I recommend spin up a VM and use run_tests.sh
to run integration tests inside. Tests also take a lot of disk space because each vdev is at least 64mb file.
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 | ✔¹ | ✔ | ❌ | ❌ | ❌ |
- Might not have all properties available.
Create | Destroy | List | Get Properties | Send | Recv | |
---|---|---|---|---|---|---|
open3 | ❌ | ❌ | ✔ | ✔ | ❌ | ❌ |
lzc | ✔¹ | ✔ | ❌ | ❌ | ✔ | ❌ |
- Might not have all properties available.
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.