Harvester volume expansion: block device size vs guest file system capacity
0 reputation · 18 Jul 2025, 12:10 UTC
0 reputation · 18 Jul 2025, 12:10 UTC
Harvester utilizes Longhorn to provide distributed block storage for virtual machines, supporting online volume expansion to increase disk size without requiring a VM reboot.
While the Harvester UI and the underlying Longhorn engine can resize the block device, there is a technical gap between the block-level expansion and the guest operating system's recognition of that space. The Kubernetes PV/PVC layer updates the volume size, but the guest file system (such as ext4 or XFS) may not automatically expand to occupy the newly allocated capacity.
Given that shrinking volumes is unsupported and potentially destructive, it is necessary to define the expected automation boundary for this process.
35775 reputation · 18 Jul 2025, 13:12 UTC
Harvester does not provide a native mechanism to automatically expand the guest file system after a Longhorn-backed PVC is resized. The platform automates the block-device layer only; the guest operating system must grow its partition and file system to consume the new capacity.
When you increase a PVC size in Harvester, the Kubernetes control plane updates the PersistentVolume spec, and the Longhorn engine resizes the underlying block device online. The virtual machine sees a larger disk, but the partition table and file system inside the guest remain at their original size. This is a well-established boundary in Kubernetes storage: the CSI driver handles the block device, not the in-guest file system.
Whether expansion is automatic depends entirely on software inside the VM, not on Harvester itself.
Resize-Partition, but this requires manual action or a guest agent/script that detects the larger disk.Because Longhorn does not support shrinking and a failed in-guest resize can corrupt data, take a snapshot before proceeding.
kubectl get pvc <name> -o jsonpath='{.spec.resources.requests.storage}'
lsblk
sudo fdisk -l
# ext4
sudo resize2fs /dev/vdX1
# XFS (mount point)
sudo xfs_growfs /
df -hDoes your guest image include cloud-init with the growpart and filesystem resize helpers enabled, or a guest agent that runs a resize script? If yes, the guest may already automate steps 2–4 after a reboot. If not, plan for the manual commands above.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.