I’ve had an Ubuntu 22.04 setup going for around a year, and over that year I’ve had to increase the size of the partition holding my /var folder multiple times. I’m now up to 20GB and again running into problems, mainly installing new apps, because that partition is again nearly full. I’ve used commands sudo apt clean and sudo journalctl --vacuum-size=500 to temporarily clear up some space, but it doesn’t take long to fill back up, and gets less effective with time, til I have no choice but to expand the partition again.

Am I doing something wrong? Is it normal to need 20GB+ for var? Is there a way to safely reclaim space I don’t know about?

11 points
*

If you suspect that the issue is journald, you can use the following command to check how much space it is using:

journalctl --disk-usage

Rather than periodically running journalctl --vacuum-size=500 to free up space, you can just limit the journal by adding the following to a new file such as /etc/systemd/journald.conf.d/size.conf:

[Journal]
SystemMaxUse=512M

This will limit the journal from using more than 512MB. That said, if journald is filling up fast, then something is spamming your logs and you could run journalctl -a -f to get a sense of what is being written to your logs.

permalink
report
reply

We can’t really help until you tell us what’s using the space. Could be databases, could be docker, could be logs.

I use… du -xh --max-depth 2 /var/ | sort -h

permalink
report
reply
7 points

Install ncdu, then sudo ncdu -x /var it’ll tell you what is taking up space, then if you tell us, we can help you identify how to minimize it and keep it low.

permalink
report
reply
7 points
*

You can use du -sh to figure out what’s using most of the space. Something along the line of:

sudo -i
du -sh /home /usr /var
du -sh /var/*
du -sh /var/log/*
# etc

If it’s one of your log files (likely), you can run something like tail -n 100 /var/log/[culprit] or tail -F /var/log/[culprit] to see what is being flooded in this log file exactly. Then you can try to fix it.

permalink
report
reply
5 points

There’s probably some program that’s filling up /var/log. Check that directory.

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.6K

    Monthly active users

  • 5.8K

    Posts

  • 162K

    Comments