Resizing Disk - increasing the size

I like learning new stuff - anything, including technology. I love tinkering with new tools, systems and services, especially open source projects
Search for a command to run...

I like learning new stuff - anything, including technology. I love tinkering with new tools, systems and services, especially open source projects
No comments yet. Be the first to comment.
inodes is a concept in Linux. Oh wait…no Fun fact that I learned while experimenting on my macOS - I can see that the term and concept of inodes exists in the context of macOS too Looks like it’s a “Unix” thing and Linux and Darwin, both are Unix bas...

You can look for Kubernetes Preemption Events in your observability system assuming you are exporting your Kubernetes Events to some store like some time series DB or similar In our case, we use Prometheus and we have an exporter for exporting the Ku...

Recently, when I discovered the py-spy profiler took for Python, I also discovered Speedscope, which is visualization tool for visualizing performance data (performance profile etc). This is a flamegraph Visualization. I have something of this sort w...

So, today, we had an issue in one of our internal systems called API Tester. It was very slow. Only today it was slow, and the CPU usage was very high according to our monitoring systems, especially since today morning. Before noticing the CPU usage,...

If you have Prometheus running and scraping metrics - You can find Kubernetes list of features enabled information for every feature using kubernetes_feature_enabled metric which gives build information kubernetes_feature_enabled{} The name of the f...

We sometimes resize disks in AWS at Togai. We do this manually. Below is the guide for the same. We only talk about how to increase the size of a disk, not decrease
Follow these steps 🪜 to increase the size of a disk/volume
Do all the steps with the volume attached to the running EC2 instance. All the volumes we use support resizing (increasing the size) of volume while it’s attached to the running EC2 instance. Do check if there are any programs running in the EC2 instance that are dependent on the volume and if it will get affected due to the online resizing of the volume i.e. resizing when it’s attached to the EC2 instance and the EC2 instance is up and running
Find the volume that needs to be resized in AWS Web Console
Click on Modify to modify the volume size
Provide the new volume size - greater than the current volume size and then save changes
Once done, monitor the volume status of the volume to understand and monitor the progress of the volume resize
Once the volume shows that it’s in use and that it’s not in modifying state (it’s probably moved on to optimizing state / completed ✔️ state), follow the below steps
Find out the hypervisor type of the instance. Usually, all the instances we use are Nitro instances. If not sure, use the below command to find out
aws ec2 describe-instance-types --instance-type <instance_type> --query "InstanceTypes[].Hypervisor"
SSH into the EC2 instance that the volume is attached to
Use the following command to find the mount point of the volume and ensure it has no partitions (type part) in it / under it
sudo lsblk
If the volume has partitions, follow https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html or else move on to the next step
Use df -HT to know the file system type, size, mount point and usage
For xfs (XFS) file system, use the following command to resize
sudo xfs_growfs -d <mount-point>
# for example
sudo xfs_growfs -d /blah-mount-point
df -HT again to check if the resize succeeded 🙂References:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modify-volume.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/modify-volume-requirements.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/requesting-ebs-volume-modifications.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-modifications.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html