How to force filesystem to not full to more than 90%?

i want to avoid the problem of no free space that cause slow in pc,so there is dynamic ,auto ways to do that?

u cannot "force" the OS to stop writing data on ur disk, as doing things like watching videos on the internet involves writing data on ur disk as "cache". if u want to see what files occupy the most data on ur disk, u can check that by launching disk usage analyzer.

1 Like

Having a full disk also shouldn't cause any issues regarding performance in most cases, unless something is constantly writing/reading from it which may keep the system excessively busy.

Check for things like recently installed programs or perhaps this happens when running certain applications. If you are unsure you can try to read log messages from /var/log/syslog and similar files, but that requires a more time and effort to determine if something is going on so it's better if you already have some idea of what could be the problem.

The logs and journal entries can be cleaned out, reducing the amount the system is using. While shutting down clears temp files, some caches are persistent, but do not use that much space... usually limited to a few megabytes at most.

Watch your downloads directory for stale content, removing what is unnecessary and placing things that are in the directory meant for the content (pdf and docs to documents; jpeg, gif, png, svg to pictures; mp4, avi and mkv to videos). Keep it organized and clean and you'll know what you can store and if you need to backup and clean out. You can also run sudo apt auto-remove occasionally to clean out unused dependancies.

Avoid snap and flatpak since these duplicate dependencies on your system, taking up space, you are capable of using an apt or deb version of the application instead

There is no automation available to do this, without finding a script or writing one yourself that does this.

Unlike windows, not all files will have extensions since Linux actually reads the file to determine the type.

Even this will not completely prevent using all of the storage available.

1 Like

To add to the above, you can sometimes tell when something is wrong by checking the size of the files inside the /var/log. I've seen cases where some program is constantly failing and retrying to boot, logging each attempt and ending up with log files taking upwards of 10Gb.

If you do see this behavior check what the log files have to say as they will most likely point to the faulty process or program generating this amount of output.

1 Like