OS cache - recommendations

Hi -
I’m running Kernel 5.15.78-1 with DE Plasma 5.26.3 and have a question about cache accumulating in /

My running system takes about 20g and has another 13g spare in /. According to the tool available in Octopi I could free up another 3.5g if I delete the cache. Based on my experience, I don’t really see a need to hang on to old copies libraries and apps even though I believe the recommendation is to keep a least one version back. I’ve never needed to use it . What are your thoughts?

RSV869

clear the cache - if you need the space

having the previous version in cache saves you from trying to get it when you may need it - which is rare

1 Like

If your filesystem is ext4, you can immediately free up some space by shrinking the (nearly useless) “reserved blocks” from 5% total capacity down to 64 MiB (or 32 MiB).

For 64 MiB:

sudo tune2fs -r 16384 /dev/sdX#

Or for 32 MiB:

sudo tune2fs -r 8192/dev/sdX#

Replace sdxN with the actual partition, such as sda2

This means rather than having approximately 1.6 GiB being wasted on “reserved blocks”, you can liberate it, since it will now only take up 32 MiB or 64 MiB.


1 Like

so in my case the command would be:

sudo tune2fs -r 16384 /dev/nvme0n1p2

sounds like a good idea.

thx very much

However, this has got nothing to do with the original question:
whether to keep a cache of the installed packages

Almost all the system files are owned by root anyway
and this will only benefit the space for those files NOT owned by root
(files in the users $HOME, mostly)

Oh… didn’t realize that…but am a bit confused…

One way to free up space in / to clear the cache, if I decide to go that route. OK NP.

If I shrink the reserve blocks, is the gained space available to system use, as in added programs, libraries, files, etc? I’m not clear on that.

thx

generally: no
because, as I said
these files are owned by root anyway

root can always write until the file system is completely full
no matter the reserved blocks percentage

The reserved space is space that users other than root cannot fill up.
So that (a responsible root user) always has got a margin of free space to work with
in case it is needed.

OK thx

But adjusting this - as you did, as was suggested - is a good thing nonetheless.
That way you, as a normal user, can use the all of the space on your disk, instead of keeping you from using 5% of it
which is a lot with a 1 TB drive (50 GB not usable for you …)

1 Like

Now THAT is what I call a Solution! :white_check_mark:

:raised_hands:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.