Posts

Showing posts from July, 2017

How do I Extend a Linux partition in AWS EC2

Extending our Linux partition (in AWS EC2) is the resizing of your partition to use the whole disk.

Our running instance size was a Centos with 25GB hard disk space. Now, Amazon has told us that "This instance is scheduled for retirement" and we want to migrate to another instance. We found that we needed a little more space and wanted to extend the linux partition. So, when we created an image, we chose to provide for 50GB in storage.

So, we took a snapshot of the image and launched an instance from the image.

When creating the instance, the size was defined as 50GB. Then, the instance is started. 


The used hard disk space
Before we resized the Linux root partition, of the AWS EC2 instance, we needed to find out the status of the storage now. The df -h command will show us the storage space in the running instance. As seen below, it shows only 25GB.

al@ip-192-230-185-43:~/> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1       25G   17G  7.3G  71% /
none        …