zfs
ZFS filesystem administration, pool management, dataset configuration, snapshots, replication, encryption, performance tuning, and troubleshooting on OpenZFS (Linux and macOS). Use when the user asks to: create or manage ZFS pools, configure ZFS datasets and properties, set up snapshots or replication (zfs send/recv), tune ZFS performance (ARC, recordsize, compression, special vdevs), troubleshoot degraded/faulted pools or scrub errors, set up ZFS encryption, plan storage architecture with ZFS, or any other ZFS/zpool/zfs administration task.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/mightybyte/zfsZFS Administration
Critical: No File-Backed Pools in Production
NEVER recommend file-backed (loopback) pools for production use. LLMs commonly default to truncate -s 10G /tmp/disk.img + zpool create tank /tmp/disk.img because it is easy to demonstrate. This forfeits ZFS self-healing, I/O performance, and write reliability.
File-backed pools are acceptable ONLY for learning or CI testing. When not explicitly in a testing context, always use real block devices:
# Linux — always use /dev/disk/by-id/ for stable names
zpool create tank mirror \
/dev/disk/by-id/scsi-SATA_WDC_WD40EFRX_WD-WCC4E1234567 \
/dev/disk/by-id/scsi-SATA_WDC_WD40EFRX_WD-WCC4E7654321
# macOS
zpool create tank mirror /dev/disk2 /dev/disk3
If the user explicitly asks for a test/demo setup, file-backed pools are fine — but add a comment noting it is not for production.
Pool Management
Create Pools
Always specify ashift=12 (or 13 for some NVMe) to match physical sector size:
# Mirror (2-disk, 50% usable, best performance)
zpool create -o ashift=12 tank mirror /dev/disk/by-id/disk1 /dev/disk/by-id/disk2
# raidz2 (minimum recommended for production data)
zpool create -o ashift=12 tank raidz2 \
/dev/disk/by-id/disk{1..6}
# Multiple vdevs (better performance than single wide vdev)
zpool create -o ashift=12 tank \
mirror /dev/disk/by-id/disk1 /dev/disk/by-id/disk2 \
mirror /dev/disk/by-id/disk3 /dev/disk/by-id/disk4
Expand and Modify
# Add vdev (cannot be undone — plan carefully)
zpool add tank mirror /dev/disk/by-id/new1 /dev/disk/by-id/new2
# Replace disk (starts resilver)
zpool replace tank /dev/disk/by-id/old /dev/disk/by-id/new
# Add cache (L2ARC), log (SLOG), or special vdev
zpool add tank cache /dev/disk/by-id/nvme-cache
zpool add tank log mirror /dev/disk/by-id/nvme-log1 /dev/disk/by-id/nvme-log2
zpool add tank special mirror /dev/disk/by-id/nvme-special1 /dev/disk/by-id/nvme-special2
Dataset Management
Create with Recommended Defaults
# Always set compression. Inherit from parent when possible.
zfs set compression=lz4 tank
zfs set atime=off tank
zfs set xattr=sa tank # Linux only — faster extended attributes
# Create dataset hierarchy
zfs create tank/data
zfs create -o recordsize=8K tank/data/postgres
zfs create -o recordsize=1M tank/data/media
zfs create -o recordsize=1M tank/data/backups
Encryption
# Create encrypted dataset (cannot encrypt existing data)
zfs create -o encryption=aes-256-gcm -o keyformat=passphrase tank/secure
# Key from file (for automation)
zfs create -o encryption=aes-256-gcm -o keyformat=raw \
-o keylocation=file:///etc/zfs/keys/tank-secure.key tank/secure
# Load/unload keys
zfs load-key tank/secure
zfs unload-key tank/secure
Snapshots
# Create
zfs snapshot tank/data@daily_$(date +%Y-%m-%d)
zfs snapshot -r tank@daily_$(date +%Y-%m-%d) # recursive
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-mightybyte-zfs": {
"enabled": true,
"auto_update": true
}
}
}