<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ambetazam on Medium]]></title>
        <description><![CDATA[Stories by Ambetazam on Medium]]></description>
        <link>https://medium.com/@ambetazam?source=rss-5dd5b9da0a3c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-OQFJ7smSo3yQK1-</url>
            <title>Stories by Ambetazam on Medium</title>
            <link>https://medium.com/@ambetazam?source=rss-5dd5b9da0a3c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:30:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ambetazam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Fix 100% Disk Usage in Linux: A Step-by-Step Troubleshooting Guide]]></title>
            <link>https://medium.com/@ambetazam/how-to-fix-100-disk-usage-in-linux-a-step-by-step-troubleshooting-guide-6703d6ea0f11?source=rss-5dd5b9da0a3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6703d6ea0f11</guid>
            <category><![CDATA[linux-system-admin]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux-troubleshooting]]></category>
            <category><![CDATA[linux-command-line]]></category>
            <dc:creator><![CDATA[Ambetazam]]></dc:creator>
            <pubDate>Sun, 11 Oct 2026 04:14:39 GMT</pubDate>
            <atom:updated>2026-10-11T04:14:39.062Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhgn65II4vKUUxN47R-8Tw.png" /></figure><p><em>fix-100-percent-disk-usage-linux</em></p><p><strong><em>Learn how to diagnose a full Linux filesystem using </em></strong><strong><em>df, </em></strong><strong><em>du, inode checks, and evidence-based troubleshooting.</em></strong></p><p>There is a particular kind of frustration that comes with a Linux system running out of disk space.</p><p>A command that worked yesterday suddenly fails. Package installations stop working. Applications struggle to save files, and routine maintenance becomes a troubleshooting session.</p><blockquote>My instinct used to be to start deleting things.</blockquote><p>Old packages, cached files, applications I rarely used — anything that looked unnecessary became a potential candidate.</p><blockquote>But deleting files before understanding the problem is not troubleshooting. It is guessing.</blockquote><p>I decided to approach this problem differently: measure first, investigate the evidence, form a hypothesis, apply the smallest appropriate fix, and verify the outcome.</p><p>Here is the process I use as a starting point for investigating a full Linux filesystem.</p><h3>1. Confirm the problem with df -h</h3><p>The first question is not <em>What can I delete?</em></p><p>It is <em>Which filesystem is running out of space?</em></p><p>On Linux, the df command reports filesystem disk-space usage. Its -h option displays sizes in a human-readable format.</p><pre>df -h</pre><p>To focus on the root filesystem specifically, run:</p><pre>df -h /</pre><p>For a deeper explanation, see the <a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html">GNU Coreutils documentation for </a><a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html">df</a>.</p><p>This is important because a Linux system may have several partitions, logical volumes, and mounted filesystems. The root filesystem can be full even when another mounted drive still has plenty of free space.</p><h3>A real troubleshooting observation</h3><p>In one incident I documented, the root filesystem on /dev/mmcblk1p2 had a reported capacity of 29 GB and reached 100% usage. After cleanup, its reported usage decreased to 98%.</p><p>The following is a sanitized summary of those recorded results, not a verbatim terminal transcript:</p><pre>Before cleanup — summarized from my notes</pre><pre>Filesystem       Size   Use%   Mounted on<br>/dev/mmcblk1p2    29G   100%   /</pre><pre>After cleanup — summarized from my notes</pre><pre>Filesystem       Size   Use%   Mounted on<br>/dev/mmcblk1p2    29G    98%   /</pre><p>The result gave the system some breathing room, but 98% usage is still dangerously close to full. It should be treated as partial recovery, not proof that the underlying problem has been completely solved.</p><p>My notes do not establish which specific directory or cleanup command accounted for the improvement. Rather than inventing a cause, the next step is to investigate the remaining disk usage.</p><p>That distinction matters: record what the evidence proves, and keep unanswered questions open.</p><h3>2. Check inode usage with df -i</h3><p>Disk capacity is not the only resource that can run out.</p><p>Filesystems also manage inodes, which store information about files and directories. A filesystem can run out of available inodes even when it has some disk space remaining.</p><p>Check inode usage with:</p><pre>df -i /</pre><p>Compare the inode usage percentage with the disk-space usage reported by df -h /.</p><p>If inode usage is at 100%, investigate whether the filesystem contains an unusually large number of small files. The <a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html">GNU documentation for </a><a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html">df</a> explains both disk-space and inode reporting.</p><p>This gives us two distinct possibilities:</p><ul><li>The filesystem has exhausted its available storage capacity.</li><li>The filesystem has exhausted its available inodes.</li></ul><p>They can require different investigations, so we should not treat them as the same failure.</p><h3>3. Find the directories consuming the most space</h3><p>Once the affected filesystem is identified, the next task is to locate the directories consuming the space.</p><p>On a GNU/Linux system, run:</p><pre>sudo du -xhd1 / 2&gt;/dev/null | sort -h</pre><p>Here is what the command does:</p><ul><li>sudo allows access to directories requiring administrative permissions.</li><li>du estimates disk usage.</li><li>-x prevents the scan from crossing into other filesystems.</li><li>-h displays human-readable sizes.</li><li>-d1 limits the report to one directory level.</li><li>2&gt;/dev/null suppresses error messages.</li><li>sort -h sorts the results by human-readable size.</li></ul><p>Consult the <a href="https://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html">GNU Coreutils documentation for </a><a href="https://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html">du</a> for more details.</p><p>Suppose the results indicate that /var is unusually large. I would investigate its immediate subdirectories next:</p><pre>sudo du -xhd1 /var 2&gt;/dev/null | sort -h</pre><p>The space might be consumed by logs, cached packages, container data, or another application.</p><p>These are hypotheses, not conclusions. The output should determine which directory deserves further inspection.</p><h3>4. Inspect before deleting</h3><p>Suppose the investigation points to the APT package cache on a Debian-based distribution, such as Debian, Ubuntu, Linux Mint, or Kali Linux.</p><p>First, inspect its size:</p><pre>sudo du -sh /var/cache/apt/archives</pre><p>If the cache is significant and you have determined that cached package downloads are appropriate to remove, APT provides a built-in cleanup command:</p><pre>sudo apt clean</pre><p>According to the <a href="https://manpages.debian.org/testing/apt/apt-get.8.en.html">Debian APT documentation</a>, apt clean clears downloaded package files from the local APT archive cache. It does not uninstall the applications already installed on the system.</p><p>Afterward, check the filesystem again:</p><pre>df -h /</pre><p>The important point is that this action follows evidence. I identified the affected filesystem, inspected the directories consuming space, and selected a cleanup option that matched the suspected cause.</p><p>If the largest directory belongs to Docker, an application, or system logs, APT cleanup may accomplish very little. Each situation needs its own investigation.</p><h3>5. Investigate when df and du disagree</h3><p>Sometimes, df reports that a filesystem is nearly full, but du cannot account for the space.</p><p>One possible explanation is a deleted file that is still held open by a running process.</p><p>On Unix-like systems, deleting a file removes its directory entry. However, its storage may remain allocated until the last process holding it open releases it.</p><p>If lsof is installed, investigate with:</p><pre>sudo lsof +L1</pre><p>This command helps identify open files whose link count has fallen below one, including deleted files that remain open.</p><p>The <a href="https://github.com/lsof-org/lsof/blob/master/docs/faq.md">lsof documentation</a> explains why such files may consume storage without appearing in ordinary directory listings.</p><p>If a large deleted file is identified, investigate the process holding it open and determine the safest way to release it. Avoid terminating processes blindly, especially on production systems.</p><p>The discrepancy between df and du is a clue, not proof of a single cause. Other filesystem and mount-related explanations are possible.</p><h3>6. Verify the result instead of assuming success</h3><p>A troubleshooting session is not complete merely because a command executed without displaying an error.</p><p>After a corrective action, run:</p><pre>df -h /<br>df -i /</pre><p>Then repeat the relevant directory inspection if necessary.</p><p>Ask three questions:</p><ol><li>Did the available disk space increase?</li><li>Did inode usage change, if inode exhaustion was suspected?</li><li>Can the operation that originally failed now succeed?</li></ol><p>If the problem persists, return to the evidence. Do not keep repeating the same cleanup command or deleting more files simply because the first attempt helped a little.</p><p>In my recorded case, moving from 100% to 98% usage was progress, but it was not a complete resolution. A good troubleshooting record makes that distinction explicit.</p><h3>7. My repeatable Linux troubleshooting checklist</h3><p>I want each investigation to follow a process simple enough to reuse:</p><ol><li><strong>Observe:</strong> Record the original error and symptoms.</li><li><strong>Measure:</strong> Check disk capacity with df -h and inode usage with df -i.</li><li><strong>Localize:</strong> Identify large directories with du.</li><li><strong>Form a hypothesis:</strong> Use the results to determine what to inspect next.</li><li><strong>Inspect:</strong> Examine the relevant caches, logs, application data, or processes.</li><li><strong>Intervene:</strong> Choose the smallest appropriate corrective action.</li><li><strong>Verify:</strong> Measure again and test the original operation.</li><li><strong>Document:</strong> Record the cause, commands, outcome, and remaining uncertainty.</li></ol><p>This process can be adapted to many other Linux incidents: failed services, package installation errors, network connectivity problems, permission issues, and unexpected resource consumption.</p><p>The commands change, but the reasoning remains useful.</p><h3>Further reading</h3><p>The following primary technical references explain the commands used in this investigation:</p><ul><li><a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html">GNU Coreutils: </a><a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html">df</a> — Report filesystem disk-space and inode usage.</li><li><a href="https://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html">GNU Coreutils: </a><a href="https://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html">du</a> — Estimate file and directory usage.</li><li><a href="https://manpages.debian.org/testing/apt/apt-get.8.en.html">Debian APT documentation</a> — Understand package-cache cleanup and other APT operations.</li><li><a href="https://github.com/lsof-org/lsof/blob/master/docs/faq.md">lsof documentation and FAQ</a> — Investigate open files and deleted files that still consume disk space.</li></ul><p>The purpose of these references is not simply to provide commands to copy. It is to help readers understand what the commands measure, interpret their output, and choose appropriate corrective actions.</p><h3>Final thoughts</h3><p>Working with Linux has taught me that knowing commands is only part of system administration.</p><p>The deeper skill is knowing which question to ask next.</p><p>Commands such as apt clean, du, and lsof are useful tools, but no command replaces understanding the evidence. A cleanup that frees space is helpful; a documented, verified diagnosis is better.</p><p>I want these notes to record more than the final command that worked. I want to preserve the reasoning behind the investigation, the hypotheses considered, and the evidence that confirms whether a fix was successful.</p><p>That way, the next time a system fails, I will not need to remember a magic command. I will have a method for finding the answer.</p><p>And that is the kind of Linux knowledge worth building: not just knowing how to fix a problem, but learning how to investigate the next one.</p><p><em>This article is part of my ongoing Linux troubleshooting notebook: practical experiments, command-line techniques, and lessons learned from working with open-source systems.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6703d6ea0f11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>