Recently I have been on a journey to use block devices like a HDD partition in unprivilaged containers safely.
After many different methods and struggels i have come to a, in my opinion balanced resolution.
- Block devices
Here my solution is to create a mount directory and changing it's ownership to 100000:100000. Those settings translated to lxc container permissions make it be owned by root:root, because every uid and gid in container in Proxmox by default is created by adding 100000 to it's original uid and gid more here. Mounting of course can be achieved by manually mounting for example /dev/sdc2 in /mnt/storage which has correctly set ownership or adding a new rule in /etc/fstab. After all that a mount point can be added to container's configuration file
--mp[n] [volume=] ,mp= [,acl=<1|0>] [,backup=<1|0>] [,mountoptions=] [,quota=<1|0>] [,replicate=<1