Skip to content

meta.flexfs

meta.flexfs is the metadata server that stores inodes, directory entries, attributes, extended attributes, and ACLs for one or more flexFS volumes. Mount clients communicate with it over an RPC protocol, and utilities like analyze.flexfs and find.flexfs use its REST API.

SubcommandDescription
deinit credsRemove the credentials file
deinit systemdRemove the systemd service unit
init credsInitialize the credentials file
init systemdCreate and enable a systemd service unit
licensePrint license information
migrateRun database migrations
missing-objectsReport meta-tracked block keys absent from the block store
startStart the metadata server
verifyVerify database integrity
versionPrint the build version
Terminal window
meta.flexfs start [flags]

These flags apply to all subcommands:

FlagTypeDefaultDescription
--credsFilestring~/.flexfs/meta/credsCredentials file path
--dbFolderstring~/.flexfs/meta/dataDatabase folder path
FlagTypeDefaultDescriptionVisibility
--adminAddrstringAdmin server address (overrides creds file)Internal
--bindAddrstring0.0.0.0:443Address and port to bindPublic
--blockPassstringBlock storage password (overrides creds file)Internal
--blockUserstringBlock storage username (overrides creds file)Internal
--dbMemCapacitystring50%Database memory cache capacity (e.g. 5%, 64M)Internal
--fallbackstringFallback RPC version for old clients (e.g. v1.4)Internal
--minDiskAvailstring1GMinimum available space required on the database folder filesystem (e.g. 2%, 512M; 0 disables)Internal
--noAdminSSLboolfalseDisable SSL for admin server connectionsInternal
--noSSLboolfalseDisable SSL for the REST APIPublic
--pprofboolfalseEnable pprof profilerInternal
--pprofPortint6062Pprof server portInternal
--sizeBinsboolfalseDeprecated — size bins are now always enabledInternal
--sslCertstring~/.flexfs/ssl/certSSL certificate file pathPublic
--sslKeystring~/.flexfs/ssl/keySSL private key file pathPublic
--syncboolfalseFsync every metadata writePublic
--tokenstringMetadata server auth token (overrides creds file)Internal
--verbose, -vboolfalseEnable verbose loggingPublic

The metadata database cannot be written safely on a filesystem that has run out of space, and shutting it down is itself a write: closing each volume persists its lock state and flushes memtables into the database folder. The server therefore guards the --dbFolder filesystem:

  • On startup, it refuses to start if the available space is already below --minDiskAvail.
  • While running, it re-checks every minute and shuts down gracefully — draining in-flight requests and closing the database cleanly — as soon as available space drops below --minDiskAvail. Both events are logged, naming the folder and the space available.

Watch flexfs_meta_db_folder_disk_available_bytes to catch this well before it happens; see Alerting. The default floor leaves room for compaction and for the flush on close; raise it if a deployment needs more headroom than that. Setting it to 0 disables both checks.

Terminal window
meta.flexfs init creds [flags]

Initializes a credentials file for the metadata server. If --token is omitted, the command prompts for a metadata server token interactively.

FlagTypeDefaultDescription
--adminAddrstring""Admin server address
--blockPassstring""Block storage password
--blockUserstring""Block storage username
--forceboolfalseOverwrite existing creds file
--tokenstring""Metadata server auth token (will prompt if omitted)
Terminal window
sudo meta.flexfs init systemd [flags]

Creates and enables a systemd service unit (flexfs-meta.service) for the metadata server. Requires root.

FlagTypeDefaultDescription
--forceboolfalseOverwrite existing systemd unit file
--nowboolfalseStart the service immediately after enabling
--startFlagsstring""Additional flags to pass to the start command
Terminal window
meta.flexfs deinit creds [flags]

Removes the credentials file for the metadata server. If the credentials file is referenced by a systemd unit, the command refuses unless --force is passed, in which case it removes the references too.

FlagTypeDefaultDescription
--forceboolfalseRemove creds even if referenced by systemd (removes references too)
Terminal window
sudo meta.flexfs deinit systemd

Removes the systemd service unit (flexfs-meta.service) for the metadata server. Requires root.

Terminal window
meta.flexfs verify [volume-id] [flags]

Verifies the integrity of the metadata database by comparing stored counters, dentries, and size bins against actual data. If a volume ID is provided, only that volume is verified; otherwise all volumes are checked.

FlagTypeDefaultDescription
--fixboolfalseFix mismatched counts by recomputing from actual data
Terminal window
meta.flexfs migrate [flags]

Migrates volume data from the legacy snapshot format to the current database format.

FlagTypeDefaultDescription
--srcFolderstring~/.flexfs/meta/dataSource data folder
Terminal window
meta.flexfs missing-objects [volume-id] [flags]

For each block key tracked by meta (live and/or retired), HEADs the corresponding object in the block store and reports any that are missing. Runs offline against the Pebble database, so the meta service must be stopped (Pebble lock); contacts the admin server to fetch per-volume block settings, so the admin server must be reachable. If a volume ID is provided, only that volume is scanned; otherwise all volumes are scanned.

FlagTypeDefaultDescription
--concurrencyint32Number of parallel HEAD requests
--live-onlyboolfalseOnly check live block keys
--retired-onlyboolfalseOnly check retired block keys
--noAdminSSLboolfalseDisable SSL for admin server connections

The credentials file is a TOML file with connection details populated during init creds:

adminAddr = "admin.example.com:443"
token = "$TOKEN"
blockUser = "$USERNAME"
blockPass = "$PASSWORD"

The metadata server exposes REST endpoints for utilities, monitoring, and maintenance. See the Metadata REST API reference for the full list of endpoints and their parameters.