# Less than 5GB of disk space, can't upgrade Discourse

**URL:** https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [1월 20, 2019, 9:58오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011 "2019-01-20T09:58:44Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![wasghar](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wasghar](https://meta.discourse.org/u/wasghar)
#### Post date: [1월 20, 2019, 9:58오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/1 "2019-01-20T09:58:44Z")

</div>

Dear All,

I have an existing installation of discourse however i did not upgrade last few releases. Its hosted by digital ocean. This mornng when i tried to upgrade through manual, i am getting the following error. Please can you guide as what step i should take to upgrade this.

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/6/1622f1a8a53df1d47dd26c54107c51e7b1735823.png)

Cheers,  
Muhammad

---

<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: [1월 20, 2019, 10:08오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/2 "2019-01-20T10:08:00Z")

</div>

Run it again and say **Y** es. Your data won’t be touched, only old docker images will be removed.

---

<div class="post-metadata">

### Author: ![wasghar](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wasghar](https://meta.discourse.org/u/wasghar)
#### Post date: [1월 20, 2019, 10:12오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/3 "2019-01-20T10:12:32Z")

</div>

> [@Stephen](#):
>
> only old docker images will be removed.

Thanks. I did that but it does not seem working. Please see this snapshot. Sorry I forgot to attach this earlier. Thanks in advance

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/6/963a2fc97bb56f961700fa139ceeb4dca72baae4.png)

---

<div class="post-metadata">

### Author: ![ssvenn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ssvenn/32/86740_2.png) [@ssvenn](https://meta.discourse.org/u/ssvenn)
#### Post date: [1월 20, 2019, 10:26오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/4 "2019-01-20T10:26:55Z")

</div>

use either `du -sh *` and drill down into the large directories or `ncdu` if you have that package available, and try to figure out where exactly your space has gone

if it is user content you will probably have to increase diskspace on your server, but a common problem on servers that run docker for a while is that the default json logging engine never rotates the logs

```
[root@discocent discourse]# cd /var/lib/docker/containers/
[root@discocent containers]# du -sh *
5.1M	86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f
36K	cecf3b8565bce6156c61f61b27af425d0f956b8ce439f2519300ebfdc7bb4cf9
[root@discocent containers]# cd 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f/
[root@discocent 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f]# ls -lh
total 5.1M
-rw-r-----. 1 root root 5.0M Jan 16 10:07 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f-json.log

```

that’s 5M of log for my idle test instance after a couple days, an active server will be larger. if you run other containers they might be logging even more.

You can configure docker to handle log rotation, check out [Configure logging drivers | Docker Docs](https://docs.docker.com/config/containers/logging/configure/) ..not sure why it’s not the default.

---

<div class="post-metadata">

### Author: ![wasghar](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wasghar](https://meta.discourse.org/u/wasghar)
#### Post date: [1월 20, 2019, 10:53오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/5 "2019-01-20T10:53:53Z")

</div>

Hi @ssvenn

Many thanks. this is much appreciated. I have run the commands and i can see the following statistics. Would you mind to advise, how does this look like as I am unable to interpret I am afraid. Thanks in advance.

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/2/f220c861098b7bb2bd05c9b9456373d06197b433.png)

---

<div class="post-metadata">

### Author: ![wasghar](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wasghar](https://meta.discourse.org/u/wasghar)
#### Post date: [1월 20, 2019, 10:58오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/6 "2019-01-20T10:58:13Z")

</div>

Sorry here is the lastest one please.

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/2/c29d82730e194f1cb8239040f63043ce2b047333.png)

I have been surprised to see the occupied space. As we have very minimal activty on our forum. Thanks

---

<div class="post-metadata">

### Author: ![ssvenn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ssvenn/32/86740_2.png) [@ssvenn](https://meta.discourse.org/u/ssvenn)
#### Post date: [1월 20, 2019, 11:04오전 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/7 "2019-01-20T11:04:11Z")

</div>

ok, that’s not your problem then. Only one container and only 0.5MB of logs.

if you run du -sh \* again in the / top directory maybe you will get a better picture of where the space has gone. I highly recommend ncdu to make it easier ( [https://dev.yorhel.nl/ncdu](https://dev.yorhel.nl/ncdu) )

on my test instance docker uses about 8GB on images, check out [Prune unused Docker objects | Docker Docs](https://docs.docker.com/config/pruning/) for help on how to clean that up.

`docker image prune -a` usually frees up a lot of space for me, you might have to `docker rm app` to delete your old Discourse app container first. If you have lots of forum backups maybe you could download them to your local machine to free up some additional space.

another thing you should check is `docker ps -a` to see if you have any unexpected containers. Sometimes a failed rebuild will leave a dangling container that you have to remove manually.

```
[root@discocent /]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
86981cd18ab1 da251a932851 "/bin/bash -c 'cp -r…" 4 days ago Exited (0) 4 days ago festive_margulis
[root@discocent /]# docker rm festive_margulis
festive_margulis
[root@discocent /]# docker image prune -a
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
deleted: sha256:da251a9328516f691f0fc3bcdd685e218fa075ae744766996a25b7fe0008b4fc
deleted: sha256:3adfc688f9c999f5f08caae668a722c273311c3f84da33161bf23184218fa74b
deleted: sha256:ea31cd77735ab3d86f3d8903425d4157320b7047a07da4555a4752614c6e5265
deleted: sha256:b375a11cf89e3f124f9151688c2952ef8ca45f5ab5f2bd0751ea3f617708df87
deleted: sha256:cce92fda689ab9033f0b8db214bc63edd1ae3e05831a0f3a9418976d7dc7ccdd
deleted: sha256:d22094bbd65447c59a42c580eaa3a44cee9cd855f00905f59409be21bcefc745
deleted: sha256:b8976847450013f3eb5e9a81a5778f73ed7bef67e6393049712ef17102b4b7b7
deleted: sha256:b8c891f0ffec910a12757d733b178e3f62d81dbbde2b31d3b754071c416108ed

Total reclaimed space: 2.33GB

```

---

<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: [1월 20, 2019, 2:56오후 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/8 "2019-01-20T14:56:27Z")

</div>

Have you checked your backups? It’s quite easy for them to fill your disk.

---

<div class="post-metadata">

### Author: ![JKBaseer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jkbaseer/32/80471_2.png) [@JKBaseer](https://meta.discourse.org/u/JKBaseer)
#### Post date: [12월 9, 2021, 6:53오후 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/9 "2021-12-09T18:53:41Z")

</div>

> [@ssvenn](#):
>
> docker image prune -a

@pfaffman님, 이와 관련하여 간단한 질문이 있습니다. 저도 동일한 문제를 겪어서 `du -sh *`를 실행해 봤습니다. 어떤 파일도 1MB를 초과하지 않습니다.

그래서 파일을 삭제하지 않았습니다.

하지만 `docker image "prune -a"`를 시도해 봤는데, **회수된 공간: 0B** 였습니다.

그 외 제가 해야 할 것이 있을까요?  
제 문제는 최근 진행한 업그레이드 이후 앱이 종료되는 것과 관련이 있습니다.

---

<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: [12월 9, 2021, 7:01오후 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/10 "2021-12-09T19:01:06Z")

</div>

> [@JKBaseer](#):
>
> 다른 해야 할 일이 있을까요?

> [@pfaffman](#):
>
> 백업을 확인해 보셨나요? 디스크 용량을 채우는 경우가 꽤 흔합니다.

`/var/discourse/shared/standalone/backups/default` 디렉토리를 확인해 보셨나요? 가장 가능성이 높은 원인이 바로 그곳입니다.

[https://www.pfaffmanager.com/에서](https://www.pfaffmanager.com/%EC%97%90%EC%84%9C) 새로운 제품을 개발하고 있습니다. 해당 사이트로 로그인한 후 상단의 서버 목록 버튼을 클릭하고, 무료! 기존 서버 관리 버튼을 클릭한 뒤, (기대하는 바와 같이) 제안되는 대로 서버를 설정해 주시면 제가 직접 처리해 드리겠습니다.

---

<div class="post-metadata">

### Author: ![JKBaseer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jkbaseer/32/80471_2.png) [@JKBaseer](https://meta.discourse.org/u/JKBaseer)
#### Post date: [12월 9, 2021, 7:05오후 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/11 "2021-12-09T19:05:04Z")

</div>

> [@pfaffman](#):
>
> /var/discourse/shared/standalone/backups/default

고맙습니다. 네, 백업을 확인해 봤습니다. 총 5개 파일 \* 16MB입니다. 꽤 작은 크기죠?

또한 다음을 실행해 보았습니다.

```plaintext

==================== MEMORY INFORMATION ====================
RAM (MB): 1002

              total used free shared buff/cache available
Mem: 978 692 68 33 216 110
Swap: 2047 242 1805

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 12G 11G 848M 93% /

---------- Container Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
overlay 12G 11G 848M 93% /
/dev/xvda1 12G 11G 848M 93% /shared
/dev/xvda1 12G 11G 848M 93% /var/log

```

새로운 제품에서 제안하신 내용을 시도해 보고 있습니다.

---

<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: [12월 9, 2021, 7:07오후 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/12 "2021-12-09T19:07:20Z")

</div>

> [@JKBaseer](#):
>
> ```plaintext
> Filesystem Size Used Avail Use% Mounted on
> /dev/xvda1 12G 11G 848M 93% /
> 
> ```

아, 용량이 12G밖에 없군요. 이건 부족합니다. 최소 25G는 권장하지만, 50G 정도가 훨씬 좋습니다.

---

<div class="post-metadata">

### Author: ![JKBaseer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jkbaseer/32/80471_2.png) [@JKBaseer](https://meta.discourse.org/u/JKBaseer)
#### Post date: [12월 9, 2021, 7:10오후 UTC](https://meta.discourse.org/t/less-than-5gb-of-disk-space-cant-upgrade-discourse/107011/13 "2021-12-09T19:10:17Z")

</div>

> [@pfaffman](#):
>
> (제가) 제안한 대로 서버에 설정하세요, 제가 알아서 처리해 드릴게요.

네, 알겠습니다. 몇 분 전에 볼륨을 30으로 올렸는데, 아직 최적화 중일 수도 있겠네요.  
 ![image](https://global.discourse-cdn.com/meta/original/3X/f/6/f67f06106182c5a5db089d458cc22e9bdf2dc888.png)

참고로, 여러분 제품 UI가 좀 헷갈리긴 하지만, 거기서 어떻게 디버깅을 할지 갑자기 궁금해지더라고요. 하하. 여기서 규칙 위반 같은 일이 없도록 개인 메시지로 보내겠습니다.
