Secondary drive mounted but Discourse not using it

AI-generated summary

Jim_Starkweather mounted a secondary drive via Lightsail and rsync’d 190GB of user uploads to it, then updated app.yml to point Discourse to the new location (/var/discourse/shared/standalone/uploads mapped to /forum_images). However, Discourse continued saving uploads to the default path. pfaffman pointed out the volume mapping was reversed — the host and guest paths were swapped. After correcting the app.yml to map /var/discourse/shared/standalone/uploads as host and /shared/uploads as guest, and rebuilding the app, Discourse began correctly using the secondary drive. Jim confirmed the fix worked. pfaffman also advised ensuring file permissions are correct and suggested destroying and restarting the app after changes. The issue was purely configuration: the volume definitions in app.yml needed to reflect the correct host-to-guest mapping for Discourse to use the external storage.

I have a secondary drive mounted via Lightsail. Mapped to a directory and have rsync’d all my uploads to it. However even after changing the app.yml to the below scheme and restarting Discourse it refuses to save the file to the new location. Any ideas?

volume:
host: /var/discourse/shared/standalone/uploads
guest: /forum_images

Did you rsync or move the existing images there? Do you not want the existing images? They are in the default directory.

File permissions?

I think you’ll need to rebuild to get it to make the default directory where the uploads go.

I used rsync. The forum has 190gb of user uploaded images so yes, definitely want them.

The user is ubunto for both the discourse files and the ones moved. The permissions are the same as well. I will try a rebuild then.

I did a rebuild and it’s still saving to: /var/discourse/shared/standalone/uploads/default/

And not: /forum_images/default/

Oh. You got it backward.


volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

So you want to add

  - volume:
      host: /forum_images
      guest: /shared/uploads

Then you can

./launcher destroy app;./launcher start app

Then you can

./launcher enter app
ls /shared/uploads

to see if the stuff is there

Thanks Jay. Yup that was it. All working as it should now.