mount zfs in LXC container

arneKlaver

Member
Aug 19, 2020
4
0
6
28
Hello,

I am trying to mount a zfs pool in a LXC container.
I managed to get it mounted using : pct set vmID -mp0 /poolname/,mp=/mountName
after this I had to fix some permission isues wich I managed to to by doing some group mapping like in this example

/etc/subgid
root:1000:1
root:100000:65536

/etc/subuid
root:100000:65536

/etc/pve/lxc/197.conf
lxc.idmap: u 0 100000 65535
lxc.idmap: g 0 100000 1000
lxc.idmap: g 1000 1000 1
lxc.idmap: g 1001 101001 64534


And this works BUT only for the first directory.
I have permissions in my mount point but once I go further the group is no longer recognized.
proxmox hostLXC ubuntu quest
1597869081969.png1597869135079.png
1597869060344.png1597869148962.png

These locations /dataPool/media /dataPool/backup are zfs filesystems not folder.
Does this have anything to do with it?
 
So I just tried mounting the zfs filesystem (/dataPool/media)
And now I can see all folders inside and eddit them etc. so I have the correct permissions

Is there another way to fix this then to mount every zfs filesystem seperatly?
 
Hi,
when you say you mounted /dataPool/media, do you mean on the host? Is zfs get canmount,mountpoint dataPool/media set to on and the correct mount point? If it is, it should be mounted automatically by zfs mount -a at boot time.
 
no I mean mount to the LXC using : pct set 101 -mp0 /dataPool/media,mp=/media
So once I do this I can see/acces all folders inside /media/
but if I try to go trough my LXC mount of dataPool : pct set 101 -mp0 /dataPool/,mp=/dataPool
I can only access the first folder (/dataPool/) but I can't acces the data in media (/dataPool/media/)

on the host the zfs pool is mounted automatically on /dataPool on every reboot
and on the host I have acces to all my filesystems and folders on the pool.
 
PVE doesn't do recursive bind mounts, so when you mount the dataPool it only mounts that filesystem within the container, including the empty media directory that serves as a mount point, but it doesn't mount the filesystem that is mounted there. So you were already on point in your second post and I fear you'll have to mount each filesystem separately.

Feel free to subscribe to this bug report for updates (there's also an experimental patch available).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!