Trying To Understand Hard Drive Usage

I am curious how hard drive space is consumed. Our install is three weeks old, low usage. The other night there was 35GB of free space, and after the Discourse update yesterday, it’s down to 31GB of space. There’s only 35MB of uploads.

We are running Ubuntu 20.04.4 LTS, 1 CPU, 2GB RAM, 50GB SSD at Digital Ocean.

Just curious why we only have 31GB of HD space left on a new install?

Thanks for helping me understanding how Discourse works!

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            951M     0  951M   0% /dev
tmpfs           199M  1.1M  198M   1% /run
/dev/vda1        49G   17G   32G  35% /
tmpfs           994M     0  994M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           994M     0  994M   0% /sys/fs/cgroup
/dev/vda15      105M  6.6M   98M   7% /boot/efi
/dev/loop0       56M   56M     0 100% /snap/core18/2538
/dev/loop2       62M   62M     0 100% /snap/core20/1587
/dev/loop3       62M   62M     0 100% /snap/core20/1611
/dev/loop4       68M   68M     0 100% /snap/lxd/22753
/dev/loop5       71M   71M     0 100% /snap/lxd/16922
/dev/loop6       47M   47M     0 100% /snap/snapd/16292
/dev/loop7       56M   56M     0 100% /snap/core18/2560
overlay          49G   17G   32G  35% /var/lib/docker/overlay2/6f0d5f321e0345e3a6bb72210f042b228ea2fa9777a3fb172b32be5306479964/merged
tmpfs           199M     0  199M   0% /run/user/0

How many times has the install been rebuilt in this time?

Have you run a ./launcher cleanup?

2 Likes

Thanks for the response Stephen. I created the system per the Digital Ocean one click install. Initially, I had 35GB of free space on a 50GB server. I thought that was odd, but couldn’t find anything in these forums about that.

Then, only once, just the other day I rebuilt the system to learn the commands. I see a rebuild is something you should do a time or two a year. Just last night I learned about the command you just provided, but I have not run it.

I suppose the question is, on a default new system. Is 35GB remaining on a 50GB machine to be expected?

It’s normal. Docker builds a bunch of images and take up space. You can prune them with

cd /var/discourse 
./launcher cleanup


2 Likes

Great information. So after a rebuild or update, it’s probably a good idea to run that command.

I went ahead and did that, here’s the results:

Total reclaimed space: 5.562GB

and now…

#df -h
/dev/vda1 49G 11G 38G 22% /

That 11G looks a lot better than the 17GB from last night. This sized server should be enough for years to come. I just wanted to ensure nothing funky was going on with our instance. Thanks for shedding light on the Docker images!

Yes. You’re fine. I recommend the 50gb droplet because you don’t need to worry about space (unless you have lots of images). You can run that prune command once a year or let launcher do it automatically when you get down to 5gb.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.