Home » Cloud » How to expand the EC2 intance root partition in AWS step by step

How to expand the EC2 intance root partition in AWS step by step

Expansion of the C drive/root partition  is very simple and straight forward – however you will need to power off your instance per best practices so data does not change – however there are multiple ways to do this –  this one involves just working the volume in question

First you will need to document the following

  1. Instance ID i-4cf5e4d5
  2. Availability Zone  us-east-1a

you will need these value later for the expansion of the partition



Now you can click on the Root Device /dev/sda1 and you will get the following screen – make a note of 1 and 2

  1.  /dev/sda1 defines a boot volume
  2. vol-716c16ed is the volume id



Once you click on the vol-716c16ed – it will take you to the screen below –

  1.  one shows the Volume ID
  2. shows the size of the C drive/partition which in this case is 30 GB




Now you will need to create a snapshot out of the existing volume

  1. Click on Create Snapshot


Clicking it will take you the next screen

  1. Snapshot ID
  2. Name of the Snapshot
  3. Description


Click on Create to start the process – it can take up to hours – all depends on the size of the drive


Go to snapshots Tab on the left side to see if the snapshot has been completed successfully and now you will need to create a new volume from the Snapshot with the expanded size that you want -click on Create Volume and add the details


When creating the new volume – you will need to know the following

  1.  New Size of the drive which in this case we want to increase by 5 GB so the new size is 35 GB
  2. Availability Zone ID that you previously noted which i sus-east-1a in this case



Click on the Create radio button to create the volume



Now you will need to go the volumes on the left side and search for the olad volume by putting the volume in the search

  1.  Paste the old volume ID in the search box
  2. Once the search is complete and verify the volume ID
  3. Verfiy the old EC2 drive size


You will now need to deatch the volume


Click on detach volume and it will detach from the existing  Ec2 instance



Now find the new volume by volume ID that you made a mote of and paste the new volume ID in the search box for volumes – you can see the new volume is now 35 GB


Click on Actions and attach volume


Now you will need to know the Intance ID of the EC intanace and click on Actions and attach Volume

  1. Make sure the Volume ID is correct
  2. Make sure the Intance ID isc orrect
  3. since this is the root volume – you will need to enter /dev/sda1 – otherwise it will not boot


No go to the EC2 dashboard and verify that you can start the instance to make sure the Instance starts

Dont foget the expand the drive in the OS whether is is linux or windows – this just does it on the EC2 backend






Leave a Reply

Your email address will not be published. Required fields are marked *