Amazon EC2 storage attached Volume size is not same as configured

Newly setting up an Amazon instance was assigned with 30GB yet showing only less?

try checking the partition using df command.

[root@ip-xxxxx centos]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 666M 6.7G 9% /
tmpfs 498M 0 498M 0% /dev/shm
[root@ip-xxxxx centos]# resize2fs /dev/xvda1

then try issuing lsblk to check your total block size

You’ll see from that output what the name of the disk is of your root partition. For example, you probably see something like this:

xvde 202:64 0 30G 0 disk
└─xvda1 202:65 0 8G 0 part /

To make xvda1 use the whole available space from xvda. Here’s how to resize your partition:

fdisk /dev/xvda (the disk name, not your partition) This enters into the fdisk utility.

Choose the following options

u #Change the display to sectors
p #Print info
d #Delete the partition
n #New partition
p #Primary partition
1 #Partition number
2048 #First sector
Press Enter to accept the default
p #Print info
a #Toggle the bootable flag
1 #Select partition 1
w #Write table to disk and exit
Now, reboot your instance: reboot

once it’s back, verify the new disk size: df -h

Leave a Reply

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