A basic NBD block server with a single gimmick
  • Rust 72.7%
  • Nix 27.3%
Find a file
2025-06-02 22:48:47 +02:00
.forgejo/workflows workflow updates 2025-06-02 22:48:47 +02:00
nix flake update 2025-06-02 22:46:29 +02:00
src error improvements 2023-09-02 17:12:11 +02:00
.envrc flake 2023-02-19 17:32:44 +01:00
.gitignore flake 2023-02-19 17:32:44 +01:00
Cargo.lock cargo updates 2024-02-12 21:44:46 +01:00
Cargo.toml cargo updates 2024-02-12 21:44:46 +01:00
config.sample.toml initial version 2023-02-19 16:35:01 +01:00
flake.lock flake update 2025-06-02 22:46:29 +02:00
flake.nix flake update 2025-06-02 22:46:29 +02:00
README.md fmt 2025-06-02 22:46:33 +02:00

Cube

What

A basic NBD block server with a single gimmick.

Why

The main reason for using this over any other NBD server is its ability to reload the config without affecting any existing connection.

This allows for booting a device off an NBD device and changing the export configuration to point to a new root image. Without affecting the booted devices. Then, when the device is rebooted, it will connect to the new root image.

How

Create a config file config.toml

[listen]
port = 10809

[exports]
main = { path = "./src/main.rs", readonly = true }
block = "/tmp/block.bin"

Run the server with

cube -c config.toml

When the configuration is changed, it can be reloaded by sending SIGHUP to the server.

pkill -sighup cube