Mount propagation in LXC containers

taliaferro

New Member
Jul 6, 2024
2
0
1
Hey folks! I'm using a ZFS pool on my machine, and I've been mounting filesystems from the pool into Proxmox LXC containers. However, I've run into a problem where if a dataset has children (e.g. `tank/media` contains `tank/media/movies`, `tank/media/music`, etc.) then the filesystems below it are not accessible within the container. The mountpoints themselves exist, but they show up as empty and owned by `nobody`.

I think I can rule out the possibility that this is a UID mapping issue, because I tried manually changing the ownership of all the directories on the host to the mapped UID of root in the container, and it didn't affect the outcome. However, I did come across this thread about mount propagation in btrfs, which sounds like a very similar issue. Seemingly bind mounts don't respect other mounts placed inside of their source directory by default? It looks like this is something other container managers (Docker et al) have to account for at a higher level.

Does anyone know of a workaround or a way to turn on this feature? If not, the solution may have to be to add a separate mount point entry for each subvolume for containers that mount this filesystem.
 
lxc.mount.entry: /tank/dataset mnt/dataset none rbind,create=dir 0 0

For recursive mounting. By the way, datasets are different file systems and hard linking does not work across them - if that's applicable to your setup.
 
Last edited:
lxc.mount.entry: /tank/dataset mnt/dataset none rbind,create=dir 0 0

For recursive mounting. By the way, datasets are different file systems and hard linking does not work across them - if that's applicable to your setup.
That's super useful -- thank you!
 

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!