GithubHelp home page GithubHelp logo

twright42000 / libzetta-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inner-heaven/libzetta-rs

0.0 0.0 0.0 477 KB

Stable interface for programmatic administration of ZFS from Rust

License: BSD 2-Clause "Simplified" License

Rust 98.93% Nix 0.63% Just 0.44%

libzetta-rs's Introduction

Build Status codecov Crates.io Cirrus CI - Base Branch Build Status docs.rs license

libzetta-rs is a stable interface for programmatic administration of ZFS

Installation

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.

Usage

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.

FreeBSD

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
  • 13.0 (No CI setup for it)

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.

Linux

Verified on what is avaiable for Ubuntu 20.04 at the time of writting it's 0.8.3.

How it works

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.

Running tests

Vagrantfile has 3 VMS: ubuntu-20.04, FreeBSD 12 and FreeBSD 13 to use them:

  • Spin up either one of those
  • Install just
  • Run just test-ubuntu or just test-freebsd12 to run tests in the VM
  • To run a specific test run just 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.

Nix

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.

Current feature status

zpool

Create Destroy Get Properties Set Properties Scrub Export Import List Available Read Status Add vdev Replace Disk
open3 ✔¹
  1. Reads the status, but api isn't stable and does poor job at reporting scrubbing status.

zfs

Filesystem and ZVOL

Create Destroy List Get Properties Update Properties
open3
lzc ✔¹
  1. Might not have all properties available.

Snapshot and bookmark

Create Destroy List Get Properties Send Recv
open3
lzc ✔¹
  1. Might not have all properties available.

Alternatives

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.

LICENSE

BSD-2-Clause.

libzetta-rs's People

Contributors

andoriyu avatar candunc avatar dependabot-preview[bot] avatar dependabot[bot] avatar fabianfreyer avatar fossabot avatar ociaw avatar owenthewizard avatar richardstephens avatar s-burris avatar valpackett avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.