Expand root partition under Linux

24 Jun, 2023 | Linux, Server, Ubuntu | 0 comments

Most of the time when we want to expand a partition size under linux we use some kind of software like Gparted to accomplish this goal. But this kind of software usually requires umount the partition so it can be done on a live root partition. The Solution is simple use growpart <device> <partition>

growpart /dev/xvda 1  # Grows the partition; 
resize2fs /dev/xvda1  # Grows the filesystem

growpart┬áis part of cloud-utils. In case you don’t have it, you can install with:

sudo apt-get install cloud-utils

BEFORE: You should always play safe and back up your partition table:

sfdisk -d /dev/xvda > partition_bak.dmp

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *