Score:1

Disk on root is almost full but can't find which files take the space

pk flag

Ubuntu 22.04 Desktop

If I do df -h i can see that my root folder is almost full enter image description here

And when I list the files in the folder, seems to me they are all system needed files. enter image description here

I tried to look a bit into it but I am not very experts with file systems and I am not sure how to actually check the file size (if I do la -la --block-size=GB in the / I get different size then if I do in a specific folder i.e. /home) and I am not sure what is safe to delete.

I already ran a software to help me clean double files, tmp and so on. Any tips from where to start? Is it normal that the root folder take around 20G?

I really appreciate any direction on this!

UPDATE: output after running sudo du -hc --max-depth=1 / as suggested by @matigo

Is it normal to have 18G of snap folder?! enter image description here

guiverc avatar
cn flag
You've not said what OS/product/release you're using, but the recommend minimum disk space for Ubuntu 17.10 Desktop (& later) is 25GB for a reason... As you add apps you need space to store them... Servers can use less, but you didn't specify what you're using. Have you tried using `du` (disk usage) to see where you're space is used?
in flag
If you use `sudo du -hc --max-depth=1 /`, then you'll get the size of each directory in `/`. This will help you find where your storage is being used. Be sure to expand `/` to specific directories if you wish to dig deeper
Giorgia Sambrotta avatar
pk flag
Thanks @guiverc I updated with the OS info. I did try with `du` but i am not familiar with and it just give me a huuuuuuuuge list of files. is impossible to read to be honest. I tried to read some but I also have no much idea if the file I see are important or not. Maybe I just have to increase the partition of my root folder..
Giorgia Sambrotta avatar
pk flag
ahhhh thank you @matigo with that argument i can read the output of du!! :D Thank you
guiverc avatar
cn flag
I'll provide https://help.ubuntu.com/community/Installation/SystemRequirements where 25GB has been the recommended minimum for Ubuntu Desktop 17.10 & later (ie. all releases since GNOME was the default desktop). Many 3rd party blog sites suggest less, but the space required varies on what additional apps you'll use (*the more you add, the more you need with some apps needing more space than others*) let alone space for your files (*if you don't store them on other partition/drives which I note you did*!). If you allocate less space, you often need to spend more time maintaining your system..
Giorgia Sambrotta avatar
pk flag
thank you for your time @guiverc. So if I understood correctly, you suggest that I might have a lot of apps installed that fill in all the space?
guiverc avatar
cn flag
I can't predict what apps you use, or even what *package format* you've opted to use, eg. we have many choices, *deb*, *snap*, *flatpak*, *appimage*, from source etc... and most will not share resources they need with others thus you'll end up with necessary duplicates of the same toolkit/libraries etc.. ie. one person may need 16GB & that's all, myself I need ~32GB (& still need to clean my system regularly).. How we use those apps also influences space required etc.. Some hardware can cause logs to grow (*maintenance as I see it*) so is unique & a problem until you recognize it & deal with.
Giorgia Sambrotta avatar
pk flag
yeah make sense. To be honest I always used different package format without caring much about it but I now had a good read about all of them and I see what you are saying and i will try to stick to deb. Is a long process but it definitely help to understand more. Thank you for helping on this process guiverc!
Score:1
pk flag

To help other people and my future self, here are the steps I have done to dig in more where the problem was:

  • run sudo du -hc --max-depth=1 / and then run the same for the subfolder that look rather big. i.e. sudo du -hc --max-depth=1 /var/lib

  • clean packages. I run apt autoremove && apt clean for apt packages and sudo bash -c 'rm /var/lib/snapd/cache/*' to remove snap cache.

  • I check the saved version of my snap file (after running the firs command it turned out a 11GB where occupied by the snap folder) snap list --all and then running a bash script to clan the snap versions (you find plenty of them in google. Just resarch for free disk space snap package manager)

  • I also check all my apt packages to see if I don't need some of them apt list --installed

Other useful command:

sudo du -sh / - show size of the specific folder

df -h - to see the whole disk sizes

And as always be curious and try to understand most of the folder what they are and why they are there and same for packages. It definitely need some times but hopefully every time will take less and less time :)

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.