Show examples as

Storage day-2 operations

After initial install, you may need to add data disks, expand storage, or reconfigure layouts. kcore supports day-2 disk operations through disko layouts and NixOS configuration.

Management modes

The file /etc/kcore/disko-management-mode on each node controls how disko layouts are managed after the initial install. There are two modes:

ModeBehaviour
installer-only (default) The disko layout is frozen after install. Day-2 storage changes require manual intervention by an operator.
controller-managed The controller can push disko fragments for additive changes (e.g. new data disks). Destructive changes are still blocked.

To switch modes, write the desired value to the mode file:

echo "controller-managed" | sudo tee /etc/kcore/disko-management-mode

Validate a disko layout

Before applying any layout, validate it with a dry-run. The command parses the Nix expression with nix-instantiate and reports errors without touching disks:

kctl --node 10.0.0.5:9091 node apply-disko -f layout.nix

Dry-run is the default. No --dry-run flag is needed — the command only formats and mounts when you explicitly pass --apply.

Apply a disko layout

When you are confident the layout is correct, apply it:

kctl --node 10.0.0.5:9091 node apply-disko \
  -f layout.nix \
  --apply \
  --timeout-seconds 300

This runs disko --mode format,mount on the target node. The server-side hard cap is 3600 seconds.

Always validate before applying. Formatting is destructive — it erases data on the targeted devices.

Reconcile NixOS configuration

After changing the disko layout you typically need to update the NixOS configuration so the new mounts persist across reboots:

kctl --node 10.0.0.5:9091 node apply-nix -f config.nix

To only write the configuration file without running nixos-rebuild:

kctl --node 10.0.0.5:9091 node apply-nix -f config.nix --no-rebuild

Inventory and health

Check the current disk layout on a node (runs lsblk remotely):

kctl --node 10.0.0.5:9091 node disks

Inspect storage backend and LVM inventory from the controller:

kctl describe node node-ab12cd34

The output includes the storage backend, volume group details (for LVM), pool status (for ZFS), and mount points.

Operational runbook

Preflight checks

Adding a data disk

General guidance

Out of scope

The following operations are not supported by the day-2 tooling: