I have a server running the recent Ubuntu AMIs from Canonical. The size of the EBS boot volume is 8GB. I know that I can resize EBS volumes by taking a snapshot, creating a new volume and expanding the partition on it. How can I increase the size of the volume while the machine is running? If this is not possible, what is the preferred method for increasing the boot volume size with minimal downtime?
相关问题
- How to generate 12 digit unique number in redshift
- Use awslogs with kubernetes 'natively'
- JQ: Select when attribute value exists in a bash a
- Assume/switch role in aws toolkit for eclipse 2.0
- 'no SavedModel bundles found!' on tensorfl
相关文章
- Right way to deploy Rails + Puma + Postgres app to
- how many objects are returned by aws s3api list-ob
- AWS S3 in rails - how to set the s3_signature_vers
- Passthrough input to output in AWS Step Functions
- I cannot locate production log files on Elastic Be
- ImportError: cannot import name 'joblib' f
- Static IP for Auto Scale in AWS
- Step function exceeding the maximum number of char
You just need to create its snapshot first and from that snapshot need to create another volume and once new volume ready, detach the old volume from the instance and attach the new volume. Make sure to stop the instance before start this process and restart the instance once its done.
Refer http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html
We can increase the volume size with the new EBS Feature Elastic volumes, post that we need to follow the following steps to use the increase size as shown here
Assume your volume was 16G and you increased it to 32GB.
To extend xvda1 from 16GB t0 32GB, we need growpart. growpart is available as part of cloudutils
Post installation of cloud-utils, execute the growpart command
Now lsblk, will show
but df -h will show only 16GB
Final command for extending xvda1 to 32GB is
In case of XFS file system,
sudo xfs_growfs /dev/xvdal
Thanks eggYou cannot do this. But if your more focused on downtime then cost, you maybe able to clone your main instance, mount a larger EBS storage device to your system, copy the data over and then redirect traffic to your new instance.
If you want, a method I use lately use S3 has a medium of backups and deployment to other systems. So for example, you have your existing system running..set a script to upload your data to s3 every N minutes/hours/days..then write a script to use when launching new instances to download that data. If your data isn't something like constantly updated then this should work fine(for me, I use this to distribute updated version of my codebase while the data itself is managed on a ec2 database server).
Hope that helps.
A late answer to this 5-year-old question
AWS has just announced a new EBS feature called Elastic Volumes, which allows you to increase volume size, adjust performance, or change the volume type while the volume is in use.
You can read more about it on AWS Blog here.
Unfortunately it is not possible to increase the size of an Amazon EBS root device storage volume while the Amazon EC2 instance is running - Eric Hammond has written a detailed (I'm inclined to say the 'canonical' ;) article about Resizing the Root Disk on a Running EBS Boot EC2 Instance:
If you properly prepare the steps he describes (I highly recommend to test them with a throw away EC2 instance first to get acquainted with the procedure), you should be able to finish the process with a few minutes downtime only indeed.
Good luck!
I found that when trying to increase the root partition /dev/sda1 which was being reported as /dev/xvda1 on centos6 i couldn't unmount the volume in order to expand the partition.
I got around this by mounting my original volume as /dev/sda1 and my snapshot as /dev/sdb. I then restarted the image and resized the /dev/sdb1 partition using parted.
Once the partition /dev/sdb1 was resized i detached both volumes and reattached the new volume to /dev/sda1 and ran resize2fs /dev/xvda1.