People who works AWS EC2 might have noticed that EBS size hasn’t changed even after you have increase the size when you launched the instance. For, fixing this issue you need to resize the file system after the instance is launched.
In the below example, the disk space is shown as 8 GB when it has 50 GB allocated. Run the command ” resize2fs
[ec2-user@ip-10-0-4-133 ~]$ sudo su –
[root@ip-10-0-4-133 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.9G 850M 7.0G 11% /
tmpfs 849M 0 849M 0% /dev/shm
[root@ip-10-0-4-133 ~]# fdisk -l
Disk /dev/xvda1: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
[root@ip-10-0-4-133 ~]# resize2fs /dev/xvda1
resize2fs 1.42 (29-Nov-2011)
Filesystem at /dev/xvda1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 4
Performing an on-line resize of /dev/xvda1 to 13107200 (4k) blocks.
The filesystem on /dev/xvda1 is now 13107200 blocks long.