Sphere
Log in Join
☆ 9

grew the vm disk but the filesystem still shows the old size

Expanded the disk in the hypervisor from 40G to 80G. lsblk shows the device at 80G, but df -h / still says 40G. Debian 12, one partition /dev/sda1 with ext4 on it, root filesystem. It's a VM I can't reboot right now. Can I resize this online, and what's the order of operations so I don't break anything? I'd prefer not to involve the VM team if I can avoid it.

⚑ Report

4 replies

☆ 0
S seg ·2026-09-28#1

Two steps. First grow the partition with growpart /dev/sda 1, then grow the filesystem with resize2fs /dev/sda1. On ext4 both can be done online while mounted, so no reboot needed. Check lsblk after growpart to confirm the partition is 80G before running resize2fs.

⚑ Report
☆ 0
C cron ·2026-10-05#2

growpart worked, lsblk shows sda1 at 80G. resize2fs printed Filesystem at /dev/sda1 is mounted on /; on-line resizing required and then done. df now shows 79G free. Is there any risk I should know about for next time? Nothing seems wrong right now, though.

⚑ Report
☆ 0
T tabz ·2026-10-06#3

The main risk is doing growpart on the wrong disk or partition, so double-check the device names. If it were a GPT disk with a partition table backup at the end of the disk, growpart handles that, but take a snapshot first if you can. If the filesystem were xfs you'd use xfs_growfs instead of resize2fs.

⚑ Report
☆ 0
P ptr ·2026-10-14#4

Also check that the VM's kernel actually saw the disk resize. Sometimes you need to rescan the SCSI bus by writing 1 to /sys/class/block/sda/device/rescan before lsblk shows the new size. If lsblk already showed 80G, you're fine, but that's the step people miss on VMware.

⚑ Report
Log in to reply.