Open Source › LamBoot filesystem crates › lamzfs
lamzfs
Read-only ZFS pools (single disk, mirror, RAID-Z1) for root-on-ZFS boot pools.
forbid(unsafe_code)
|
No required dependencies
What lamzfs is for
lamzfs imports a ZFS pool over a plain byte source, walks to one dataset and reads its files: enough for a bootloader to find a kernel and initramfs without the OpenZFS kernel module, without std, and without a GPL UEFI driver. The motivating target is Ubuntu and Debian root-on-ZFS, which keep a simple bpool boot pool.
Read-only by construction: There's no write path and no BlockWrite. Every layout it doesn't read fails with a typed error and a stable token, never a wrong read.
Basis: The on-disk decoders are vendored from rzfs, electing the MIT half of its GPL-2.0 OR MIT license: a clean-room reader, not GPL kernel or userspace source. Pool import, vdev routing, the feature gate and the dataset walk are new lamzfs code, also available under Apache-2.0.
Add it to your crate
[dependencies]
lamzfs = "0.1"
Or cargo add lamzfs. On Debian unstable or testing, the packaged crate is librust-lamzfs-dev (rust-lamzfs).
Usage
use lamzfs::{BlockRead, PoolMember, Zfs};
let mut zfs = Zfs::import(members())?; // one PoolMember per vdev member
for entry in zfs.read_dir(&["BOOT", "default"], &[])? { /* ... */ }
let kernel = zfs.read(&["BOOT", "default"], &["vmlinuz"])?;
The full API, with every type and error, is on docs.rs.
What it reads
| Feature | Status |
|---|---|
| One top-level vdev: a single disk, a mirror or RAID-Z1 | Read, including degraded RAID-Z1 reads rebuilt from parity |
| Uberblock selection | From all four labels of every member, so a stale mirror member can't win |
| Pools as installers create them | Proxmox VE (every feature on), Ubuntu's bpool and rpool with dnodesize=auto, xattr=sa, posixacl and formD |
| Compression | off, zle, lzjb, lz4, gzip and zstd |
| Checksums | Fletcher-2/4, SHA-256, SHA-512/256 and salted BLAKE3 |
| The read walk | Label, uberblock, MOS, DSL, dataset, ZPL, micro and fat ZAP, long names, large dnodes and blocks, sparse files |
What it refuses
- Read features it doesn't implement: raidz_expansion, device_removal, draid, dynamic_gang_header, redacted datasets, and any unknown feature
- Several top-level vdevs (a stripe such as Proxmox's RAID0, or log and special vdevs)
- RAID-Z2, RAID-Z3, dRAID, gang blocks and encrypted datasets (an unencrypted /boot beside them still reads)
- Skein and Edon-R checksums
Each has a stable error token (Error::token).
What it depends on, and what it doesn't
Avoids: The OpenZFS kernel module, a GPL UEFI driver and std. With its features off it has no dependencies; lzjb and mirror support are its own code.
Always
None. lamzfs builds with no required dependencies.
Only with a feature
- lz4_flex 0.13, with
lz4 - ruzstd 0.9.1, with
zstd - miniz_oxide 0.9, with
gzip - sha2 0.11, with
sha512 - blake3 1.8.2, with
blake3
Cargo features
| Feature | Default | What it adds |
|---|---|---|
| lz4, zstd, gzip, lzjb | Yes | Each compression algorithm |
| mirror | Yes | Mirror topologies |
| sha512 | Yes | SHA-512/256 checksums through sha2 |
| blake3 | Yes | BLAKE3 checksums, portable Rust |
| std | No | An std::error::Error impl for Error |
How it's tested
Fixtures are real pools OpenZFS wrote through its kernel module, so every file must hash to what the kernel wrote and every refused layout must fail with its token; three fuzz targets.
No GPL drivers in the boot path
Until 2026 LamBoot read most Linux filesystems through about a dozen prebuilt UEFI filesystem driver binaries from the EfiFs (GPL-3.0) and rEFInd (GPL-2.0) projects. Three things ruled them out at once. Debian's free-software guidelines and Fedora's packaging rules reject a prebuilt .efi blob that isn't built from source in the archive. Microsoft doesn't sign GPLv3 code for Secure Boot, and loading a separate UEFI driver binary removes the ShimLock protocol that shim 15.8 relies on. And GPL binaries sit badly beside a permissively licensed loader. These crates replace those drivers with readers compiled into LamBoot itself. The whole family · LamBoot
The other disk filesystem readers
Read-only media formats (lamfold): lamfold · lamfold-iso · lamfold-udf · lamfold-squash · lamfold-erofs · lamfold-cramfs · lamfold-romfs · lamfold-cpio