It is not possible to change the size of an existing EBS volume. However, you can simulate the "growing" of an EBS volume by creating a copy of it that's bigger than the original size.
It is not possible to resize an EBS volume smaller. New EBS volumes created from snapshots must be atleast as big as the snapshot size.
To grow your EBS volume, you need to perform the following steps:
Grow the Volume
- Stop the instance attached to your EBS volume. This will ensure that all data has completely been written to the volume.
- Record somewhere the device that the volume is attached to your instance as. For example, /dev/sda1. This information is available in the AWS Management Console, on the volumes page, under the "Attachment Information" column.
- Create a snapshot of the volume and wait for the snapshot to complete.
- Create a new volume based on your snapshot. Make sure to specify the new (larger) size of the volume. Wait for the new volume's status to be "available".
- Detach the old volume from the instance.
- Attach the new volume to the instance. Use the same device name that you saved in step #2.
- Restart your instance. If required, re-associate your Elastic IP address.
At this point, if you connect to your instance (either using Remote Desktop for Windows, or SSH for Linux), you'll notice that the operating system still thinks the volume is the original size. You need to tell the operating system to expand the partition to use the new space.
Resize the Partition
If you are using Windows, you can use the Disk Manager to expand the size of the existing partition to include the new unallocated space. An alternative (if your flavour of Windows allows), is to use the command line tool 'diskpart'.
If you are using Linux, then you can use the 'resize2fs' command.
Once you have confirmed that your instance is running correctly using the new volume, you can delete the old volume.
- Your new volume will not be set to automatically delete when your instance terminates. If you want to restore this flag, you will need to use the API or command line tools to execute the ModifyInstanceAttribute call.
- Our testing did include growing the boot volume for both Linux (Amazon Linux) and Windows (Windows Server 2008 R2).
- If the volume you are growing is not the boot volume of your instance, it's not strictly required to stop your instance. Instead, you can:
- Stop any processes accessing the volume
- Unmount the volume from the operating system
- Detach the volume from the instance
- Create the snapshot
- Create the new volume
- Attach the new volume to the instance
- Mount the new volume in the operating system
- Restart any required processes
Skeddly can grow your volume for you automatically. Only resizing of the partition needs to be done manually. Create An Action
- How do I increase disk space for EC2 Build? - AWS Forums
- Amazon EBS - How to Grow the Storage - Edoceo's Blog
- Resizing the Root Disk on a Running EBS Boot EC2 Instance - Alestic
- How to resize an Amazon EC2 AMI when boot disk is on EBS - BioTeam