{"id":916,"date":"2026-08-18T23:40:27","date_gmt":"2026-08-18T23:40:27","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=916"},"modified":"2026-09-27T22:03:50","modified_gmt":"2026-09-27T22:03:50","slug":"small-vps-disk-full-find-and-reclaim-space","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/","title":{"rendered":"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A full disk on a production VPS rarely announces itself politely. Services fail to write logs, databases refuse connections, and the first symptom is usually a generic 500 with no useful message. This is a methodical reclaim procedure: quantify what is large, decide what is safe to delete, and verify the space actually came back. Every step below is measured, not guessed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 0: Confirm It Is Really a Space Problem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two different failures look identical from the application side. Run both checks before deleting anything.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -hT \/\ndf -i \/\nstat -f -c 'blocks free: %f  files free: %d' \/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>df -h<\/code> shows free space but <code>df -i<\/code> shows 100 percent inode usage, the fix is finding millions of tiny files, not large ones. If both show space, check for <strong>deleted-but-open<\/strong> files, a classic cause of 100 percent usage that <code>du<\/code> cannot see.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsof -nP +L1 | sort -k7 -n | tail -20<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Any process holding megabytes of deleted files will not release them until restarted or reloaded (SIGHUP often works for daemons). Restarting the offending process returns the space instantly with no deletion risk.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Attribute Usage by Directory, Sorted<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>du<\/code> with a depth limit so it stays fast, then drill down only into the large branches.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -x -d1 -h \/ 2>\/dev\/null | sort -h | tail -15\n# then, for the biggest branch:\ndu -x -d1 -h \/var 2>\/dev\/null | sort -h | tail -15<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-x<\/code> flag keeps the walk on one filesystem, which prevents <code>du<\/code> from wandering into mounted volumes and misattributing their size. In practice four locations account for the vast majority of runaway usage on small VPS instances.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Location<\/th><th>Typical culprit<\/th><th>Safe reclaim method<\/th><th>Risk<\/th><\/tr><\/thead><tbody><tr><td>\/var\/log\/journal<\/td><td>Unbounded systemd journal<\/td><td><code>journalctl --vacuum-size=200M<\/code><\/td><td>None<\/td><\/tr><tr><td>\/var\/log<\/td><td>Rotated but uncompressed logs<\/td><td><code>logrotate -f \/etc\/logrotate.conf<\/code><\/td><td>Low<\/td><\/tr><tr><td>\/var\/lib\/docker<\/td><td>Dangling images, stopped containers<\/td><td><code>docker system prune -a<\/code><\/td><td>Medium<\/td><\/tr><tr><td>\/var\/lib\/mysql<\/td><td>Binary logs \/ relay logs<\/td><td><code>PURGE BINARY LOGS BEFORE ...<\/code><\/td><td>High<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Cap Journald So It Cannot Regrow<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Vacuuming once fixes today. Editing the config fixes every month after that.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/etc\/systemd\/journald.conf.d\ncat >\/etc\/systemd\/journald.conf.d\/99-cap.conf <<'EOF'\n[Journal]\nSystemMaxUse=300M\nSystemMaxFileSize=50M\nMaxRetentionSec=2week\nEOF\nsystemctl restart systemd-journald\njournalctl --disk-usage<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On a 25 GB VPS, a 300 MB journal cap is generous while still leaving weeks of history for post-incident forensics.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Container and Layer Bloat<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Docker is the single most common silent consumer on a small VPS. Each image pull leaves an intermediate layer set, and stopped containers retain their writable layer. Inspect before you prune, because <code>prune -a<\/code> will remove images you still need.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker system df -v | head -40\ndocker image ls --format '{{.Repository}}:{{.Tag}}\\t{{.Size}}' | sort -k2 -h\ndocker container ls -a --size --format '{{.Names}}\\t{{.Size}}'\n# reclaim only dangling layers first\ndocker image prune -f\ndocker builder prune -f --filter until=168h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On a host that builds images, the build cache usually dwarfs the images. Cap it in the daemon config so it cannot grow without bound:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat >\/etc\/docker\/daemon.json <<'EOF'\n{\n  \"log-driver\": \"json-file\",\n  \"log-opts\": { \"max-size\": \"10m\", \"max-file\": \"3\" }\n}\nEOF\nsystemctl restart docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>log-opts<\/code> block matters more than the prune: unbounded container stdout logs are how \/var\/lib\/docker silently doubles in a month on a busy host.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Finding the Million-File Case<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When <code>df -i<\/code> is the number that is full, aggregate by directory count rather than size. A PHP session directory, a mail queue, or a web cache with a broken eviction policy can hold millions of 4 KB files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -xdev -type d -printf '%p\\n' 2>\/dev\/null | while read d; do\n  n=$(find \"$d\" -maxdepth 1 -type f 2>\/dev\/null | wc -l)\n  [ \"$n\" -gt 5000 ] && echo \"$n $d\"\ndone | sort -rn | head -20<\/code><\/pre>\n\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Find Duplicate or Stale Large Files<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Files over 200 MB: <code>find \/ -xdev -type f -size +200M -printf '%s %p\\n' | sort -n | tail -30<\/code><\/li><li>Core dumps: <code>find \/ -xdev -name 'core*' -size +10M<\/code> and disable with <code>sysctl -w kernel.core_pattern='|\/bin\/false'<\/code> if you do not collect them.<\/li><li>Old kernels: <code>apt-get autoremove --purge<\/code> on Debian\/Ubuntu reclaims hundreds of megabytes safely.<\/li><li>Package cache: <code>apt-get clean<\/code> and <code>dnf clean all<\/code>.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Verify the Reclaim, Then Add a Guard Rail<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Always re-run <code>df -h<\/code> after each action rather than batching everything and hoping. Record a before\/after table in your runbook so the next operator knows what worked. Finally, install a simple threshold alert so you never discover a full disk through a customer again - a five-line systemd timer writing to your monitoring endpoint is enough, and <a href=\"https:\/\/virtualserversvps.com\/\">our VPS comparison table<\/a> flags plans that include disk-space alerting by default.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If reclaiming space becomes a monthly chore rather than an incident, the underlying plan is simply too small. The sizing breakdown in <a href=\"https:\/\/virtualserversvps.com\/\">the VPS guides hub<\/a> walks through matching disk allocation to workload, and the plan table at <a href=\"https:\/\/virtualserversvps.com\/\">our VPS comparison table<\/a> lists overcommit ratios per tier so you can see what you are actually buying.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A full disk on a production VPS rarely announces itself politely. Services fail to write logs, databases refuse connections, and the first symptom is usually a generic 500 with no&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-916","post","type-post","status-publish","format-standard","hentry","category-vps-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"A full disk on a production VPS rarely announces itself politely. Services fail to write logs, databases refuse connections, and the first symptom is\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits\" \/>\n<meta property=\"og:description\" content=\"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-18T23:40:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-27T22:03:50+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/\",\"name\":\"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-08-18T23:40:27+00:00\",\"dateModified\":\"2026-09-27T22:03:50+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"A full disk on a production VPS rarely announces itself politely. Services fail to write logs, databases refuse connections, and the first symptom is\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits - Virtual Servers VPS Blog","description":"A full disk on a production VPS rarely announces itself politely. Services fail to write logs, databases refuse connections, and the first symptom is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/","og_locale":"en_US","og_type":"article","og_title":"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits","og_description":"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits","og_url":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-08-18T23:40:27+00:00","article_modified_time":"2026-09-27T22:03:50+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/","url":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/","name":"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-08-18T23:40:27+00:00","dateModified":"2026-09-27T22:03:50+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"A full disk on a production VPS rarely announces itself politely. Services fail to write logs, databases refuse connections, and the first symptom is","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/small-vps-disk-full-find-and-reclaim-space\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Reclaiming Disk Space on a Full VPS: A Measured Procedure with du, lsof and Journald Limits"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=916"}],"version-history":[{"count":5,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/916\/revisions"}],"predecessor-version":[{"id":1236,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/916\/revisions\/1236"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}