Any advice on how to save space?

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!)

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

3 Likes

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

Then inside the instance it will be something like:

# 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.

# 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:

# 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):

6 Likes

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.

1 Like

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.

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

1 Like

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