While using Amazon Web Services (AWS) you may find that, when using one of the Amazon Machine Images (AMIs) provided, you may run out of disk space. There does not appear to be any way to “resize” an Elastic Block Store (EBS) volume; however, you can create a new one based on an existing snapshot and replace the current drive with a larger one. I have provided the instructions for doing so below.
- Log into the AWS Management Console
- Make sure that the Instance that you wish to change is not currently running
- Navigate to Elastic Block Store > Volumes
- Check the box next to the Volume that needs more space
- Click the More… drop down list and select Create Snapshot
- Enter a Name and a Description
- Navigate to Elastic Block Store> Snapshots
- Monitor the progress of the Snapshot for completion
- Once complete, navigate back to Elastic Block Store > Volumes
- Click Create Volume
- Enter the desired size for the new volume
- Make sure that you select the same Availability Zone for your instance
- Select the Snapshot that you just created
- Click Yes, Create
- Monitor the progress of the Volume for completion
- Once complete, Check the box next to the Volume that is currently connected to the Instance
- Make sure that no other Volumes are selected
- Click the More… drop down list and select Click the More… drop down list and select Detach Volume
- Uncheck the box selected and check the box next to the new Volume
- Click the More… drop down list and select Click the More… drop down list and select Attach Volume
- Select the Instance that you wish to change
- Change the value in Device from xvdf to /dev/sda1
- Click Yes, Attach
- Navigate to Instances and start your Instance
- Once you are satisfied that the volume works, feel free to delete the Snapshot and old Volume if you like
You will need to take additional steps to extend the size of your partition to use the rest of the allocated space. The process for doing so will vary depending on the operating system that you are using.
Thanks for your article
I followed your article but still i have not success to increase disk space of instance.
Then type command after login instnace:
df -h
O/P:
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 99G 88G 6.9G 93% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.7G 4.0K 3.7G 1% /dev
tmpfs 749M 340K 748M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.7G 0 3.7G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/xvdb 30G 45M 28G 1% /mnt
Same 100 GB nothing change.
Also type command:
>> resize2fs /dev/xvda1
O/P: resize2fs 1.42.9 (4-Feb-2014) The filesystem is already 26212055 blocks long. Nothing to do!
Display message “Nothing to do!”
What is issue dont know if you have any idea please share asap.
Thanks
I have the same issue
Hi,
I am facing the same issue , if you have found any solution for this please help me with that .
For future readers: if this doesn’t work, and a command like `df -h` doesn’t show that you have more space, read the official AWS tutorial at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html.
If the instructions re: using resize2fs doesn’t work, reboot your instance. That worked for me when the rest of it didn’t.
Thanks for the nice post. I have been using AWS free tier for a little while and enjoy it. FYI – you can always just run sudo su – in your shell to move to root and not have to type sudo all the time. Now if I can just see real time usage, so if I go over free tier I’ll know?
Thanks for this- very useful. For windows systems, there is one additional step that is required once the instance is up. You need to go to computer management > Disk Management > right click the c: drive and select Extend Volume and extend it using the unallocated space. I imagine it would be the same on a *nix system where you have to grow the FS.
SyfarEng – thanks for your solution for having to extend the volume for Windows.
Thanks a lot for this Article. You don’t know how much you were helped me. I am very new to this kind of tasks. Initially I got fear if I did some thing wrong what will do. I followed your blog step by step all works as a charm. I expanded my disk size from 8GB to 16GB without lose any existing items.
Once again thank you so much 🙂
great.. found very helpful for me.
Harshad/ All
You need to modify file system in your windows to see the volume reflected.
Thanks
Suseel
This was an excellent guide; concise and complete.
The only two points I’d make are:
1. Entering the snapshot against the new volume: it took quite a while for the snapshot ID to be recognised and for the very large list to shrink to one.
2. I had to change the device to /dev/xvda when attaching the volume for the instance to start.
Thanks!
Thank You! I upgrade my AWS EC2 due to you!!
Hi, why not just create the snap shot and then modify the volume size?
Thanks a lot it works for me