Disk space running low [solved]


I’m a newbie and so every other day or so I check the backups are working. I’ve got images and backups being stored on amazon s3.

I’ve noticed over the last couple of weeks (via the dashboard) my free space has dropped by 4GB (used to read 22GB free) and now reads as the following:

uploads 123 MB (18.2 GB free) backups 594 MB (18.2 GB free)

Where could all this space be disappearing to?

I do rebuild discourse every so often when adding or removing plugins but this has relatively calmed but surely it cant be taking up 4GB?..

sudo du -sh /var/discourse/
729M /var/discourse/

(Rafael dos Santos Silva) #2

Did you try:



I’m using the digital ocean docker image so guessing this does it already?

(Rafael dos Santos Silva) #4

Try a ./launcher cleanup on the host.

> /var/discourse$ sudo ./launcher cleanup

> The following command will
> - Delete all docker images for old containers
> - Delete all stopped and orphan containers

> Are you sure (Y/n): y
> Starting Cleanup (bytes free 19862976)
> Unable to find image 'samsaffron/docker-gc:latest' locally

> latest: Pulling from samsaffron/docker-gc
> 0f4d770cd333: Pull complete
> a3ed95caeb02: Pull complete
> 6a2ea02ca5be: Pull complete
> bc4c30afebbb: Pull complete
> Digest: sha256:XXXXX
> Status: Downloaded newer image for samsaffron/docker-gc:latest
> Finished Cleanup (bytes free 32609184)

Also deleted any old linux headers etc

apt-get autoclean
apt-get autoremove

$ df -h
Filesystem                 Size  Used Avail Use% Mounted on
udev                       991M  4.0K  991M   1% /dev
tmpfs                      201M  7.0M  194M   4% /run
/dev/disk/by-label/DOROOT   40G  6.2G   32G  17% /
none                       4.0K     0  4.0K   0% /sys/fs/cgroup
none                       5.0M     0  5.0M   0% /run/lock
none                      1001M  1.3M 1000M   1% /run/shm
none                       100M     0  100M   0% /run/user

Does this look reasonable now?

(Rafael dos Santos Silva) #6

The space is elsewhere then. Probably logs on the machine.

Try a sudo du -xh -d 1 on the root of the server, and repeat on the bigger folders to find the culprit.

sudo du -xh -d 1
732M	./usr
4.0K	./mnt
8.0K	./media
6.4M	./etc
4.0K	./srv
16K	./lost+found
52K	./home
65M	./boot
12M	./sbin
4.9G	./var
4.0K	./tmp
484M	./lib
9.6M	./bin
4.0K	./opt
4.0K	./lib64
288K	./root
6.1G	.

/var$ sudo du -xh -d 1
4.0K	./local
4.0K	./crash
200M	./cache
872K	./spool
4.0K	./tmp
3.8G	./lib
71M	./log
729M	./discourse
4.0K	./opt
78M	./mail
8.1M	./backups
4.9G	.

Woohoo its gone back up! @Falco Thanks so much!

uploads 123 MB (31.1 GB free) backups 594 MB (31.1 GB free)

(Sam Saffron) #8

I usually use ncdu for that, ncdu is super awesome