Skip to content

Latest commit

 

History

History
120 lines (92 loc) · 3.52 KB

File metadata and controls

120 lines (92 loc) · 3.52 KB

Disk Space Cleanup Report

Date: 2026-01-24
Server: ubuntu@52.0.207.242

Summary

Successfully identified and cleaned up safe-to-remove items to free disk space for Docker builds.

Initial State

  • Disk Usage: 83% (40GB used / 49GB total)
  • Available Space: 8.5GB
  • Status: Insufficient for Docker build (requires 15-20GB)

Areas Identified for Cleanup

1. APT Cache ✅ CLEANED

  • Size: 417MB
  • Action: apt-get clean and apt-get autoclean
  • Safety: Safe - packages can be re-downloaded

2. Old Kernel Packages ✅ CLEANED

  • 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

3. System Journal Logs ✅ CLEANED

  • Size: 48MB (reduced)
  • Action: journalctl --vacuum-time=7d
  • Safety: Safe - kept last 7 days of logs

4. SSM Agent Logs ✅ CLEANED

  • 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

5. Old Compressed Log Files ✅ CLEANED

  • Size: ~12MB
  • Action: Removed .gz files older than 30 days
  • Safety: Safe - keeps current logs

6. Snap Cache ✅ CLEANED

  • 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

7. Package Manager Caches ✅ CLEANED

  • Size: ~7MB
  • Caches Cleaned:
    • debconf (4.7MB)
    • apparmor (2.5MB)
  • Safety: Safe - caches will be regenerated

8. Temporary Files ✅ CLEANED

  • Size: Variable
  • Action: Removed files in /tmp and /var/tmp older than 7 days
  • Safety: Safe - temporary files

9. Unused Packages ✅ CLEANED

  • Size: ~257MB
  • Action: apt-get autoremove
  • Safety: Safe - removes only unused dependencies

Final State

  • 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

Additional Areas for Future Cleanup

Snapd Directory (1.1GB)

  • Location: /var/lib/snapd
  • Size: 1.1GB
  • Safety: Requires investigation - may contain active snap data
  • Action: Can be cleaned if no active snaps needed

Large Files in Project

  • File: /opt/diffrhythm/g2p/sources/chinese_lexicon.txt (>10MB)
  • Safety: Check if needed for production

Recommendations

  1. Immediate: The cleanup freed ~700MB, but more space is needed for Docker build
  2. Short-term: Consider cleaning snapd directory if snaps are not needed
  3. Long-term:
    • Increase EC2 EBS volume to 100GB+ (recommended)
    • Or build Docker image locally and transfer to server

Cleanup Script

Created scripts/safe_cleanup_disk_space.sh for future use:

  • Safe cleanup operations only
  • Preserves system functionality
  • Can be run periodically

Next Steps

  1. Option 1 (Recommended): Increase EC2 storage to 100GB+
  2. Option 2: Build Docker image locally and transfer
  3. Option 3: Continue cleanup of snapd if not needed

Status: ✅ Cleanup completed successfully
Space Freed: ~700MB
Remaining Need: Additional 5-10GB for Docker build