Skip to content

Instantly share code, notes, and snippets.

@kieetnvt
Created May 20, 2019 17:13
Show Gist options
  • Save kieetnvt/605f5c55fbef4e3269fc965201826cd8 to your computer and use it in GitHub Desktop.
Save kieetnvt/605f5c55fbef4e3269fc965201826cd8 to your computer and use it in GitHub Desktop.
Expanding volume size of EC2 AWS Instance

Steps

--- AWS Dashboard EBS Step ---

  1. Log into your AWS account and navigate to EC2

  2. View Instance Details looking for the Root Device and Block Devices to identify the volume you want to resize

  3. Click the storage Device and select the EBS ID

  4. While in the Volumes panel click Actions at the top of the page

  5. Select Modify Volume to modify that particular volume

  6. Enter the desired volume size in GBs and click modify, yes to confirm

  7. SSH into your Instance

--- Command Steps ---

  1. Run lsblk to list available blocks (volumes) and note the volume size / names

  2. Run sudo growpart /dev/volumename 1 on the volume you want to resize, in our case it was sudo growpart /dev/xvda 1

  3. Run sudo resize2fs /dev/xvda1 to expand file system

  4. Check new size with df -h command

Reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment