Skip to content

space: filesystems, WAL size, databases and tablespaces

Check data/WAL/tablespace filesystem usage, WAL retention settings, database sizes, and tablespace capacities.

Inspects host filesystems for data_directory, sys_wal, and external tablespaces (local Unix socket only), plus WAL directory volume/limits, database sizes, and tablespaces. Read-only: never removes WAL segments or inspects table contents.

Usage

kbdiag space
kbdiag space --json

Key Options

OptionEffect
--jsonEmit JSON probes (space.disk, space.wal, inst.databases, space.tablespaces)

Verdict & Reading Output

  • FAIL (exit=2): space.disk_full when free space on a data_directory or wal filesystem drops below one WAL segment (wal_segment_size).
  • OK (exit=0): All probes collected cleanly with no redacted sizes and at least one WAL segment free on data_directory and wal filesystems.
  • UNKNOWN (exit=3): Remote connection (space.disk: not_applicable), missing sys_wal or tablespace statfs permission (partial: skipped), denied sys_ls_waldir() (kbdiag_ro), or missing segment size. Surviving mounts remain visible under [DISK] even on partial skips.

Example (KES V9 Primary, COLUMNS=80)

space  UNKNOWN  (primary, system@local, endpoint=/tmp/.s.KINGBASE.54321,
    2026-12-03T03:58:01Z)

[COVERAGE]
  space.disk: skipped (insufficient_privilege: statfs
    /data/kingbase/data/sys_wal: permission denied)
[DISK]
  1 filesystem
  partial: skipped (insufficient_privilege: statfs /data/kingbase/data/sys_wal:
    permission denied)
  holds           used   size    free   use
  data_directory  31 GB  128 GB  97 GB  24%
[WAL]
  57 files, 896 MB
  max_wal_size  1024 MB
  wal_keep      0 bytes  (0 x 16 MB)
[DATABASES]
  5, total 26 GB
  oneta_demo  26 GB
  test        17 MB
  • kbdiag wal — inspect current LSN position, replication slots, and archive_ready backlog
  • kbdiag slots — check inactive replication slots retaining WAL
  • kbdiag object — find the largest tables and indexes inside a database