I have two diaries, one of what I eat the other is this one :e.

Expand root partition under Linux

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

Leave a Reply

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