VPS Tutorials
Expand a VPS Disk: growpart, LVM, ext4 and XFS (2026)
Find which storage layer still has the old size after cloud disk growth, choose the ext4, XFS or LVM procedure, prepare recovery backups and verify usable capacity.

Increasing a cloud disk from 40 GB to 80 GB can leave df -h showing 40 GB. Usually only one layer has grown: virtual disk, partition, LVM or filesystem. This guide covers ordinary ext4/XFS partitions and common LVM roots on Ubuntu VPSs. Identify the layer first, choose its matching procedure, and verify applications can use the new space.
The usual sequence is provider expands disk → guest sees larger block device → partition grows → filesystem grows. LVM adds physical volume (PV), volume group (VG) and logical volume (LV); see Ubuntu's LVM explanation. Running resize2fs against a guessed device can affect the wrong disk.
Check whether the provider expanded an existing disk or attached a new one. A separate new disk does not automatically enlarge /. Inspect read-only first:
findmnt -no SOURCE,FSTYPE,TARGET /
df -hT /
lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS,PKNAME
sudo pvs
sudo vgs
sudo lvs
If pvs, vgs and lvs are unavailable while findmnt uses an ordinary partition such as /dev/vda1 or /dev/nvme0n1p1, the root may not use LVM. Do not create LVM merely to grow a non-LVM disk. If lsblk shows an 80 GB disk and 40 GB partition while df -hT / shows 40 GB ext4, both later layers need expansion. An 80 GB partition with df still at 40 GB needs only filesystem growth.
Evidence from findmnt/lsblk | Next action |
|---|---|
| Disk still has its old size | Confirm provider completion; rescan/reboot only as its documentation requires |
| Larger disk, unchanged ordinary partition | Verify partition identity, then growpart |
| Larger partition, unchanged ext4/XFS | resize2fs on ext4 device or xfs_growfs on XFS mount |
Root on /dev/mapper/..., no VG free space | Grow the PV's partition, run pvresize, then extend LV |
| VG already has free space | Skip growpart; choose which LV gets the space |
growpart can use only following free space up to another partition. Repeating it cannot move a partition blocking growth. Review the -N dry run described in the growpart manual before changing metadata.
Partition/filesystem growth changes storage metadata. Create a provider snapshot and record its ID, time, disk coverage and recovery procedure. Make consistent database exports and copy important files to another server/object storage. A live snapshot and database backup may represent different business moments; plan maintenance and freeze orders/uploads when consistency requires it. See snapshots versus backups and recovery drills.
Test SSH and rescue-console access. A full filesystem can prevent growpart from creating temporary files; identify usage and safely free a little working space without wildcard deletion in unknown directories. Ubuntu/Debian can install growpart with sudo apt install cloud-guest-utils; XFS requires xfsprogs. Choose only the procedure matching your layout, replacing every device name.
Suppose inspection confirms whole disk /dev/vda, root partition /dev/vda1, ext4, and free space after vda1. Read the dry run. -N can return nonzero when no growth is possible; revisit lsblk rather than assuming corruption.
sudo growpart -N /dev/vda 1
sudo growpart /dev/vda 1
lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS
sudo resize2fs /dev/vda1
df -hT /
The space in growpart /dev/vda 1 matters: pass the whole disk and partition number separately. If your NVMe root is /dev/nvme0n1p1, use growpart /dev/nvme0n1 1 and filesystem device /dev/nvme0n1p1. Official cloud-volume guidance follows disk, partition, filesystem order too. Example names are not evidence of your device identity.
If lsblk already shows a full-size partition but df remains small, skip growpart and use resize2fs on the correct ext4 device. If the filesystem occupies whole device /dev/vdb without a partition table, do not run growpart; confirm the layout and grow that filesystem directly.
Suppose partition /dev/nvme0n1p1 is on expanded disk /dev/nvme0n1, and findmnt identifies XFS. Grow the partition, then the mount point /. xfs_growfs takes a mount point, not a partition number:
sudo growpart -N /dev/nvme0n1 1
sudo growpart /dev/nvme0n1 1
lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS
sudo xfs_growfs /
df -hT /
For XFS mounted at /data, use sudo xfs_growfs /data. If the partition already grew, only xfs_growfs is needed. This workflow does not offer in-place XFS shrinking; recovery depends on snapshots/backups. Verify disk and mount point before growth.
The example assumes disk /dev/vda, PV /dev/vda3 and root LV /dev/ubuntu-vg/ubuntu-lv. Your PV number and LV names can differ: compare pvs, vgs, lvs and findmnt. If vgs already has sufficient VFree, skip directly to LV growth. Otherwise grow the PV partition:
sudo growpart -N /dev/vda 3
sudo growpart /dev/vda 3
sudo pvresize /dev/vda3
sudo pvs
sudo vgs
Allocate VG space according to need. This example adds 20 GB to root and asks LVM to grow a supported filesystem too:
sudo lvextend --resizefs --size +20G /dev/ubuntu-vg/ubuntu-lv
sudo lvs
df -hT /
Check --resizefs behavior in the Ubuntu LVM administration guide; the increment cannot exceed VFree. To allocate all remaining VG space, use sudo lvextend -l +100%FREE -r /dev/ubuntu-vg/ubuntu-lv only after confirming other LVs need no reserve. If filesystem resizing fails after LV growth, inspect both layers before repeating changes.
A PV on an entire disk does not need growpart; confirm guest disk size, then run pvresize on that PV. LUKS, RAID, thin pools and multi-disk VGs require a plan matching their full topology rather than these examples.
Compare lsblk for block/partition/LV size with df -hT for mounted filesystem space. Units, metadata and reserved blocks can affect reported available capacity. Perform a small non-destructive write in the intended directory and check web/database/container logs. Keep an independent recovery copy away from the expanded disk.
| Error/symptom | Inspect |
|---|---|
growpart: NOCHANGE | Actual disk growth, partition end and any following partition |
growpart cannot create temporary directory | Full root or /tmp; safely free working space |
resize2fs: Bad magic number | Wrong device, XFS or PV; recheck findmnt and lsblk -f |
xfs_growfs: not a mounted XFS filesystem | Mount point versus device and actual filesystem type |
pvresize leaves VFree at zero | PV partition size, kernel partition-table recognition and selected PV |
df unchanged but lsblk larger | Filesystem still needs growth or wrong mount is being inspected |
If the kernel retains an old partition size, keep the snapshot and arrange a provider-guided reboot, then inspect lsblk. Do not repeatedly rewrite the table. With I/O errors, unexpected layout or corruption, stop writes and investigate through rescue/snapshot recovery. Restoring an old snapshot loses later writes unless preserved separately. Do not shrink partitions to reverse cloud billing: provider resizing/billing policies vary and downsizing often requires migration to a new disk.
Is reboot mandatory? No universal rule. Some platforms support online recognition/growth; others require rescan or reboot. Inspect lsblk and df -hT and follow the platform procedure.
Why do df -h and lsblk differ? lsblk describes block layers; df describes mounted filesystems. Growing only disk/partition does not automatically update df.
For Docker storage, grow root or a data disk? Use docker system df and df -hT /var/lib/docker to locate its actual mount. Growing root will not enlarge Docker storage on another volume.