Iāve read
- 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
to /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.
Thanks,
brmiller