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?

  • orsetto@beehaw.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

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

  • The Doctor@beehaw.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    There’s a way to figure out what is responsible for using up all of that space. A couple of ways, really. Here’s the one I use, though: du -s -h -x /path/to/ | sort -h -r | head -n 10*

    • du
      • -s - display only a total for each argument
      • -h - human readable values
      • -x - do not cross file systems (in case you have another directory tree mounted under /var, which’ll complicate figuring out what’s in there for this purpose)
    • sort
      • -h - compare human readable numbers (e.g., 1G, 2T)
      • -r - reverse sort (biggest first)
    • head
      • -n 10 (first ten lines or less)
    • example@reddthat.com
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      ncdu makes it even easier if you want to interactively browse through folders to see which files exactly are eating up space

  • tychosmoose@lemm.ee
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    See what’s using the space. This will list any dirs using >100MiB:

    sudo du -h -d 5 -t 100M /var

  • phx@lemmy.ca
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    If I had to guess, I’d say it’s probably snaps. I’ve had the same issue and they’ve slowly been taking up more and more of my space, often with new gnome snaps being installed but the old ones not removed.

    Try “snap list” to see what’s installed as snap

  • wewbull@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Are you using docker on BTRFS?

    Docker makes use of BTRFS snapshots, but it snapshots the whole volume. That means as other programs delete/rewrite files, the old copies still exist in the snapshot. I’ve ended up putting /var/lib/docker on it’s own filesystem.

  • axum@kbin.social
    link
    fedilink
    arrow-up
    2
    arrow-down
    3
    ·
    1 year ago

    20gb for a Linux workstation is embarrassingly tiny in 2023… Hell it’s barely passable for a phone