This might be more of a Linux question, but here it goes:
I have two nodes. Node1 and Node2.
Node2 has a secondary zfs pool that serves as the bulk storage. In order to make this storage accessible to an LXC regardless of the node that it is on:
Node1 has a /mnt/nas folder mounted using nfs to the pool on node2, using node2's LAN ip address. NFS is done via autofs.
Node2 has a /mnt/nas folder mounted through the same mechanism, but to the localhost ip. This way the lxc looks for the same mnt folder regardless of what node it is on. The mount is done through a lxc.mount.entry line in the conf since this allows for snapshots and migration.
The whole thing is working really well except for one quirk... anything created on the nas pool (which is on node2) by an lxc on node1 is done by nobody:nogroup
But anything created by an lxc on node2 is created as 100000:100000. For most applications this doesn't seem to matter, but Nextcloud is unhappy with it.
I'm sure this is happening because even though the LXC is accessing the storage through an nfs mount, the host clearly knows it is accessing itself and is applying a different user to the files created by LXCs. I've tried changing the autofs configuration on node2 to use it's LAN ip instead of 127.0.0.1, but it made no difference.
So how can I force the nfs mount to use nobody:nogroup even though it is mounting to itself? I suppose the alternative would be fine too, if both used 100000:100000 (or any number, as long as they were the same). I just need them to be the same regardless of which node the lxc is on at the time.
Thanks!
Seth
I have two nodes. Node1 and Node2.
Node2 has a secondary zfs pool that serves as the bulk storage. In order to make this storage accessible to an LXC regardless of the node that it is on:
Node1 has a /mnt/nas folder mounted using nfs to the pool on node2, using node2's LAN ip address. NFS is done via autofs.
Node2 has a /mnt/nas folder mounted through the same mechanism, but to the localhost ip. This way the lxc looks for the same mnt folder regardless of what node it is on. The mount is done through a lxc.mount.entry line in the conf since this allows for snapshots and migration.
The whole thing is working really well except for one quirk... anything created on the nas pool (which is on node2) by an lxc on node1 is done by nobody:nogroup
But anything created by an lxc on node2 is created as 100000:100000. For most applications this doesn't seem to matter, but Nextcloud is unhappy with it.
I'm sure this is happening because even though the LXC is accessing the storage through an nfs mount, the host clearly knows it is accessing itself and is applying a different user to the files created by LXCs. I've tried changing the autofs configuration on node2 to use it's LAN ip instead of 127.0.0.1, but it made no difference.
So how can I force the nfs mount to use nobody:nogroup even though it is mounting to itself? I suppose the alternative would be fine too, if both used 100000:100000 (or any number, as long as they were the same). I just need them to be the same regardless of which node the lxc is on at the time.
Thanks!
Seth
Last edited: