Skip to content

CLI Overview

Everything you do with flexBlock goes through the single flexblock binary. Each command moves a volume from one lifecycle state to the next, and each refuses with a specific exit code when the state it needs is missing.

flexblock [--ascii] [--log-level FILTER] [--grant-file PATH] <command> [flags]
flexblock --version

Global flags can appear before or after the command name.

FlagDefaultDescription
--ascii—Draw output in ASCII only, as a non-UTF-8 locale does.
--grant-file <PATH>/etc/flexblock/grant.jsonSigned license grant file.
-h, --help—Print help. --help gives the long form.
--log-level <FILTER>infoA level (trace, debug, info, warn, error, off), or a directive list such as flexblock=debug,aws_sdk_s3=warn.
-V, --version—Print the version.
CommandWhat it doesDevice accessNeeds a current grant
attach <DEVICE>Size a cache on this host’s device from the volume superblock and claim ownership. Nothing is bulk-copied.WriteNo
detach <DEVICE>Release ownership and clear local state. The volume’s data is left intact.WriteNo
initCreate a new, empty volume in object storage. Refuses a prefix that holds any key other than probe leftovers.Write, only with --attachYes
licensesList the open-source dependencies compiled in.NoneNo
reap <ID>...Remove leaked or stale ublk kernel devices by id.RootNo
show [DEVICE]Print device, volume, ownership and connection state. Lock-free, safe against a live daemon.ReadNo
start <DEVICE>Preflight, recover, rebuild the object index, bring up /dev/ublkbN and serve until interrupted. Also the crash-recovery command.Write, and rootNo (serves throttled)
update <DEVICE>Change device size, compression or encryption on the volume superblock, then locally. With no change, repairs a missing or stale volume superblock.WriteOnly for --device-size
wipe [DEVICE]Delete every object under the prefix and the local cache. Prompts.Write, when a device is givenNo

An expired grant still reaches the volume: start serves throttled, and attach, detach and wipe work. Only init and update --device-size need a current grant. See Licensing.

No command takes a bucket, prefix, endpoint or credentials. The volume’s provider, bucket and prefix always come from the grant, and credentials come from the provider’s standard chain (see Credentials).

  • Progress and outcome reports from state-changing commands go to stderr.
  • show and licenses write their output, prose or JSON, to stdout, so you can pipe or redirect it.
  • Every command exits with a documented exit code, so scripts and systemd can tell a transient failure from one that a retry will not fix.
  • Nearly every state-changing command needs root, so examples use sudo.

Sizes accept the suffixes K, M, G, T, P and E, optionally followed by B or iB. All are binary units, so 2T means 2 TiB.

Durations are a whole number followed by s, m, h or d, for example 5s, 4m, 24h or 7d.