- NFS mount vs ‘Local’ External Storage
- User data on different server (NAS)
- Mount CIFS/SMB shares RW in LXD containers (bayton.org)
but still can’t figure out how to accomplish what I’m after. I’ve run OC 8 (!) under QEMU/KVM for 3 years or so, and it’s been grand. I’m now getting into linux containers, and want to run a new NC 13 instance under LXD and ultimately migrate my data from OC8 to NC13. (I tried the upgrade-upgrade-upgrade approach, but it’s too much work, so I’ll just start over.)
One of the things about VMs and containers is that it’s hard to forecast how much data storage you need, and a little difficult to add later (not really, of course). But I’ve already invested into separate file storage for non-NC purposes with redundancy, proper backup strategy, etc. and it would be super convenient to only consider the nextcloud software itself in the container and “pretend” that my data directory “disk” was infinite.
To that end, I tried to mount my storage export over NFS on the LXD host, and then attach it to my container using
lxc config device add nextcloud nextcloud-data disk source=/data/nextcloud path=/home/nextcloud/data
First I shutdown nextcloud and moved
/home/nextcloud/data.x with the idea that if it worked, I’d just copy from data.x to the new data mount, restart nextcloud and be off to the races. But life in containers is not that easy - I had permission / write issues.
The nextcloud data directory looks to want to be owned by
www-data:www-data, but in the container this is some large uid/gid on the host which has absolutely no correlation to anything on the actual NFS server, and I’m not sure if that matters. I’ve gotten around multi-system file-sharing permissions issues in the past by simply creating users on both server and client with the same user id - this works if you can manage it and there aren’t too many users to create.
But in container-land, I’m a little lost. Perhaps this is a @JasonBayton question (), but I’d appreciate some pointers to getting this accomplished. It’s not ostensibly a nextcloud issue I suppose, but this seems like a vibrant forum and certainly someone is doing something similar.