So, you created a aws group with a small ebs storage size and now that the site is in production, storage disk is full and it was mounted as root storage, now you are asking “MY AWS INSTANCE STORAGE IS FULL, WHAT TO DO?”
or “How do I increase the EBS volume size of a running instance?”
So, here is the simple solution:
There are two commands which will help you
$ lsblk
and
# df -h
So, initially if you login via SSH (using PUTTY or anything else) you will see something like this:
So, what you need to do is, you need to go to aws console and edit block size in EC2 management
Now run the command lsblk
and df -h
and you will notice the old size and new size under xvda and xvda1
If you dont see the updated new size, please use init 6 or restart the instance using any other command
You now need to use utility growpart so use commandsudo apt install cloud-utils
If you are out of space, please remove any old files which are of no use anymore to free up some Mega Bytes
After that, simply use
sudo growpart /dev/xvda 1
and
sudo resize2fs /dev/xvda1
Leave a Reply