# Why I have 5.8G space but when rebuilding space is not enough

**URL:** https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881
**Category:** Self-hosting
**Created:** [23 februari 2019 om 04:44 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881 "2019-02-23T04:44:38Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [23 februari 2019 om 04:44 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/1 "2019-02-23T04:44:39Z")

</div>

Before ./launcher rebuild app, I have 5.8G space.

But when I rebuild app, the left space will be 3.7G \< 5G, and the rebuild stopped.

Does that mean we need at least 7G left before rebuild?

* * *

I have a 20G VPS, the discourse backup file is 611M, less than 1G,

But still it is not enough? Why is that?

**Should I simply cleanup all the VPS** , and re-install the discourse, then upload the backup file and make the discourse server run again?

* * *

You see, I have 20G in total, every time before rebuild I need 7G empty. The server is 611M in zip, if unziped,

local\_discourse/app needs about 3G

```plaintext
root@xxx:/var/discourse# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
local_discourse/app latest 98249b7dffc9 11 days ago 2.58GB
rethinkdb latest be24926bde9a 20 months ago 183MB
microbox/etcd latest 6aef84b9ec5a 3 years ago 17.9MB

```

The Ubuntu system will cost about 2G?

Does that mean only a 611M discourse will need a VPS more than 20G?

**Quite a waste of space I think.**

* * *

Docker version 17.09.0-ce  
Installed v2.3.0.beta2 +31

Latest 2.3.0.beta2

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [23 februari 2019 om 04:51 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/2 "2019-02-23T04:51:34Z")

</div>

Which version are you upgrading from? Backups are compressed, some upgrades include an upgrade to Postgres which uses significantly more disk space than usual.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [23 februari 2019 om 15:01 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/3 "2019-02-23T15:01:38Z")

</div>

Some rebuilds need more space that others. When there is a PostgreSQL update you need double the uncompressed database size as free space. When we release a new docker image you need space for the new image.

That as temporary and reclaimed using the launcher cleanup command afterwards.

We just released a new image so you need enough space.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [23 februari 2019 om 15:31 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/4 "2019-02-23T15:31:42Z")

</div>

In my experience even 25gb is a bit tight.

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [8 maart 2019 om 12:42 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/5 "2019-03-08T12:42:41Z")

</div>

Very Strange, my usually used discourse’s backup file (20G KVM ramnode), only 670M, and the server don’t have enough space to rebuild.

While another discourse of mine, not usually using, also on a 20G KVM ramnode, with backup file 990M, but still have enouth space to reubild.

So I checked the space again, and I find there being a big ./log folder. So, **is it safe to delete the log files there in the big folder**?

```plaintext
root@xxx:/var# du -h --max-depth=1
3.6G ./log
20K ./spool
4.0K ./opt
4.0K ./tmp
1.6M ./backups
1.8G ./discourse
188M ./cache
4.0K ./local
4.0K ./mail
7.1G ./lib

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8 maart 2019 om 12:48 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/6 "2019-03-08T12:48:48Z")

</div>

Try a

./launcher cleanup

That will remove used docker images.

But I consider 25 a minimum and even at the requires careful monitoring of disk storage.

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [8 maart 2019 om 13:06 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/7 "2019-03-08T13:06:39Z")

</div>

I have already tried that.

I’m considering to move to another VPS which have 40G space, when this contract is over.

While today I suddenly find the one that I usually don’t use, it’s backup file is 990M, far more than this one I usually use, whose backup file is 670M.

So I think I can delete something and continue working on this server for another year. I don’t want to “zheteng”.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8 maart 2019 om 13:34 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/8 "2019-03-08T13:34:56Z")

</div>

You might trim the logs more aggressively.

The size of a backup means little as the database is compressed.

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [8 maart 2019 om 13:36 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/9 "2019-03-08T13:36:19Z")

</div>

so, how should I trim the logs?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8 maart 2019 om 13:40 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/10 "2019-03-08T13:40:07Z")

</div>

You can Google that. I think logrotate is what to I for. A quick manual temporary solution is to enter the directories with the logs and

rm \*

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [8 maart 2019 om 16:14 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/11 "2019-03-08T16:14:14Z")

</div>

The backup size is immaterial, please stop citing it as a factor here.

Backups are gzipped and include attachments, the smaller database could have 50Mb of attachments while the larger has 500Mb.

You’ve also not mentioned whether they’re at the same software levels. The amount of disk required is directly related to the operations which need to be performed. If either requires a postgres upgrade it will use significantly more disk.

Can you not upgrade the disk during your current contract? Most hosts allow this.

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [14 mei 2019 om 06:07 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/12 "2019-05-14T06:07:50Z")

</div>

I found the true answer.

The discourse won’t consume this much space, unlike most of the answers stated.

I’ve bought another VPS which have 40G of space and moved the system to that server.I found it only needs 9G rather than the previous 14G, so the previous 20G server is actually quite enough for this forum.

That is because the old server has lasted for 3 years or more and a lot of packages that you never need any more or other files that you will not need any more are still there. So the best choice is just download the backup file, reinstall the Ubuntu system of that server and reinstall discourse and restore the backup file again. The process takes about 2 hours I think, depends on the net speed.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [13 juni 2019 om 06:08 UTC](https://meta.discourse.org/t/why-i-have-5-8g-space-but-when-rebuilding-space-is-not-enough/109881/13 "2019-06-13T06:08:06Z")

</div>

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