Extend AWS EBS volumes on Ubuntu 18.04.2 LTS Servers. (With no downtime)



Now, we need to extend the partition in the server.

SSH to the EC2 instance where the EBS we’ve just extended is attached to.

Type the ‘lsblk’ command to list block devices:

A similar output should be shown:

As you can see size of the root volume reflects the new size, 50GB, the size of the partition reflects the original size, 16 GB, and must be extended before you can extend the file system.

# sudo growpart /dev/xvda 1



Next extend the file system.

Type “df -h” command to check extended file system.

A similar output should be shown:

As you can see size of the file system is still the original size of 16 GB, and must be resized.

# sudo resize2fs /dev/xvda1

You have just extended the EBS Volume in AWS of your Ubuntu Server with no downtime!