How to Fix /var/log Taking Too Much Space on Linux
If /var/log is huge, Kudu can help clean old logs and recover disk space on Linux.
By Kudu Team
Fix this automatically with Kudu
Run a free system scan to detect and resolve this issue automatically — no manual steps required.
Download Kudu Free →What Causes This?
/var/log grows when Linux services keep writing new log entries and old logs are not rotated, compressed, or deleted properly. Common causes include verbose system logging, application errors that spam logs, failed logrotate jobs, or services like journald, web servers, and package managers keeping too much history. In some cases, a runaway process can generate massive log files in just a few hours.
Common Symptoms
- Disk space keeps shrinking even though you have not saved many new files
- You get “No space left on device” errors
- Updates, installs, or reboots start failing unexpectedly
- The system feels unstable because services cannot write temporary files
/var/logcontains one or more unusually large.log,.gz, or journal files
How to Fix It Manually
-
Check how large
/var/logis- Open a terminal.
- Run:
sudo du -sh /var/log sudo du -h /var/log | sort -h | tail -20 - This shows the total size and the biggest log files or folders.
-
Find the main offender
- Look for large files in places like:
/var/log/journal/var/log/syslog/var/log/messages/var/log/kern.log/var/log/apache2//var/log/nginx/
- To list the biggest files:
sudo find /var/log -type f -printf '%s %p\n' | sort -n | tail -20
- Look for large files in places like:
-
Clean old systemd journal logs
- If
journaldis using too much space, check usage:journalctl --disk-usage - Remove old journal data by size:
sudo journalctl --vacuum-size=200M - Or remove logs older than a few days:
sudo journalctl --vacuum-time=7d
- If
-
Force log rotation
- Run:
sudo logrotate -f /etc/logrotate.conf - This rotates active logs, compresses older ones if configured, and can immediately reduce space usage.
- Run:
-
Delete or truncate oversized logs carefully
- If a specific log file is huge, you can empty it without deleting the file:
sudo truncate -s 0 /var/log/syslog - Replace
/var/log/syslogwith the actual file you found. - Avoid deleting active logs unless you know the service can recreate them safely.
- If a specific log file is huge, you can empty it without deleting the file:
-
Fix the underlying service creating too many logs
- Check recent errors:
sudo tail -100 /var/log/syslog sudo journalctl -xe - If a service is repeatedly failing, restart it after fixing the issue:
sudo systemctl restart servicename - If needed, reduce overly verbose logging in that app’s config.
- Check recent errors:
-
Verify log rotation is working
- Check whether
logrotateis installed and scheduled:which logrotate ls /etc/cron.daily/logrotate - Review config files:
ls /etc/logrotate.d/ - If logs keep growing, a broken rotation rule may need to be corrected.
- Check whether
Fix It Automatically with Kudu
Kudu can scan your Linux system, identify oversized logs in /var/log, and safely clean old log files, cached journals, and other junk that wastes disk space. It is the faster option if you do not want to inspect log folders manually or risk deleting the wrong file.
Fix this automatically with Kudu
Run a free system scan to detect and resolve this issue automatically — no manual steps required.
Download Kudu Free →Related guides
Why Is Cache Taking So Much Space on Linux
Find out why cache keeps growing on Linux and how Kudu can safely remove unnecessary cached files.
Why Is Docker Taking So Much Space on Linux
If Docker is filling your Linux disk, Kudu can help clean cache and temporary container-related clutter.
How to Fix Other Storage Taking Too Much Space on Mac
Reduce oversized Other storage on macOS by cleaning caches, logs, and leftovers with Kudu.
How to Fix OneDrive Taking Up Too Much Disk Space
If OneDrive is filling your drive with local copies, this guide explains why and how Kudu can help reclaim space.