
On Tue, 4 Apr 2023 at 17:50, D. Hugh Redelmeier via talk <talk@gtalug.org> wrote:
(This post is also a test of whether the mailing list is working.)
GTALUG's server's filesystem filled up: little disk space left.
I discovered this when I tried to do "apt update; apt full-upgrade". The second step failed, saying that /var/cache/apt/archives had no room. This means that / has no room because / contains that directory.
Tip: "df /some/path" will tell you how much space is used on the filesystem containing /some/path and it will tell you the mount point of that file system.
I wandered around the filesystem, doing: sudo df -s * | sort -n
This command lists things in the current directory, and their sizes, largest last. (It skips things with names starting with ".".)
Pretty soon, I found that most of the space was taken up by /var/cache/apt/archives after all. This kind of surprised me.
Googling got me to others with this problem. The advice: sudo apt autoclean That gave back (only) 3% of the disk.
That directory was still way too big. Most of the space was taken by 35 versions of gitlab-runner. I have no idea why we need multiple versions.
Violence is sometimes the answer. sudo apt clean
That left only 32% of / used.
Note /var/cache/apt/archives is only a cache. If the system wants any of these, it should be able to find them in a repo.
I used to use a method very similar to yours - I presume you meant 'du' not 'df'. I used 'du -sh * | sort -h' which I found easier to read and understand. But then - "Hallelujah" (let's make this a religious discovery) I found 'ncdu', which is a TUI that does exactly the same thing, but makes it explorable by selecting and entering any directory to see the same listing inside that new dir. Give it a try: it makes the whole process of finding space-hogging directories immensely faster. And because it's a TUI, not a GUI, it works on remote hosts over SSH even if they don't have X/Wayland. I don't know how long it's been in the Debian repos: it's in the current Debian, it may not be in older ones. -- Giles https://www.gilesorr.com/ gilesorr@gmail.com