{"id":2290,"date":"2018-05-05T12:00:24","date_gmt":"2018-05-05T06:30:24","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2290"},"modified":"2026-09-20T15:45:13","modified_gmt":"2026-09-20T10:15:13","slug":"clear-journal-logs-on-linux-host","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/clear-journal-logs-on-linux-host\/","title":{"rendered":"How to Clear and Manage Systemd Journal Logs on Linux"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Systemd journal logs are stored under <code>\/var\/log\/journal<\/code> and can gradually consume a significant amount of disk space on Linux servers. When <code>\/var<\/code> becomes full, excessive journal logs can contribute to disk-space issues and may affect system services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This article explains how to safely reduce the size of systemd journal logs using <code>journalctl<\/code> and configure a maximum disk-space limit for persistent journal logs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before clearing systemd journal logs, ensure the following requirements are met:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Root or sudo access<\/strong> to the Linux server.<\/li>\n\n\n\n<li>The server should be running a <strong>systemd-based Linux distribution<\/strong> such as CentOS, AlmaLinux, Rocky Linux, RHEL, Ubuntu, or Debian.<\/li>\n\n\n\n<li>Verify that the <strong>systemd-journald<\/strong> service is available and running.<\/li>\n\n\n\n<li>Ensure there is sufficient access to edit the <code>\/etc\/systemd\/journald.conf<\/code> configuration file.<\/li>\n\n\n\n<li>Check the current disk usage and confirm that journal logs are consuming excessive space under <code>\/var<\/code> or <code>\/var\/log\/journal<\/code>.<\/li>\n\n\n\n<li>Ensure that any logs required for <strong>troubleshooting, auditing, or compliance purposes<\/strong> are backed up before removing older entries.<\/li>\n<\/ol>\n\n\n<h2>Implementation<\/h2>\n<p>We ran out of disk space on our server, and \/var consumes more disk space. On checking further,\u00a0 <em>\/var\/log\/journal\u00a0<\/em>consumes more disk space.<\/p>\n<p>The safest way to remove unnecessary entries via journalctl<\/p>\n<p><code>journalctl --vacuum-size=128M<\/code><\/p>\n<p>Now, verify journalctl.<\/p>\n<p><code>journalctl --verify<\/code><\/p>\n<p>Edit\u00a0<span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\"><em>SystemMaxUse\u00a0<\/em>in<\/span><em>\/etc\/systemd\/journald.conf<\/em><\/p>\n<p><code>vi \/etc\/systemd\/journald.conf<br \/><\/code>SystemMaxUse=128M<\/p>\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Regularly managing systemd journal logs helps prevent <code>\/var<\/code> from consuming excessive disk space. The <code>journalctl --vacuum-size=128M<\/code> command can remove older journal entries while retaining logs within the specified size limit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring <code>SystemMaxUse=128M<\/code> in <code>\/etc\/systemd\/journald.conf<\/code> also helps control the amount of disk space that journald can use. After making configuration changes, reload or restart <code>systemd-journald<\/code> and periodically verify disk usage to ensure the setting is effective.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What is the systemd journal log?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The systemd journal is a centralized logging system used by Linux to collect and store system and service logs. These logs are commonly stored under <code>\/var\/log\/journal<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Why does <code>\/var\/log\/journal<\/code> consume a lot of disk space?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Journal logs can grow over time as the system continuously records messages from the kernel, services, applications, and other system components.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Does <code>journalctl --vacuum-size=128M<\/code> delete all journal logs?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. It removes older archived journal files as necessary to reduce the total journal size to the specified limit. The currently active journal file is not removed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/bash-script-for-login-details-logs\/\">Bash Script to Capture Login Activity Logs<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<br><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business?. Our experts can help with\u00a0web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team\u00a0<a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Systemd journal logs are stored under \/var\/log\/journal and can gradually consume a significant amount of disk space on Linux [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[406,261],"class_list":["post-2290","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-journal","tag-linux","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-AW","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2290"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2290\/revisions"}],"predecessor-version":[{"id":11858,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2290\/revisions\/11858"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}