Back to articles
Freeing up linux disk space
How-ToDevOps

Freeing up linux disk space

via Dev.to Tutorialleroykayanda

Check how how much space journal logs are taking up. sudo journalctl --disk-usage Archived and active journals take up 4.0G on disk. sudo du -h --max-depth=1 /var/log/journal | sort -hr 4.1G /var/log/journal/ec2d0f46985d6ec5013a525e909aa54e 4.1G /var/log/journal Keep only 7 days of logs. sudo journalctl --vacuum-time=7d Do a docker cleanup. docker system prune -a WARNING! This will remove: - all stopped containers - all networks not used by at least one container - all images without at least one container associated to them - all build cache Check how much space container logs are taking. sudo find /var/lib/docker/containers -name "*-json.log" -exec du -h {} + | sort -hr | head 3.1G /var/lib/docker/containers/ef043adc7a49077b85990e843cb510277b08485d4c024c7cb03f931fd194213f/ef043adc7a49077b85990e843cb510277b08485d4c024c7cb03f931fd194213f-json.log 2.2G /var/lib/docker/containers/215f590bf565d1c535bde30be7ad157280e1c564f67170f8cacef51a689a106d/215f590bf565d1c535bde30be7ad157280e1c564f671

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
7 views

Related Articles