Help with passing a folder into a container and understanding permissions

DeadLightning

New Member
Jan 26, 2024
1
0
1
Hi all! Having a real hard time wrapping my head around a perms issue currently with a drive folder passed into a container. Ran into an issue where from within the containers it does not allow write access to the files in /mnt/pool/media/). The folder is mounted to the container using pct set 117 --mp1 /mnt/pool/media,mp=/mnt/media. Using touch test.txt to create a dummy file gave me this error: touch: cannot touch 'test.txt': Permission denied. This article seems to detail the permissions issue I am having, as well as this video. I attempted to resolve it in the way that they described but couldn't resolve the issue. Here are the steps I followed:
Added this to the /etc/pve/lxc/117.conf file to allow permission mapping:

Code:
# uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), so 0..1004 (ct) → 100000..101004 (host)
lxc.idmap = u 0 100000 1005
lxc.idmap = g 0 100000 1005
# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
lxc.idmap = u 1005 1005 1
lxc.idmap = g 1005 1005 1
# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
lxc.idmap = u 1006 101006 64530
lxc.idmap = g 1006 101006 64530

Edited these files on the host as described in the proxmox wiki: nano /etc/subuid
added: root:1005:1
and edited this file: nano /etc/subgid
added: root:1005:1
Changed the owner of the bindmounts: chown -R 1005:1005 /mnt/pool But I'm still getting the same issue when trying to write. This is the output from ls -l /mnt/media in the container.

Code:
total 12
drwxr-xr-x   2 1005 1005    6 Feb  9 13:37 downloads
drwxr-xr-x 101 1005 1005 8192 Feb 15 08:21 movies
drwxr-xr-x   3 1005 1005   29 Feb 14 08:03 tv-shows
And I'm still getting the same permissions error

Could this have something to do with the drive being pooled using mergerfs? Right now I have 3 drives being pooled to /mnt/pool and that is the drive I am trying to pass into the container. Also if anyone has good resources for understanding the uid/gid permissions that would also be very helpful. Thanks in advance!
 

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!