Linux – Created 100GB ec2 instance, but only shows 10GB

amazon ec2amazon-web-serviceslinuxpartition

I just created a new EC2 instance of 100gb with only 1 storage disk.

However, my df -h output shows the following :

[root@ip-10-252-37-164 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde1            5.5G  2.9G  2.3G  56% /
tmpfs                 296M     0  296M   0% /dev/shm
[root@ip-10-252-37-164 ~]#

How is this possible ? Where is the rest 90GB of my disk ?
How do I get the full 100G on /dev/xvde1 ?

lsblk gives me this output :

[root@ip-10-252-37-164 ~]# lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
xvde    202:64   0   100G  0 disk
├─xvde1 202:65   0   5.5G  0 part /
└─xvde2 202:66   0 488.7M  0 part [SWAP]
[root@ip-10-252-37-164 ~]#

I tried using resize2fs, but I get this error :

[root@ip-10-252-37-164 ~]# resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 1447753 blocks long.  Nothing to do!

Best Answer

The space exists on the disk, you just need to make it available. The simplest thing to do here is to

  • Use fdisk to create a new partition
  • Create a filesystem using mkfs
  • Add the new partition into a convenient filesystem location using mount.
  • Update the /etc/fstab as appropriate.