/var/ memory resources hog half my disk space

Hi there!

I love Endeavour OS and have been using it for several months now. I’ve encrypted my 120GB SSD.

My issue is I’ve been running out of space on my drive. About half now is allocated to /var/log (24.08%) and /var/cache (24.08%). That’s an unusual amount of space. I’ve used Stacer and even bleachbit to clean up my drive, but it doesn’t affect that huge size. I get alerts I’m running out of space all the time.

How did that happen, is it because of the encrypted drive? How can I reduce the size of the var folders? Is there a program I can use or a setting I can change to free up storage?

Thank you

1 Like

Welcome! :rocket:

It’s either journal or pacman cache, see this:

To check size of those caches do:

du -sh "/var/cache/pacman/pkg"
du -sh "/var/log/journal"

In terms of journal i’d do something like that, in case you don’t need to store gigabites of logs:

sudo journalctl --vacuum-size=50M
2 Likes

@keybreak already listed the probable reasons.

To reduce the size of the package cache, you can run the following commands:

sudo paccache -ruk0  # removes cache of uninstalled packages
sudo paccache -rk2   # removes all but 2 latest of each package (=keeps 2)

See also how much space the commands save.

Didn’t you create a cache cleaner setup option into the welcome app also?

Yes. That keeps a system cache automatically in control, by using similar commands as above.

Welcome @Significant_Ad to an awesome community.

So that explains why there are no candidates to delete when I run the command paccache.

1 Like

So, that’s a problem I have with some of the welcome apps and it feeds the idea of Endeavour being a “beginner distro.” It’s a fine tool. But you don’t even seem to know what you setup in the welcome center. You should read up on what you’re implementing first. You shouldn’t setup something you don’t actually seem to understand.

1 Like

@Significant_Ad

If you believe that you won’t face any issue in the future because of which you need to downgrade, then you can nuke with:

rm -rf to those folders.

sudo pacman -Sc is also good.

If you want to nuke even more then :

sudo pacman -Scc

:+1:

You should probably avoid this, as this method is not recommended by maximum users.

These steps should be unnecessary. It’s not a great suggestion to burn all backups in entirety. The tips provided shouldn’t take more than a couple hundred megabites in total and help them out immensely.

Obviously @Significant_Ad , if I were me, I’d look over the link provided by @keybreak and that should take care of the overwheming majority of your clogged diskspace.

2 Likes

That’s why I told if you believe to take the risk…

Maybe these help:

And this too:

welcome

It’s a great tool and resource, but I guess like most things, no one actually reads the printed materials that come with anything. Be it a grill or an OS, it’s all the same.

1 Like

That’s something that nobody else can help with. :wink:

2 Likes

helpful-user-guide-nope

3 Likes

Maybe it was intended only for helpful users?? More of those running around loose here than in most places…

Thank you for your responses, Ive attempted many of them before.

I’m not exactly a noob, but I remain stumped on this one.

Maybe since my disk is encrypted, the /var/log/ and /var/cache/ folders give the same file size amount? Both are incorrect.

The actual problem, I’ve found out, is that once I move a file to trash, then empty the trash (delete), the storage does not change.

bleachbit recovers over 1G of data. Storage does not change. I’m close to 100%.

I don’t think it’s permissions and don’t think it’s /etc/fstab.

I’ve been running linux since the 3.4 kernel and never had this issue before.

Will gladly post any results someone more experienced than me will ask for.

Here is my /etc/fstab

/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d / btrfs subvol=/@,defaults,noatime,compress=zstd,discard=async,ssd 0 0
/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d /home btrfs subvol=/@home,defaults,noatime,compress=zstd,discard=async,ssd 0 0
/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d /var/cache btrfs subvol=/@cache,defaults,noatime,compress=zstd,discard=async,ssd 0 0
/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d /var/log btrfs subvol=/@log,defaults,noatime,compress=zstd,discard=async,ssd 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

I used a btrfs snapshot a month back when I uninstalled some programs. Could that have affected something?

It is like this

/etc/fstab

/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d / btrfs subvol=/@,defaults,noatime,compress=zstd,discard=async,ssd 0 0
/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d /home btrfs subvol=/@home,defaults,noatime,compress=zstd,discard=async,ssd 0 0
/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d /var/cache btrfs subvol=/@cache,defaults,noatime,compress=zstd,discard=async,ssd 0 0
/dev/mapper/luks-97615d9f-31d0-4004-b366-66195bdec86d /var/log btrfs subvol=/@log,defaults,noatime,compress=zstd,discard=async,ssd 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

Thank you very much

Can you share with us:

sudo btrfs su li /
sudo btrfs fi us /

Maybe you need to run disk re-balance and/or remove some snapshots