Date: 2026-01-24
Server: ubuntu@52.0.207.242
Successfully identified and cleaned up safe-to-remove items to free disk space for Docker builds.
- Disk Usage: 83% (40GB used / 49GB total)
- Available Space: 8.5GB
- Status: Insufficient for Docker build (requires 15-20GB)
- Size: 417MB
- Action:
apt-get cleanandapt-get autoclean - Safety: Safe - packages can be re-downloaded
- Size: ~257MB freed
- Action: Removed 7 old kernel packages
- Safety: Safe - current kernel preserved
- Packages Removed:
- linux-headers-6.8.0-1042-aws
- linux-image-6.8.0-1040-aws
- linux-image-6.8.0-1041-aws
- linux-image-6.8.0-1042-aws
- linux-image-6.8.0-1043-aws
- And related packages
- Size: 48MB (reduced)
- Action:
journalctl --vacuum-time=7d - Safety: Safe - kept last 7 days of logs
- Size: ~43MB
- Files:
/var/log/amazon/ssm/amazon-ssm-agent.log(14MB)/var/log/amazon/ssm/amazon-ssm-agent.log.1(29MB)
- Action: Truncated log files
- Safety: Safe - AWS SSM agent will recreate logs
- Size: ~12MB
- Action: Removed
.gzfiles older than 30 days - Safety: Safe - keeps current logs
- Size: ~737MB (733MB cache + 4MB disabled revisions)
- Action:
- Removed disabled snap revisions
- Cleaned
/var/lib/snapd/cache/*directory
- Safety: Safe - active snaps preserved, cache will be regenerated
- Size: ~7MB
- Caches Cleaned:
- debconf (4.7MB)
- apparmor (2.5MB)
- Safety: Safe - caches will be regenerated
- Size: Variable
- Action: Removed files in
/tmpand/var/tmpolder than 7 days - Safety: Safe - temporary files
- Size: ~257MB
- Action:
apt-get autoremove - Safety: Safe - removes only unused dependencies
- Disk Usage: 82% (40GB used / 49GB total)
- Available Space: 9.2GB (increased from 8.5GB)
- Space Freed: ~700MB initially, ~1.4GB total after snap cache cleanup
- Location:
/var/lib/snapd - Size: 1.1GB
- Safety: Requires investigation - may contain active snap data
- Action: Can be cleaned if no active snaps needed
- File:
/opt/diffrhythm/g2p/sources/chinese_lexicon.txt(>10MB) - Safety: Check if needed for production
- Immediate: The cleanup freed ~700MB, but more space is needed for Docker build
- Short-term: Consider cleaning snapd directory if snaps are not needed
- Long-term:
- Increase EC2 EBS volume to 100GB+ (recommended)
- Or build Docker image locally and transfer to server
Created scripts/safe_cleanup_disk_space.sh for future use:
- Safe cleanup operations only
- Preserves system functionality
- Can be run periodically
- Option 1 (Recommended): Increase EC2 storage to 100GB+
- Option 2: Build Docker image locally and transfer
- Option 3: Continue cleanup of snapd if not needed
Status: ✅ Cleanup completed successfully
Space Freed: ~700MB
Remaining Need: Additional 5-10GB for Docker build