Score:-1

Storage 100% full

us flag

I don't have much experience in system administration. I have installed a Mastodon instance on a VPS running Ubuntu 20.04. After ten days the server has been completely filled, which seems very rare to me. How can 38Gb be filled?

If I do a df -h, I get this:

Filesystem      Size  Used Avail Use% Mounted on
udev            949M     0  949M   0% /dev
tmpfs           194M  860K  193M   1% /run
/dev/sda1        38G   36G     0 100% /
tmpfs           968M   28K  968M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           968M     0  968M   0% /sys/fs/cgroup
/dev/sda15      253M  138K  252M   1% /boot/efi
tmpfs           194M     0  194M   0% /run/user/0

As can be seen, the file system mounted on /dev/sda1 is completely full.

There must be something that takes up a lot of space, how can I find it? How can I find a directory that takes up a lot of space?

du -h doesn't work for me because it starts printing thousands of lines and doesn't stop.

I would appreciate any hint or help.

[EDIT] I don't want to delete the question even though it's been tagged as a duplicate because the linked question doesn't have the du -h --max-depth=1 command among its answers, which for me has been crucial.

Doug Smythies avatar
gn flag
try `du -h --max-depth=1` and proceed with the investigation based on the results. Perhaps some log files are becoming large in `/var/log`.
aitor avatar
us flag
Yes! it works! With this command I have been delimiting the large directory and I now know where the problem is. Thanks a lot.
Pilot6 avatar
cn flag
Duplicate questions are not deleted. And the command you mentioned are not among the answers here too.
aitor avatar
us flag
My fault. Fixed.
Score:1
us flag

As Doug said in the comments, with du -h --max-depth=1 I can delimiting the large directory.

Rishon JR avatar
pl flag
You could do `sudo apt autoremove && sudo apt autoclean`
Rishon JR avatar
pl flag
There is also a program called [BleachBit](https://www.bleachbit.org/download/linux). This is a system cleaner used to cleanup nd optimise your system.
Score:1
sb flag

For a better and interactive overview you can use ncdu.

Start count from current dir: ncdu -x

Start count from custom dir: ncdu -x /some/dir

(-x parameter is for "Do not cross filesystem boundaries")

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.