change permission of mounted drive in lxc

shahram

New Member
May 11, 2023
4
0
1
Hi everyone,
I've mounted my ssd to one of my LXC Containers.
I've entered "ro=0" but now the drive has 755 and I'm not able to change it to 777.
1684334783023.png
I have trueNAS on a VM and there I have a SAMBA Active.
Docker runs on a LXC and I need to use my ssd as a volume for one of images.
1684334907557.png
Best regards,
Shahram
 
Looks like your "/mnt/pve/Nas" is a mountpoint where you mounted a SMB share from your TrueNAS? How did you mount that SMB share? The rights of that folder are defined by your options you used to mount that SMB share. Mounting an SMB share with the options "uid=1000,gid=1000,file_mode=0777,dir_mode=0777" would mount the share as UID/GID 1000 with 777 rights for files and folders.
 
Hi @Dunuin, thank you for your answer. No I didn't mount a smb share, that was actually my first plan. since my ssd is connected to my proxmox node and it's the same ssd that I use in my truenas pool für my NAS and smb share, here I just passed the ssd through the lxc.
I've added a line to lxc conf file.
pb0: path/in/host(pve) ,pb=path/in/lxc,ro=0,shared=1
since I'm in proxmox always with root I have entered 0 for UID and GID in docker stack.
best regards, Shahram
 
Last edited:
since my ssd is connected to my proxmox node and it's the same ssd that I use in my truenas pool für my NAS and smb share, here I just passed the ssd through the lxc.
So you mount the same SSD in your PVE host as well as in a TrueNAS VM? Because this would corrupt data. You can only mount a SSD by one OS.
 
Then correct way without corrupting data would be to passthrough that disk into your TrueNAS VM without mounting any partitions or ZFS pools of that SSD on your PVE host. Then share your folders using SMB/NFS and then mount those SMB/NFS shares on your PVE host and bind-mount them into an unprivileged LXC or directly mount the SMB/NFS shares inside a privileged LXC or another VM.
 
  • Like
Reactions: shahram

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!