How to Resize root EBS Volume on AWS Linux Instance [CENTOS 6 AMI]

I have created a new CentOS Linux instance. I had selected 50 GB of root volume during creating of instance but when system comes online it was showing only 8 GB of disk is usable. I tried to resize root disk using resize2fs, I get the following message

1

So, I have following below steps and able to successfully resize volume to its full size selected during instance creation

Step 1. Take Backups

We strongly recommended to take full backup (AMI) of your instance before doing any changes. Also create a snapshot of root disk.

Step 2. Check Current Partitioning

Now check the disk partitioning using following command. You can see that /dev/xvda is 53.7 GB in size.

2

3

Step 3. Increase Size of Volume

Now start with the disk re partitioning using set of following commands. Execute all the commands carefully.

4

Now change the display units to sectors using u switch.

5

Now print the partition table to check for disk details

6

Now delete the first partition using following command.

7

Now create a new partition using following commands. For the first sector enter 2048 (as shows in above command output) and for last second just press enter to select all partition.

8

Print the partition table again. You will see that new partition has occupied all disk space.

9

Now set the bootable flag on partition 1.

10

Write disk partition permanently and exit.

11

Lets reboot your system after making all above changes.

12

Step 4. Verify Upgraded Disk

At this point your root volume has been resized successfully. Just verify your disk has been resizes properly.

13

Cheers$s$s guyZZZZ…. Yuppie…… Done!!!

OK, folks that’s it for this post. Have a nice day guys…… Stay tuned…..!!!!!

Don’t forget to like & share this post on social networks!!! I will keep on updating this blog. Please do follow!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s