zfs
Skill1 starsChanged 2 months agoMITView on GitHub
ZFS (OpenZFS) space efficiency and snapshotting for FreeBSD and Linux developers. Use when cloning datasets, creating build sandboxes, replicating storage, or writing Rust/C code that works with ZFS pools on macOS, FreeBSD, or Linux. Trigger phrases: "zfs snapshot", "zfs clone", "COW dataset", "zpool", "send/receive", "zfs dedup", "OpenZFS", "FreeBSD storage", "build rollback on ZFS". Covers: clone, snapshot, send/receive, dedup, Rust patterns, FreeBSD vs Linux differences.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jmagar/claude-homelabtheir own version, first seen Apr 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jmagar/claude-homelab★ 81same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ac-ideateSkill
- ac-listSkill
- ac-roadmapSkill
- almanacSkill
- ansible-fleetSkill
- apfsSkill
- a-teamSkill
- at-tuiSkill
- autoresearchSkill
- bop-brainstormSkill
- bop-onSkill
- bop-teamSkill
- bop-workflowSkill
- councilSkill
- datadog-backupSkill
- dd-tagsSkill
- deterministic-replaySkill
- dispatch-nuSkill
- durable-commitSkill
- elixir-gastown-opsSkill
- fleet-ircSkill
- ganttSkill
- irclaw-cluster-opsSkill
- irclaw-research-teamSkill
- jjSkill
- jobcard-systemSkill
- leptosSkill
- lower-bound-reviewSkill
- ollama-deploySkill
- preflightSkill
- providersSkill
- quota-gateSkill
- raspberry-piSkill
- redactSkill
- searxngSkill
- tiger-teamSkill
- toyota-waySkill
- translateSkill
- trizSkill
- unicode-glyphsSkill
- vibekanbanSkill
- zellijSkill
- zellij-teamSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 124
Only worth enabling when data has high block-level duplication (VM images, backups).
- Distinctive: line 125
NOT recommended for source code or build artifacts — too much RAM, little gain.
- Very specific: line 159
Use the zfs-sys crate if it exists for your OpenZFS version, otherwise shell out.
- Distinctive: line 205
Always enable compression on the pool or root dataset after creation:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ZFS — OpenZFS Reference
ZFS is the COW filesystem for FreeBSD (first-class, ships by default since FreeBSD 13) and available on Linux via OpenZFS (Ubuntu, Debian, Arch). Commands are identical across platforms — pool naming and device paths differ.
The core rule
On ZFS, the unit of COW cloning is a dataset (filesystem or volume), not a file. To clone a directory tree: snapshot the dataset, then clone the snapshot.
zfs snapshot pool/dataset@tag
zfs clone pool/dataset@tag pool/dataset-cloneClone is instant, zero space until divergence. This is the ZFS equivalent of cp -c on APFS.
Quick reference
| Operation | Command | Notes |
| Create snapshot | zfs snapshot pool/ds@name | Instant, space = changed blocks only |
| List snapshots | zfs list -t snapshot | |
| Clone snapshot | zfs clone pool/ds@snap pool/ds-clone | COW — zero space at creation |
| Rollback | zfs rollback pool/ds@snap | Destroys data after snapshot |
| Destroy clone/snap | zfs destroy pool/ds@snap | Clone must be destroyed first |
| Send (backup) | zfs send pool/ds@snap | zfs receive backup/ds | Stream to remote or file |
| Incremental send | zfs send -i pool/ds@prev pool/ds@now | zfs receive backup/ds | Delta only |
| Space usage | zfs list -o name,used,avail,refer | |
| Enable dedup | zfs set dedup=on pool/ds | Block-level; RAM-intensive |
| Enable compression | zfs set compression=lz4 pool/ds | Almost always worth enabling |
Snapshots for build isolation
# Before a risky migration
zfs snapshot pool/src@pre-migration-2026-03-07
# Something went wrong — roll back
zfs rollback pool/src@pre-migration-2026-03-07
# Done — clean up
zfs destroy pool/src@pre-migration-2026-03-07Snapshots consume space proportional to blocks changed after the snapshot, not the full dataset.
Dataset clones for test environments
# Snapshot the production dataset
zfs snapshot pool/prod@test-base
# Create a clone — writable, COW, instant
zfs clone pool/prod@test-base pool/test
# Use pool/test — all writes go to clone, prod is untouched
# Destroy when done (must destroy clone before its origin snapshot)
zfs destroy pool/test
zfs destroy pool/prod@test-baseSend/receive — replication
# Full send to remote
zfs send pool/ds@snap | ssh user@remote zfs receive backup/ds
# Incremental (only changed blocks since @prev)
zfs send -i pool/ds@prev pool/ds@now | ssh user@remote zfs receive -F backup/ds
# Send to a file
zfs send pool/ds@snap | gzip > ds-backup.gz
zfs send pool/ds@snap > ds-backup.zfs # raw, faster to restore
# Restore
zfs receive pool/ds < ds-backup.zfsCompression — always enable
zfs set compression=lz4 pool/dataset # fast, good ratio — default choice
zfs set compression=zstd pool/dataset # better ratio, slower — good for cold dataLZ4 compression typically saves 30–50% on source code and logs with near-zero CPU cost. Enable at dataset creation; only new writes are compressed.
Dedup — use carefully
zfs set dedup=on pool/datasetBlock-level deduplication. Requires ~5GB RAM per TB of data for the dedup table. Only worth enabling when data has high block-level duplication (VM images, backups). NOT recommended for source code or build artifacts — too much RAM, little gain.
Rust patterns
ZFS has no stable clonefile()-style syscall for userspace. Options:
1. Shell out (simplest, recommended for most cases):
use std::process::Command;
fn zfs_snapshot(dataset: &str, tag: &str) -> std::io::Result<()> {
let status = Command::new("zfs")
.args(["snapshot", &format!("{dataset}@{tag}")])
.status()?;
if status.success() { Ok(()) } else {
Err(std::io::Error::other("zfs snapshot failed"))
}
}
fn zfs_clone(origin: &str, tag: &str, clone: &str) -> std::io::Result<()> {
let snap = format!("{origin}@{tag}");
let status = Command::new("zfs")
.args(["clone", &snap, clone])
.status()?;
if status.success() { Ok(()) } else {
Err(std::io::Error::other("zfs clone failed"))
}
}2. libzfs FFI (advanced, avoids process overhead):
libzfs is available on FreeBSD and Linux but has no stable API — version-specific.
Use the zfs-sys crate if it exists for your OpenZFS version, otherwise shell out.
FreeBSD vs Linux differences
| Aspect | FreeBSD | Linux (OpenZFS) |
| Pool device naming | /dev/ada0, /dev/da0, /dev/gpt/label | /dev/sda, /dev/nvme0n1 |
| Import on boot | Automatic via /etc/rc.conf: zfs_enable="YES" | zpool import -a in initrd or systemd unit |
| Default pool name | zroot (installer default) | rpool (Ubuntu default) |
| ARC (cache) tuning | vfs.zfs.arc_max in /boot/loader.conf | zfs_arc_max in /etc/modprobe.d/zfs.conf |
| Encrypted root | Native ZFS encryption or GELI (FreeBSD) | Native ZFS encryption or LUKS |
zpool status | Identical | Identical |
zfs commands | Identical | Identical |
Space audit commands
zpool list # pool-level free/used
zfs list -o name,used,avail,refer # dataset breakdown
zfs list -t snapshot # all snapshots and their sizes
zpool iostat -v # I/O per vdev
zdb -b pool/dataset # block-level stats (verbose)Pools — bare minimum setup
# Single disk pool (development only — no redundancy)
zpool create mypool /dev/ada1
# Mirror (RAID-1 equivalent)
zpool create mypool mirror /dev/ada1 /dev/ada2
# Status
zpool status mypool
# Destroy (irreversible)
zpool destroy mypoolAlways enable compression on the pool or root dataset after creation:
zfs set compression=lz4 mypoolDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

