hugo-learning-docs
Homelabs

How to cleean your system so it doesnt explode ?

Why? - Storytelling

I got an error recently on jellyfin, a sudden crash. It was because a file couldn’t write ? And in fact it was due to the fact that my system storage is completly full. Thanks to Cyberduck awesome logs detail on upload, I saw that the file was not able to write. I thought it was due to CyberDuck (stupid me…), then I tried nano, and there I saw, when editing, that the file was pointting to SWAP. THANKS SWAP, you saved my system from exploding while flying..

Common culprits (thanks GPT for the tip)

There is some folders that are known to be taking a lot of space:

  • /tmp
  • /var/log
    • logs from.. everything ?
  • /var/lib/docker/overlay
    • the system folder of docker, contains everything: images, containers, build cache, etc.
    • See this StackOverflow to learn more
  • apt cache

Commands

To investigate, you can usee these commands, to see where in your file tree there is some place taken. (in a WinDirStat way :p)

# Global overview of the space taken on every storage
df -h

# Check the root first
du -h --max-depth=1 /

# Check inside the /var folder
du -h --max-depth=1 /var

# ... and so everywhere you wanna clean

Commands to clean stuff

#clean every non-used stuff in docker, I got 10G from there :)
docker system prune -a
# easy to understand, i got around 2G from there
apt clean
© hugo-learning-docs 2025