Grow a disk inside the guest
Growing a disk happens in two halves. We do the first: the virtual disk your server sees gets bigger. The second half happens inside your server, and nothing does it automatically — the partition and the filesystem on it still end where they used to.
So immediately after a disk grow, df -h shows the old size. That’s expected, and this page is the
missing step.
1. Confirm the new space arrived
Section titled “1. Confirm the new space arrived”lsblkYou’re looking for a disk that is larger than the partition on it — here a 150 GB disk carrying a 50 GB partition:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSsda 8:0 0 150G 0 disk└─sda1 8:1 0 50G 0 part /If the disk itself still shows the old size, the guest hasn’t noticed yet. Reboot the server, or rescan without one:
echo 1 > /sys/class/block/sda/device/rescan2. Grow the partition
Section titled “2. Grow the partition”Install growpart if you don’t have it — it handles the partition table safely and in place.
apt install -y cloud-guest-utils # Debian, Ubuntudnf install -y cloud-utils-growpart # RHEL, Rocky, Oracle LinuxThen grow partition 1 on disk sda, noting the space between them:
growpart /dev/sda 13. Grow the filesystem
Section titled “3. Grow the filesystem”Check which filesystem you have:
findmnt -no FSTYPE /ext4:
resize2fs /dev/sda1xfs — note this takes the mount point, not the device:
xfs_growfs /4. Confirm
Section titled “4. Confirm”df -h /The size should now match what you asked for. Both resize2fs and xfs_growfs work on a mounted,
running filesystem, so there’s no downtime and no need to reboot.
The server’s Disk figure in the panel reads the same numbers from inside the guest, so it should
agree with df -h on the next refresh. If it still shows the old size — or a dash — the
guest agent isn’t running.
If you use LVM
Section titled “If you use LVM”Grow the physical volume, then the logical volume. -r resizes the filesystem in the same step.
growpart /dev/sda 3 # the partition holding the PVpvresize /dev/sda3lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvUse lvs to get the exact logical volume name — the one above is Ubuntu’s default and yours may
differ.
Windows
Section titled “Windows”- Open Disk Management (
diskmgmt.msc). - If the new space doesn’t appear, right-click Disk Management and choose Rescan Disks.
- Right-click the partition, choose Extend Volume, and accept the maximum.
Troubleshooting
Section titled “Troubleshooting”growpart: NOCHANGE: partition 1 is size … it cannot be grown — the disk isn’t bigger yet from
the guest’s point of view. Go back to step 1 and rescan or reboot.
Unallocated space sits after a swap or recovery partition. growpart can only extend into space
that directly follows the partition. If something sits in between, the simplest path is to delete the
partition in the way (swap can be recreated) and then grow. This is worth a snapshot first, or a
ticket from Support if the layout looks awkward.
The filesystem grew but an application still reports the old size. Databases and container runtimes often cache their view of free space. Restart the service.