DEV Community


Posted on

How to Increase Storage Space of an AWS instance



Use the df -h command to show the size and the percentage used by the file system.  

Use the lsblk command to show the size of the volumes.  

  1. If you need more space then find the volume for instance (look at the attachment information). Select that volume → Actions → Modify.

Then then run lsblk to see the changes in nvme0n1p1 (if you do not see any changes then restart the server). You will not yet see the changes in running df -h as you need to allocate the new space to the partition for the filesystem.

  1. If the volume has a partition containing a file system, that partition must be resized before the file system is expanded:

Use the growpart command to extend the partition. Notice that there is a space between the device name and the partition number. This will grow nvme0n1p1 to match nvme0n1p1 (where p1 stands for partition 1) in the lsblk output in Step 1.

sudo growpart /dev/nvme0n1 1

  1. Use the resize2fs command to automatically extend the size of the /dev/root file system to the full space on the volume.

sudo resize2fs /dev/root

Top comments (0)