Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Z

ZeroFS

> 云原生
Open source

ZeroFS: A log-structured filesystem for S3. ZeroFS serves S3-compatible buckets as POSIX filesystems over NFS and 9P, or as raw block devices over NBD.

2.9K stars0 likes1 views
WebsiteGitHub

About

ZeroFS: A log-structured filesystem for S3. ZeroFS serves S3-compatible buckets as POSIX filesystems over NFS and 9P, or as raw block devices over NBD.

ZeroFS is a log-structured filesystem for S3

ZeroFS serves S3-compatible buckets as POSIX filesystems over NFS and 9P, and as raw block devices over NBD. All three servers run in a single userspace process. Data is compressed and encrypted before upload.

ZeroFS differentiates itself from other "filesystem on S3" projects by:

  • Being POSIX-conformant
  • Reaching near-raw-S3 throughput on large files, and scaling to workloads of hundreds of millions of small files
  • Handling tens of thousands of requests per second
  • Requiring no external database service (everything is stored on S3)
  • Being well tested (in CI we run pjdfstest, xfstests, kernel builds, stress-ng, ZFS, Jepsen local-fs, Jepsen HA, and more)
File access NFS and 9P servers. Use the native kernel client when DKMS can install it for the running kernel, or zerofs mount as a fallback.
Block access NBD devices with TRIM. FLUSH and FUA replies return only after data is durable.
Encryption Extents are encrypted with XChaCha20-Poly1305. Data key wrapped via Argon2id.
Compression zstd or lz4, before encryption. Codec changeable at any time without migration.
Caching Memory and disk tiers.
High availability Optional leader/standby over the same bucket for automatic failover.
Web UI File manager, dashboard, in-browser terminal.
Backends Amazon S3, Google Cloud Storage, Azure Blob, any S3-compatible store, local disk.

Quick Start

apt / dnf

bash
# Debian / Ubuntu
curl -fsSL https://pkgs.zerofs.net/zerofs.gpg | sudo gpg --dearmor -o /usr/share/keyrings/zerofs.gpg
echo "deb [signed-by=/usr/share/keyrings/zerofs.gpg] https://pkgs.zerofs.net/deb stable main" | sudo tee /etc/apt/sources.list.d/zerofs.list
sudo apt update && sudo apt install zerofs

# Fedora / RHEL / Rocky
curl -fsSL https://pkgs.zerofs.net/zerofs.repo | sudo tee /etc/yum.repos.d/zerofs.repo
sudo dnf install zerofs

Packages also install a systemd service (zerofs.service, disabled by default) and a config skeleton under /etc/zerofs/. Set ZEROFS_PASSWORD and credentials in /etc/zerofs/zerofs.env, the [storage] url in /etc/zerofs/config.toml, then sudo systemctl enable --now zerofs. Details: packaging/README.md.

Install script

bash
curl -sSfL https://sh.zerofs.net | sh

# Pin a release and install without root
curl -sSfL https://sh.zerofs.net | VERSION=v1.2.5 INSTALL_DIR=$HOME/.local/bin sh

Downloads the release tarball, verifies the published SHA-256 checksum, and installs the prebuilt binary: Linux (amd64, arm64), macOS (x86_64, aarch64), FreeBSD (amd64). Full matrix: quickstart.

Docker

bash
docker pull ghcr.io/barre/zerofs:latest

# Generate a starter config on the host ("-" writes to stdout)
docker run --rm ghcr.io/barre/zerofs:latest init - > zerofs.toml

$EDITOR zerofs.toml
docker run --rm -v "$PWD/zerofs.toml:/zerofs.toml" \
  ghcr.io/barre/zerofs:latest run -c /zerofs.toml

The container runs as UID 1001. A bind-mounted cache directory must be writable by UID 1001. To reach the servers from the host, bind addresses to 0.0.0.0 and map a port per enabled server: 2049 (NFS), 5564 (9P), 10809 (NBD).

Running

bash
zerofs init            # Generate zerofs.toml
$EDITOR zerofs.toml    # Set S3 credentials
zerofs run -c zerofs.toml

Native Linux kernel client

kernel/ contains an out-of-tree VFS module that speaks the private 9P2000.L.Z dialect over TCP or AF_UNIX, without FUSE or Linux v9fs. It supports x86-64 and little-endian arm64. See the native kernel client guide.

Testing

  • pjdfstest: 8,662 POSIX cases (pjdfstest_nfs), once per protocol: NFS, 9P, FUSE. Per-protocol exclude lists are in .github/.
  • xfstests: the standard filesystem regression suite, over NFS, 9P, and FUSE.
  • Kernel build: the Linux kernel compiles with make -j$(nproc) on NFS, 9P, and FUSE mounts.
  • stress-ng: file-handling stressors run concurrently against live mounts.
  • ZFS: a ZFS pool on ZeroFS block devices; kernel source extraction, then a scrub.
  • Jepsen local-fs: random operation histories against a 9P mount, checked against a reference model (local-fs). A crash mode kills the server mid-run and verifies recovery matches the last fsync.
  • Jepsen HA: a Connected leader/standby pair over SeaweedFS under a nemesis that kills or pauses nodes; no acknowledged write may be lost, resurrected, or corrupted across the tested failovers. The local-fs model checker also runs with failovers injected.
  • Deterministic simulation: data, namespace, segment-reclamation, and repack paths run in a simulated world (zerofs/tests/dst): virtual time, seeded storage latencies and transient faults, and crashes at arbitrary await points or narrow failpoint windows. Recovery is checked against byte-level and namespace reference models, a full metadata consistency scan, segment-accounting reconciliation, and an authoritative footprint scan. One seed is one exact schedule, so a failure reproduces identically.

Web UI

toml
[servers.webui]
addresses = ["127.0.0.1:8080"]
uid = 1000  # POSIX identity for file operations from the browser; required
gid = 1000  # Required

The file manager speaks 9P over WebSocket. Drag-and-drop uploads work, including entire folders.

The dashboard streams stats over gRPC-web, plus a file access tracer.

The terminal boots a Linux VM via v86, with the filesystem at /mnt over the same 9P WebSocket. The guest has no network device.

Architecture

The NFS, 9P, and NBD servers and the Web UI share a single filesystem layer. File contents are split into 32 KiB extents; each extent is compressed, encrypted, and packed as a frame into immutable segment objects (up to 256 MiB). Metadata (inodes, directory entries, and one 32-byte pointer per extent) lives in an LSM-tree database on the same object store. architecture documentation.

…

High Availability

A [replication] section runs a leader and a standby backed by the same bucket; there is no second durable copy of the data to provision. While Connected, the standby receives each mutation before the leader replies, including unflushed file frames. If replication is unavailable, the leader keeps serving in Solo mode with the standalone durability window. Takeover uses a durable phased claim and writer-epoch fencing before the successor serves. Design, guarantees, configuration, and multi-target clients: high availability.

Configuration

TOML with $VAR/${VAR} environment substitution; all referenced variables must be set. [cache], [storage], and [servers] are required. Full option reference: Configuration Guide.

…

Backends

toml
url = "s3://bucket/path"        # + [aws] credentials
url = "azure://container/path"  # + [azure] storage_account_name / storage_account_key
url = "gs://bucket/path"        # + [gcp] service_account, or ambient ADC on GCP VMs/GKE
url = "file:///path/to/storage" # Local disk; no credentials

Further schemes (s3a://, abfs://, host-routed https://, memory://): Configuration Guide.

ZeroFS requires conditional writes (put-if-not-exists) for fencing. AWS S3 supports this natively; for stores that don't, set conditional_put to a Redis URL.

An optional storage_class under [storage] is passed verbatim to the backend (S3 x-amz-storage-class, GCS x-goog-storage-class, Azure x-ms-access-tier). Use a hot, standard-access class: archive tiers render the volume unusable, and infrequent-access tiers charge retrieval on ZeroFS's constant reads, usually costing more.

Mounting

Over 9P, fsync returns only after data reaches stable storage; NFS COMMIT semantics let fsync return before that. If you depend on fsync durability, use a 9P-based mount.

Native kernel client

bash
sudo mount -t zerofs 127.0.0.1:5564 /mnt/zerofs
# Unix socket
sudo mount -t zerofs /tmp/zerofs.9p.sock /mnt/zerofs

Kernel-client packages, compatibility, and mount options: native kernel client.

zerofs mount (FUSE fallback)

bash
zerofs mount 127.0.0.1:5564 /mnt/zerofs        # TCP
zerofs mount /tmp/zerofs.9p.sock /mnt/zerofs   # Unix socket

Stock Linux v9fs

bash
mount -t 9p -o trans=tcp,port=5564,version=9p2000.L,cache=mmap,access=user 127.0.0.1 /mnt/9p
# Unix socket
mount -t 9p -o trans=unix,version=9p2000.L,cache=mmap,access=user /tmp/zerofs.9p.sock /mnt/9p

NFS

ZeroFS reports NFS writes as stable while they are buffered; tested clients (macOS, Linux) do not send COMMIT on fsync. Use a 9P mount where fsync durability matters.

bash
# macOS
mount -t nfs -o async,nolocks,rsize=1048576,wsize=1048576,tcp,port=2049,mountport=2049,hard 127.0.0.1:/ mnt
# Linux
mount -t nfs -o async,nolock,rsize=1048576,wsize=1048576,tcp,port=2049,mountport=2049,hard 127.0.0.1:/ /mnt

Mount options, persistent mounts, Windows: NFS access.

NBD Block Devices

Device files in a .nbd directory attach as raw block devices:

bash
# Create devices through any file mount
mkdir -p /mnt/zerofs/.nbd
truncate -s 1G /mnt/zerofs/.nbd/device1

# Connect (recommended: -persist, -timeout 600 for S3 latency, -connections 4)
nbd-client 127.0.0.1 10809 /dev/nbd0 -N device1 -persist -timeout 600 -connections 4
# Unix socket
nbd-client -unix /tmp/zerofs.nbd.sock /dev/nbd1 -N device1 -persist -timeout 600 -connections 4

mkfs.ext4 /dev/nbd0
# or
zpool create mypool /dev/nbd0

The handshake advertises FLUSH, FUA, and multi-connection support. FLUSH and FUA replies return only after data is durable, and a FLUSH on any connection covers all connections, so write barriers hold for ZFS pools and databases. Details: NBD devices.

New device files are picked up at runtime. Sizes are fixed at creation: to resize, disconnect, delete, and recreate. To remove a device, disconnect the client (nbd-client -d /dev/nbd0), then rm the file.

TRIM

bash
fstrim /mnt/block                    # Manual
mount -o discard /dev/nbd0 /mnt/block  # Automatic (filesystems)
zpool set autotrim=on mypool         # Automatic (ZFS)

TRIM deletes extent pointers and debits each segment's live-byte counter; segment reclamation deletes dead segments and repacks fragmented ones, reclaiming the space in S

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust9p9p2000block-storagecloud-storage

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category云原生
PricingOpen source

> Related tools

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,