Skip to content

Volume Migration in EC2

0

I have c5a.large instance which has 30GB storage. I want to reduce it to 15GB and want to create two volumes of 15GB But I don't have elastic IP so I will not be able to sutdown the Instance as IP is mapped with DNS can you just help me out to create two 15GB volume and assign data of 30GB volume to one of the 15GB volume and delete the 30GB volume. Instance should run on 15GB volume

1 Answer
1

Unfortunately, you cannot directly reduce the size of an existing EBS volume - AWS only allows you to increase volume size, not decrease it. Since you can't shut down your instance due to the DNS mapping concern, here's how you can achieve your goal:

  1. Create a new empty 15GB EBS volume in the same Availability Zone as your instance.

  2. Attach this new 15GB volume to your running instance.

  3. Connect to your instance and make the new volume available:

  • For Linux: Format the volume and mount it
  • For Windows: Bring the volume online in Disk Management and initialize it with GPT
  1. Copy the necessary data from your original 30GB volume to the new 15GB volume. Make sure the data you're copying will fit within the 15GB space.

  2. If this is for your root/boot volume, this approach becomes more complex as you can't simply replace a root volume on a running instance. You would need to:

  • Create an AMI from your current instance
  • Launch a new instance with a smaller root volume size
  • Configure the DNS to point to the new instance

If you're trying to split your data across two 15GB volumes (rather than replacing the root volume), you can:

  1. Create two new 15GB volumes
  2. Attach both to your instance
  3. Copy appropriate data to each volume
  4. Configure your applications to use these new volumes

Note that reducing a root volume requires instance replacement, which would change your IP address. If this is a non-root volume, you can add the new volumes and migrate data while the instance continues running.
Sources
Requirements for Amazon EBS volume modifications - Amazon EBS
Request Amazon EBS volume modifications - Amazon EBS

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.