Search code examples
amazon-web-serviceslinux-device-driverredhatamazon-ebs

Not all storage is available for Amazon EBS


I'm sure the problem appears because of my misunderstanding of Ec2+EBS configuring, so answer might be very simple.

I've created RedHat ec2 instance on the Amazon WS with 30GB EBS storage. But lsblk shows me, that only 6GB of total 30 is available for me:

xvda    202:0    0  30G  0 disk
└─xvda1 202:1    0   6G  0 part /

How can I mount all remaining storage space to my instance?

[UPDATE] commands output:

mount:

/dev/xvda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sudo fdisk -l /dev/xvda:

WARNING: GPT (GUID Partition Table) detected on '/dev/xvda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/xvda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1               1        1306    10485759+  ee  GPT

resize2fs /dev/xvda1:

resize2fs 1.41.12 (17-May-2010)
The filesystem is already 1572864 blocks long.  Nothing to do!

Solution

  • If you update your question with the output of fdisk -l /dev/xvda and mount it should help provide any extra information if the following isnt suitable:

    I would assume that you could either re-partition xvda to provision the space for another mount point (/var or /home for example) or grow your current root partition into the extra space available - you can follow this guide here to do this

    Obviously be sure to back up any data you have on there, this is potentially destructive!

    [Update - how to use parted]

    The following link will talk you through using GNU Parted to create a partition, you will essentially just need to create a new partition, then I would temporarily mount this to a directory such as /mnt/newhome, copy across all of the current contents of /home (recursively as root keeping permissions with cp -rp /home/* /mnt/newhome), then I would rename the current /home to /homeold, then make sure you have set up Fstab to have the correct entry: (assuming your new partition is /dev/xvda2)

    /dev/xvda2    /home    /ext4     noatime,errors=remount-ro 0     1