Files
seaweedfs/seaweed-block
..
2026-04-11 14:21:09 -07:00

Seaweed Block

tag CI Go License

Block storage for SeaweedFS, in two modes.

Seaweed Block gives a VM, sandbox or container a plain block device over NVMe/TCP or iSCSI. Either the disk lives on the host and its changed data is checkpointed to your SeaweedFS, or every write is copied to replicas on other hosts. Its first use case is agent workspaces: disks that must outlive the sandbox that uses them.

Quick start · Two modes · Architecture · Project status · Documentation

Two modes

Checkpointed local block Replicated network block
Status in v1.1.x Supported Preview, with known limits
Where the guest's disk is A local write-ahead log and extent on the host A primary on the guest's host, with replicas on other hosts
When fsync completes Once the data is on the host's local disk With sync-quorum or sync-all, once a quorum or every replica has it (the default best-effort waits for none)
What leaves the host The changed 4 MiB chunks, checkpointed to SeaweedFS in the background Every write, to the replicas
Snapshots, restore, planned moves Yes Not yet: the two modes cannot be combined in v1.1.x
After a host is lost An operator's forced move continues from the last checkpoint in SeaweedFS With --cluster-spec and the lifecycle loop enabled (--lifecycle-product-loop-interval, off by default), blockmaster fails a sync-quorum or sync-all volume over to a replica when its fencing round decides; the operator then starts the guest on the new primary's host. best-effort is not failed over automatically
Use it for Agent workspaces, sandboxes and VMs that need portable state Workloads that need online copies on other hosts
Checkpointed local block (supported). The guest writes over NVMe/TCP or iSCSI to blockvolume on the same host, which completes write and fsync on its local write-ahead log and extent. In the background, checkpoints send the changed 4 MiB chunks to SeaweedFS (master, filer and volume servers), which also holds the HEAD records. blockmaster issues epochs and leases to blockvolume. Snapshots, restore and planned moves use the chunks in SeaweedFS. Replicated network block (preview). The guest writes over NVMe/TCP or iSCSI to the primary blockvolume on its host. The primary sends every write to replica blockvolumes on other hosts; with sync-quorum or sync-all, fsync completes once a quorum or every replica has it. Each replica keeps a local store. blockmaster issues epochs, decides failover and names the new primary. No SeaweedFS is involved and there are no snapshots, restore or moves in this mode yet.

The two biggest limits of the replicated preview: a replica that falls behind the retained log needs a manual re-add, and a primary cut off from blockmaster is not stopped by a lease, so it may serve stale reads and, under best-effort, accept writes that are later lost. Do not use replicated volumes for data you cannot lose.

Agent workspaces

The first use case is the checkpointed mode: each agent sandbox or microVM gets its own disk on the host's local storage. Writes and fsync complete locally, and checkpoints, named snapshots and restores carry the workspace's state beyond that host.

Local disk Conventional network block storage Checkpointed local block
Where writes and fsync complete On the host Typically on a remote storage service On the host
Network in the I/O path No Typically, for every read and write No, for data on the host; a restored or moved volume fetches chunks on first read
If the host is lost The state is lost with it The volume typically survives The state survives up to its last confirmed checkpoint
Resume on another host Copy the data yourself Typically, detach the volume and attach it there Move the volume there, or restore a snapshot into a new volume there (placed by the cluster spec)
What persistence sends Nothing Typically every write, as it happens Only the whole 4 MiB chunks that changed, at each checkpoint
  1. Run. Start a volume on the host where the agent runs. The guest attaches it over NVMe/TCP or iSCSI, formats it with its own file system, and works at near-local speed.
  2. Checkpoint. The changed chunks go to your SeaweedFS: on demand (sw-block ops chunk cut), periodically (the holder's --chunk-capture-interval, 5 minutes or more), with the default daily snapshot, and when you stop the volume (sw-block volume stop).
  3. Snapshot. sw-block volume backup <volume> --name <name> (or sw-block ops chunk snapshot) names a point in time. Snapshots share chunks with each other.
  4. Restore. A restore makes a new volume from a snapshot, on the host that its placement in the cluster spec names. It serves at once and fetches chunks on first read.

The commands and what each needs: snapshots, restore and verification.

Also: AI coding agents whose repositories, dependencies and build caches must outlive the sandbox; long-running agents that stop, resume and move between hosts; and Kubernetes block volumes through the CSI driver (alpha).

Architecture

Process What it does Where it runs Talks to
blockmaster The control plane: epochs, leases, placement and failover. A single instance per cluster in v1.1.x, with no high availability; its authority and lifecycle records are local files. One host. Put its state directory on its own filesystem. blockvolume (heartbeats, leases, assignments), sw-block (control API), and in the checkpointed mode the SeaweedFS filer (HEAD records). There it needs a reachable filer to start.
blockvolume (the holder) Serves one volume to its guest over NVMe/TCP or iSCSI, from a write-ahead log and extent. In the checkpointed mode it checkpoints to SeaweedFS; in the replicated mode it sends writes to, or receives them from, the other replicas. On the host where the guest runs: one process per volume (and per replica). Its guest, blockmaster, SeaweedFS (checkpointed mode), the other replicas (replicated mode)
SeaweedFS: weed master, weed volume, weed filer Holds the checkpointed chunks and the HEAD records. Your SeaweedFS cluster. blockvolume, blockmaster and sw-block reach it over the network
sw-block The operator CLI: start and stop volumes, checkpoints, snapshots, restore, moves, checks. Wherever the operator works. blockmaster, each holder's status endpoint, the SeaweedFS filer

What each mode needs:

  • Checkpointed: blockmaster (with --workspace-rpc), one blockvolume per volume, and SeaweedFS. blockmaster contacts the filer only in this mode, and does not start until the filer answers.
  • Replicated: blockmaster and one blockvolume per replica, each on its own host. SeaweedFS is not used: blockmaster runs without --workspace-rpc and opens no filer connection.

In a standalone setup the guest runs on the holder's host: remote guests are not supported in v1.1.x. The Kubernetes CSI driver (alpha) attaches a volume to a pod on another node.

More: agent workspace design, volume lifecycle, the core design, and the TLA+ specifications of the protocols where a bug would lose data.

Performance

Time on Seaweed Block relative to a local disk, over NVMe/TCP loopback: npm ci 1.00, git clone 1.02, untar 100,000 files 1.04, cold find and stat 0.97, 2,000 create plus write plus fsync 1.52, guest fsync median 1.31.

Metadata-heavy agent work runs at local-disk speed, timing the operation itself (with the guest's final syncfs, 11-23% slower); fsync latency and fsync-bound work are 1.3 to 1.5 times local. These are lab runs of pre-release builds (the first four rows on the walstore engine, the last two on walstore-chunk) on Firecracker microVMs over NVMe/TCP loopback, median of 3: measurements, not SLOs. Every number and how it was measured, with the build where it was recorded: workspace measurements.

Quick start, explained

A trial of the checkpointed mode on a disposable Linux host, not for data you keep. You need nvme-cli, sudo for the connect step, and SeaweedFS's weed binary, tested with SeaweedFS 4.53 (from its release page, asset linux_amd64.tar.gz, which holds the one weed binary).

TAG=v1.1.2
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/$TAG/sw-block-$TAG-linux-amd64.tar.gz
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/$TAG/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS && tar -xzf sw-block-$TAG-linux-amd64.tar.gz
./blockvolume --version      # must print the tag's commit
./sw-block mini --dir ./swb-mini --weed /path/to/weed

What mini starts, as the standalone deployment describes:

  • weed mini: a one-process SeaweedFS (master, volume server and filer) that holds the checkpointed chunks.
  • blockmaster: the control plane.
  • One blockvolume: volume v1, 256 MiB, as walstore-chunk, on loopback.

It prints every command before it runs it, and each process logs to <dir>/<name>.log. It needs no sudo to start, and it never runs sudo itself.

What it prints for you: the nvme connect command that attaches v1, its status URL, and the next commands (snapshot, checks), each with the absolute paths of sw-block and weed. After the connect, sudo nvme list shows the disk's device (for example /dev/nvme0n1). Snapshots of v1 work at once, through the sw-block ops chunk snapshot command it prints. A restore into a new volume does not run inside mini yet; use the standalone setup for it. To stop: unmount v1, run the sudo nvme disconnect that mini printed, then press Ctrl-C. After a failed start, it prints the --reuse command that starts again on the same --dir.

From mini to a real deployment:

In mini In a deployment
weed mini Your SeaweedFS cluster: weed master, weed volume and weed filer
blockmaster The sw-blockmaster systemd unit, its state in /var/lib/sw-block-master on its own filesystem (why)
blockvolume for v1 One sw-blockvolume@<volume> unit per volume, started with sudo sw-block volume start
The loopback trial A cluster spec that names the hosts and the volumes' placements

Next:

Durability model

For the checkpointed mode:

Level Reached when Where the data is What it protects against
Local synced the guest's fsync returns the holder host's disk a crash or restart of the processes on that host
Remotely checkpointed a checkpoint is confirmed (after its commit in SeaweedFS) SeaweedFS the loss of the host: a forced move continues from the last confirmed checkpoint
Named snapshot a snapshot command answers ok SeaweedFS, kept by name a restore into a new volume at that point (in v1.1.x, not for a snapshot of a restored volume)
  • Writes since the last confirmed checkpoint are lost if the host is lost.
  • The default schedule is one snapshot a day. It is attempted, not guaranteed, and it is not a recovery-point objective. Periodic checkpoints (--chunk-capture-interval, 5 minutes or more) shorten the window. A persistent agent should checkpoint at its task boundaries.
  • sw-block volume stop takes a checkpoint by default (--no-cut skips it). A holder stopped any other way (systemctl stop, a kill, or the loss of its host) takes none.
  • No production SLO, RPO or RTO is claimed. Details: operator guide.

Project status

Capability v1.1.x
Checkpointed local volumes (walstore-chunk) Supported
NVMe/TCP and iSCSI Supported; in a standalone setup the guest runs on the holder's host
Incremental checkpoints Supported
Named snapshots and lazy restore into a new volume Supported
Planned moves between hosts (operator-run, fenced) Supported
Volumes up to 1 TiB Supported; above 256 GiB only at format level 1 (new clusters start at it; upgraded clusters run sw-block cluster finalize-format) and only after every host runs v1.1
Replicated volumes (replication_factor above 1) Preview: no snapshots, restore or moves; a replica that falls behind the retained log needs a manual re-add (limits)
Kubernetes CSI Alpha; in v1.1.x deleting a PVC may leave its volume behind, and that volume cannot be removed until v1.2
Remote guests in a standalone setup, authenticated remote NVMe/TCP Not in v1.1.x
Templates, instant fork Not in v1.1.x

Use tagged releases only: main is unreleased work. Each release's conditions are in the capabilities table and the release notes.

Vision

Directions, not commitments; no dates.

  • Lightweight execution: more volumes per host and less overhead per volume.
  • Instant workspaces: shared templates, fast creation, branching.
  • Continuous persistence: efficient rolling checkpoints.
  • Portable state: recovery, migration and resume across hosts with less operator work.
  • Storage efficiency: remote space that is reclaimed and reused, and rolling persistence with low write amplification.
  • Flexible durability: replicated volumes out of preview, and replicas combined with checkpoints and snapshots in SeaweedFS.

Documentation

To Read
Try it, run the services, restore a snapshot Standalone deployment
Install, upgrade, finalize, monitor, read typed errors Operations manual
Size a host, choose a recovery point, handle host loss Operator guide
Move, revoke, delete Volume lifecycle
Run on Kubernetes (alpha) Kubernetes quick start, Kubernetes status
See what each release supports Capabilities, release notes
Check the numbers Workspace measurements
Read the architecture and formal specifications Agent workspace design, core design, TLA+ specifications

Community and license

Questions and bug reports: GitHub Issues. To build and test: go build ./... && go vet ./... && go test -short ./... (the unit checks; CI also runs the process-level suite). Seaweed Block builds on SeaweedFS. License: Apache-2.0.