Growing the root partition to fill the drive on Debian
June 12, 2026
The problem. A Debian image flashed to a large drive boots with a root partition of only a couple of gigabytes. Debian does not auto expand the way Raspberry Pi OS does, so the rest of the disk sits unused. It has to be claimed by hand, in two steps: grow the partition, then grow the filesystem.
The fix.
Confirm the layout first, and find which device and partition is root. Disk operations are the one place to never guess:
lsblk
On a Debian Pi image, root is often partition 1, for example /dev/sda1, with the
firmware on a high numbered partition like /dev/sda15. Use whatever lsblk shows
you.
Grow the partition into the free space, then grow the ext4 filesystem to fill it.
growpart comes from the cloud-guest-utils package. resize2fs is built in and
grows the live, mounted root with no unmount needed:
apt install -y cloud-guest-utils
growpart /dev/sda 1
resize2fs /dev/sda1
Note that growpart takes the disk and the partition number as two separate arguments. Confirm the result:
df -h /
Root jumps from a couple of gigabytes to the full size of the drive, with no unmount and no reboot.