As obviously many users before me, I'm having trouble getting read/write access from a container to a zfspool. I have read through many of the posts concerning this topic both here within the forum and also on the internet. I've been following these instructions, but so far didn't manage to get the result I'd expect.
The goal is to move the data directory of a nextcloud instance out of the container and into a zfspool:
My lxc-config looks as follows:
On the host:
On the host, the privileges are set :
The bind mountpoint is declared in the lxc-id.conf file. However, files do not appear, when on the host I do
.
The files within the zfspool do appear when additionally i do
but then in the guest the mapping fails
Funny enough, the whole thing works, if I simply do
without any of the editing-the-config-business, but I'm wondering if it's a security issue and why then should it be necessary to write all the guides on how to do the mapping properly if it was so easy.
So: where am I going wrong?
The goal is to move the data directory of a nextcloud instance out of the container and into a zfspool:
My lxc-config looks as follows:
Code:
arch: amd64
cores: 1
features: nesting=1
hostname: LXC.30-NC-AIO
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:96:04:70,ip=dhcp,ip6=dhcp,type=veth
onboot: 1
ostype: debian
parent: SN_220-01
rootfs: local-zfs:subvol-220-disk-0,size=8G
snaptime: 1776523168
swap: 1024
unprivileged: 1
lxc.idmap: u 0 100000 33
lxc.idmap: g 0 100000 33
lxc.idmap: u 33 33 1
lxc.idmap: g 33 33 1
lxc.idmap: u 34 100034 65502
lxc.idmap: g 34 100034 65502
mp0: /even_disks/LXC_unprivileged/Nextcloud_data,mp=/mnt/Nextcloud_data
On the host:
Code:
cat /etc/subuid
root:33:1
root:100000:65536
Code:
cat /etc/subgid
root:33:1
root:100000:65536
On the host, the privileges are set :
Code:
ls -l /even_disks/LXC_unprivileged
total 1
drwxr-xr-x 2 www-data www-data 2 May 1 11:13 Nextcloud_data
The bind mountpoint is declared in the lxc-id.conf file. However, files do not appear, when on the host I do
Code:
ls -l /path/to/mounted/directory
The files within the zfspool do appear when additionally i do
Code:
pct set lxc-id -mp0 /path/to/storage/on/host,mp=/path/on/guest
Code:
root@LXC:/# ls -l /mnt/Nextcloud_data
total 1
-rw-r--r-- 1 nobody nogroup 0 May 1 14:57 testfile.md
Funny enough, the whole thing works, if I simply do
Code:
chown -R 100033:100033 /path/to/storage/on/host
So: where am I going wrong?