Skip to content

Resizing a local-path Volume

When a worker node's local disk is expanded, the node's local-path provisioner mount (/var/mnt) needs to be grown to reflect the new size. The XFS filesystem supports online resizing — no downtime or unmount required.

Prerequisites

The disk must already be resized in Proxmox. Update the extra_disk value in tofu/tf-deploy/noah/locals.tf and apply with OpenTofu before proceeding.

Steps

1. Verify the disk shows the new size

talosctl -n <node-ip> get disks
# sdb should show the new size

2. Launch a privileged pod on the target node

kubectl run disk-resize --rm -it --restart=Never -n infra \
  --image=alpine \
  --overrides='{
    "spec": {
      "nodeSelector": {"kubernetes.io/hostname": "<node-name>"},
      "hostPID": true,
      "tolerations": [{"key": "dedicated", "operator": "Equal", "value": "media", "effect": "NoSchedule"}],
      "containers": [{
        "name": "disk-resize",
        "image": "alpine",
        "stdin": true,
        "tty": true,
        "securityContext": {"privileged": true},
        "command": ["sh"],
        "volumeMounts": [
          {"name": "dev", "mountPath": "/dev"},
          {"name": "varmnt", "mountPath": "/var/mnt"}
        ]
      }],
      "volumes": [
        {"name": "dev", "hostPath": {"path": "/dev"}},
        {"name": "varmnt", "hostPath": {"path": "/var/mnt"}}
      ]
    }
  }'

Note

The toleration for dedicated=media:NoSchedule is required for worker-0a and worker-0b. Remove it for all other nodes.

3. Install tools

apk add parted xfsprogs xfsprogs-extra

4. Resize the partition

parted /dev/sdb resizepart 1 100%

At the prompts:

  • Fix — fix GPT to use all available space
  • Yes — confirm partition is in use
  • 100% — new end position

5. Grow the XFS filesystem

xfs_growfs /var/mnt

XFS supports online grow — no unmount needed.

6. Verify

df -h /var/mnt
# Should show the new size