EBS Volume High Disk Usage
CostLens detects EBS volumes approaching capacity and automatically expands them to prevent service disruption.
When an EBS volume fills up completely, applications crash and data writes fail. CostLens monitors disk usage on your EC2 instances via CloudWatch Agent metrics and flags volumes that have reached 80% or more of their capacity — giving you time to act before a service disruption occurs.
Unlike most CostLens checks, this is a risk-prevention recommendation rather than a cost-saving one. The fix expands the volume by 20%, which adds a small cost but protects your services.
CloudWatch Agent required
This check requires the CloudWatch Agent to be installed and running on your EC2 instances, configured to collect disk_used_percent metrics. Instances without the agent are not evaluated by this check.
How it works
CostLens queries CloudWatch disk metrics
Reads disk_used_percent from the CloudWatch Agent namespace (CWAgent) for each EC2 instance, using the latest data point from the past 30 minutes.
Flags volumes above 80% usage
Any volume with disk usage at or above 80% is flagged. The mount point, device name, and filesystem type are captured in the recommendation.
Calculates the expansion size
Recommends expanding the volume by 20% of its current size (minimum 5 GB). For example, a 100 GB volume becomes 120 GB.
Applies the expansion on fix
Calls ec2:ModifyVolume to expand the EBS volume. The expansion is online — no instance restart required.
What to do
Option 1 — Apply the fix (recommended)
CostLens expands the volume by 20% online. For most filesystems (ext4, xfs), the OS automatically picks up the extra space — no remount or format required.
After applying:
For volumes using xfs filesystems, run on the EC2 instance:
sudo xfs_growfs /mount/pointFor ext4 filesystems:
sudo resize2fs /dev/xvda1Option 2 — Manually expand to a larger size
If 20% is insufficient for your needs, expand the volume manually to a larger target size in the EC2 Console (Volumes → Modify Volume) and then extend the filesystem as above.
Option 3 — Investigate and delete unused data
Before expanding, check whether old logs, temp files, or unused databases are consuming the space:
du -sh /* 2>/dev/null | sort -rh | head -20Cleaning up unused data may resolve the issue without any expansion cost.
Severity levels
Severity is based on the current disk usage percentage:
| Severity | Disk usage |
|---|---|
| critical | ≥ 95% — imminent risk of service failure |
| high | ≥ 90% |
| medium | ≥ 85% |
| low | 80–84% — early warning |
Required IAM permissions
Included in the CostLens IAM policies from AWS Accounts:
cloudwatch:ListMetrics
cloudwatch:GetMetricStatistics
ec2:DescribeInstances
ec2:DescribeVolumes
ec2:ModifyVolume
Installing the CloudWatch Agent
If the CloudWatch Agent is not yet installed on your instances, you can install it via AWS Systems Manager (SSM). In the AWS Console, go to Systems Manager → Run Command and run AWS-ConfigureAWSPackage with AmazonCloudWatchAgent as the package name. After installation, configure it to collect disk_used_percent via the CloudWatch Agent configuration wizard or a pre-built config.