How to enlarge disk space on /dev/xvde1 for AWS ec2 instance

amazon ec2devhard drive

I created an EC2 instance with type of m1.small and later found it's lack of space. I then stop the instance and change the type to m1.xlarge. However, I have no luck on getting more space.

df -a shows as below:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/xvde1             5905712   5694380    151336  98% /
none                         0         0         0   -  /proc
none                         0         0         0   -  /sys
none                         0         0         0   -  /dev/pts
none                   7685872         0   7685872   0% /dev/shm
none                         0         0         0   -  /proc/sys/fs/binfmt_misc
sunrpc                       0         0         0   -  /var/lib/nfs/rpc_pipefs

Observing that there are 7G space at /dev/shm with no filesystem mounted, I wonder if there's any way to "borrow" this to /dev/xvde1.

Best Answer

The m1.small and m1.xlarge instance sizes you are referring to is the size of the CPU power, the RAM memory, number of cores, processor, etc. Not the actual drive. The size of your drive is found not in the type, but in the EBS volume. You want to enlarge your EBS volume to get more disk space.

Here are my notes to resize a partition in Amazon EBS console:

  1. Stop server
  2. Create an EBS snapshot
  3. Add new volume with more space
  4. Create using the snapshot you just made
  5. Attach and mount the new ebs volume as /dev/sda1 (for boot)
  6. Run sudo resize2fs /dev/xvda1 - for the actual resizing.