| title | pg hardstorage capacity preflight | ||
|---|---|---|---|
| description | CLI reference for the pg hardstorage capacity preflight command. | ||
| tags |
|
Check whether the repo has free space for a projected backup
preflight asks "would a backup of N bytes succeed against this repo's current free space?" and returns a structured verdict.
Three verdicts:
pass free space ≥ projected × safety_factor insufficient_space free space < projected × safety_factor unsupported backend can't probe (object stores; silent pass — the operator's quota is out-of-band)
Projection modes:
--projected-bytes N explicit byte count --from-deployment NAME use the deployment's latest committed manifest's logical bytes (the natural default for "will my next backup fit?")
Pre-flight is fail-open on a probe failure (statfs returning an error) — a flaky probe shouldn't refuse an otherwise-OK backup. The structured verdict surfaces the probe error in Note when relevant.
pg_hardstorage capacity preflight <repo> [flags]
--from-deployment string derive projected size from the deployment's latest committed manifest (logical bytes)
-h, --help help for preflight
--projected-bytes int explicit projected backup size in bytes (mutually exclusive with --from-deployment)
--repo string repository URL — must already exist (positional <repo> also accepted)
--safety-factor float multiplier on projected size for the required-free-space threshold (default 1.1 = 110%) (default 1.1)
--airgapped airgapped: strict refuse outbound endpoints (LLM providers, sinks, OTLP collectors) outside loopback / RFC1918 / explicit airgap.allowlist. Also enabled by PG_HARDSTORAGE_AIRGAPPED=1 or airgapped: strict in the config file.
-c, --config string path to config file (default: XDG/FHS lookup)
--cpu-profile go tool pprof <path> write a pprof CPU profile to this path for the duration of the command (go tool pprof <path> to analyse). Off when empty.
--mem-profile string write a pprof heap profile to this path at command exit. Off when empty.
--no-color disable ANSI color in text output
--on-error-llm on a structured-error failure, drop into the matching LLM helper skill (auto_on_error trigger). Also enabled by PG_HARDSTORAGE_ON_ERROR_LLM=1.
--otel-endpoint string OpenTelemetry OTLP/HTTP endpoint (e.g. http://otel-collector:4318); empty disables tracing
--otel-stdout also export OpenTelemetry traces to stderr (useful for dev)
-o, --output string output format: text|json|ndjson|yaml|template|csv|markdown|html|tap|junit|pdf (default: text on TTY, json off-TTY)
--profile-port go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30 if non-zero, expose net/http/pprof on 127.0.0.1:<port> for live profiling of long-running commands (e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30). Off when zero.
-q, --quiet suppress non-essential output
--template string Go text/template applied when --output template (or implied if --template is set without --output)
- pg_hardstorage capacity - Projected repository size, WAL volume, and pre-flight free-space checks