# עצות איך לחסוך מקום?

**URL:** https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [24 בינואר,‏ 2023,‏ 7:44pm UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779 "2023-01-24T19:44:06Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [25 בינואר,‏ 2023,‏ 9:59pm UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/21 "2023-01-25T21:59:51Z")

</div>

> [@debryc](#):
>
> I still want to track down the issue with the `<none>` image

It’s possible that once you manage to do the upgrade, those older images will be unused and will (eventually?) get removed.

(Glad I could help!)

---

<div class="post-metadata">

### Author: ![debryc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/debryc/32/101652_2.png) [@debryc](https://meta.discourse.org/u/debryc)
#### Post date: [25 בינואר,‏ 2023,‏ 10:00pm UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/22 "2023-01-25T22:00:12Z")

</div>

> [@Ed\_S](#):
>
> It’s possible that once you manage to do the upgrade, those older images will be unused and will (eventually?) get removed.

You’re right. That’s exactly what happened. We now have 12 GB of available space 🎉 Again, my deep appreciation!

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [25 בינואר,‏ 2023,‏ 10:28pm UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/23 "2023-01-25T22:28:38Z")

</div>

Since you are in Digital Ocean, it’s good to know that you can move /var/discourse/shared to its own **Volume** that you can resize.

If you do **not** put a partition table on the new device, but just format it directly with ext4, it gives you flexibility after the first downtime you take to move to it. When you next run low, you can add more space to the device while you instance is still running, run `resize2fs` on the mounted filesystem from within the instance, and you’ll immediately have more storage space.

I hesitate a little to give specific instructions because it might seem like I’m going to provide support for them, but I will anyway, with the caveat that I can’t actually provide support for these instructions. Please please _please_ take a backup, offsite, and know how to restore it on your own before trying any of this. I’m just sharing here what I actually did to handle this case…

Manage Volumes, then add a volume of whatever size you need. It will look something like this in the console:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/b/1/9b19c4f41472982b8a2ce914769be59e9608ef23.png)

Then inside the instance it will be something like:

```plaintext
# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Nov 22 19:29 scsi-0DO_Volume_var-discourse-shared -> ../../sda

```

Modify the rest of this to use the name that you found there. If in doubt, stop and don’t make any mistakes.

```plaintext
# mkfs.ext4 -L var-discourse-shared -M /var/discourse/shared /dev/disk/by-id/scsi-0DO_Volume_var-discourse-shared
echo '/dev/disk/by-id/scsi-0DO_Volume_var-discourse-shared /var/discourse/shared ext4 defaults,nofail,discard 0 0' >> /etc/fstab
# cd /var/discourse
# ./launcher stop app
# mv shared shared-old
# mkdir shared
# mount shared
# tar -C shared-old -c . | tar -C shared -x -S -p
# ./launcher start app

```

After you confirm that the site is working, then:

```plaintext
# rm -rf shared-old

```

After this, the system volume will be used for docker images and the operating system, but the new volume will be used for all your Discourse contents. As long as you `./launcher cleanup` after each update, you should be in good shape going forward.

Digital Ocean has instructions for how to increase the size of a volume, including the filesystem on the instance (choose the “ext4” tab if you followed my instructions above):

> **[How to Increase the Size of DigitalOcean Volumes Block Storage | DigitalOcean...](https://docs.digitalocean.com/products/volumes/how-to/increase-size/)**
>
> Resize a volume and expand its filesystem to use the additional space.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [26 בינואר,‏ 2023,‏ 10:16am UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/24 "2023-01-26T10:16:28Z")

</div>

> [@mcdanlj](#):
>
> Since you are in Digital Ocean, it’s good to know that you can move /var/discourse/shared to its own **Volume** that you can resize.

Obvious point, but worth noting I think, this carries a monthly cost. It’s fairly modest, I think at time of writing it’s $0.10 per GiB per month.

---

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [26 בינואר,‏ 2023,‏ 12:29pm UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/25 "2023-01-26T12:29:29Z")

</div>

> [@Ed\_S](#):
>
> Obvious point, but worth noting I think, this carries a monthly cost. It’s fairly modest, I think at time of writing it’s $0.10 per GiB per month.

Thanks! “Explicit is better than implicit” applies. In the context of resizing a droplet _only_ because of needing more storage, it can be cheaper than moving to a larger droplet, if you don’t need the extra CPU and/or memory of a larger droplet.

> **[High-Performance Block Storage | Starting at $10/mo for 100 GiB](https://www.digitalocean.com/products/block-storage)**
>
> Business-ready NVMe- and SSD-based block storage to attach to your compute instance.

If you need the extra CPU and/or memory, then you can expand your existing droplet.

---

<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: [25 בפברואר,‏ 2023,‏ 12:29pm UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/26 "2023-02-25T12:29:32Z")

</div>

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

[Previous page](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779.md?page=1)
