Understanding systemd journald disk usage on Linux
Journald is the systemd component that collects and stores system logs on Linux systems. On production servers uncontrolled journal growth can fill root or persistent partitions, causing service outages, failed updates, and alert storms. This guide focuses on practical steps to manage journald disk usage, including configuration, cleanup, compression, relocation, and monitoring.
Before applying limits in production, identify where journals are stored, how fast they grow, and which services emit the largest volume of logs. That baseline helps you choose sane size limits, retention policies, and automation that prevent disk exhaustion while preserving necessary audit data.
Default journal storage and rotation behavior
By default journald stores volatile logs in /run/log/journal which lives in tmpfs, and persistent logs in /var/log/journal when that directory exists. Without persistent storage the logs are ephemeral across reboots, which may mask long term growth on systems that enable persistent logging. Rotations are automatic but the defaults do not impose tight disk quotas.
Journald supports options for max file size, total storage, and age based retention. These settings live in /etc/systemd/journald.conf. Changing them affects future entries, not already written files, so you will usually combine configuration changes with vacuuming and housekeeping to reclaim space immediately.
Configure persistent storage and size limits
Create or verify /var/log/journal to enable persistent storage, then edit /etc/systemd/journald.conf to set limits. Key options include SystemMaxUse, SystemKeepFree, SystemMaxFileSize, and RuntimeMaxUse. Use conservative values on production servers to avoid competing with application data for disk space.
Example sensible settings are: set SystemKeepFree to reserve a few gigabytes for critical processes, set SystemMaxUse to a percentage or explicit size that matches available disk, and limit SystemMaxFileSize to prevent single journal files from growing too large. After editing, reload the journald unit to apply changes.
Use journalctl vacuum and rotate to reclaim space
Journalctl provides built in commands to remove old logs and force rotation. Vacuuming is safe and can be scripted for maintenance windows. Prefer age based or size based vacuuming to target only the excess entries, rather than deleting everything.
- journalctl –vacuum-size=500M, remove oldest entries until usage is under 500 MB
- journalctl –vacuum-time=2weeks, remove entries older than two weeks
- journalctl –rotate, force the creation of a new journal file so vacuuming can remove older files
Run vacuum commands during low activity, and combine rotate then vacuum to ensure active streams are captured properly. For automation use cron or systemd timers to schedule these commands during maintenance windows.
Compress and relocate journals to free space
Journald already compresses archived data, but you can further reduce pressure by moving archives to a dedicated volume or mounting /var/log/journal on a separate partition. Relocating journals isolates log growth from the root filesystem, which is critical for multi tenant hosts and containers.
To move journals: create a new volume, format and mount it at /var/log/journal, then copy existing files with rsync while preserving attributes, validate permissions, and restart journald. This approach keeps logs persistent while protecting the operating system partition.

Prevent log storms: rate limiting and facility filters
High log volume often comes from noisy services or fault loops. Before tightening global limits, identify the top log producers with journalctl and address root causes. Rate limiting and selective filtering reduce noise and long term storage needs.
- Use RateLimitInterval and RateLimitBurst in journald.conf to limit how many messages are written in a time window
- Configure rsyslog or a forwarder to drop debug level messages, or use systemd unit log levels to lower verbosity for specific services
Apply facility or unit level log level adjustments in service unit files with Systemd options or the service configuration to avoid losing important error messages while reducing volume from verbose components.
Monitoring disk usage and alerting for journals
Continuous monitoring prevents surprises. Track both filesystem free space and the size of journal storage with monitoring tools or simple scripts. Alerting on thresholds such as 80 percent usage or when SystemKeepFree is breached gives you time to remediate before services fail.
Metrics to collect include: size of /var/log/journal, output of journalctl –disk-usage, and free space on the partition. Push these metrics to your existing monitoring stack, or use cron scripts that emit Prometheus node exporter textfile metrics for cheap integration.
Automate maintenance with cron and systemd timers
Automate vacuuming, rotation, and archival with systemd timers or cron jobs. Systemd timers are preferable on modern systems because they integrate with systemd transaction ordering and provide better logging for scheduled tasks. Create a small script that rotates then vacuums journals, and schedule it weekly or monthly depending on log rate.
Include safety checks in automation, for example refuse to vacuum if free space is already below a critical threshold, log actions to a separate file, and send notifications on failures. Automation reduces human error during incident response and enforces consistent policies across servers.
Troubleshooting common issues when limiting journals
After applying limits you may see missing logs or complaints from auditing systems. To troubleshoot, first confirm configuration files are parsed with systemd-analyze or by checking journald status. Verify permissions on /var/log/journal, and check that rotated journal files are readable by systemd-journald.
If services appear to lose logs, increase targeted retention temporarily while you investigate. Use journalctl –verify to check integrity of journal files, and inspect systemctl status systemd-journald to view runtime errors. Reconcile any audit requirements with your retention policy before tightening limits further.
FAQ
Below are common operational questions and concise answers to help you apply these changes safely on Linux servers.
- Can I delete /var/log/journal to free space: Deleting the directory removes persistent logs, which may be unacceptable for audits. Prefer vacuuming, moving journals to another volume, or adjusting retention settings.
- Will limiting journals break system auditing: It can if limits are too strict. Coordinate with compliance teams, test settings on staging, and keep critical audit logs backed up before enforcing small SystemMaxUse values.
- How often should I vacuum journals: That depends on log volume. Low volume servers can run monthly tasks, while high volume hosts need weekly or daily maintenance. Use monitoring to decide cadence.
- Is it safe to mount /var/log/journal on network storage: It is possible, but be cautious. Network outages can affect logging and systemd operations. Prefer local fast storage, or ensure robust connectivity and fallback behavior.
Conclusion
Managing systemd journald disk usage on Linux servers is a practical mix of configuration, cleanup, relocation, and monitoring. Start by understanding where your logs are stored and how quickly they grow, then apply conservative limits in /etc/systemd/journald.conf, enable persistent storage when appropriate, and vacuum existing files to reclaim space. Relocating journals to a dedicated partition protects the operating system from log driven disk exhaustion, while rate limiting and targeted filter rules reduce noise from noisy services.
Automation using systemd timers or cron improves reliability and ensures housekeeping runs predictably. Always validate configuration changes in non production environments and maintain communication with compliance or security stakeholders before reducing retention. Lastly, integrate simple metrics for journal size and filesystem free space into your monitoring stack, so you get actionable alerts before the disk becomes full. With these steps you maintain operational continuity, keep useful logs available for troubleshooting and compliance, and prevent costly outages due to unexpected journal growth.