[SOLVED] Accessing mounted share with write access

putdownfox

New Member
Dec 15, 2024
7
0
1
Hello - I'm pretty new to proxmox, but I'm currently running it on a mini PC so that I can run the arr suite of apps. I had everything up and working with write access to an smb network share that I set up in TrueNas. However, today the write access permission seems to have stopped working. Nothing changed.

On the node, I have mounted my CIFS share:
//192.168.0.218/Media/admin on /mnt/PlexMedia type cifs (rw,relatime,vers=3.1.1,cache=strict,username=admin,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.0.218,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=3261752k,nr_inodes=815438,mode=700,inode64)

Within the SABNZB LXC container I have set the mount point in .conf file:
mp0: /mnt/PlexMedia,mp=/mnt/

Within SABNZB LXC container I get the below when executing mount -l
//192.168.0.218/Media/admin on /mnt/PlexMedia type cifs (rw,relatime,vers=3.1.1,cache=strict,username=admin,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.0.218,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)

However if I try to create a new folder or file etc on the mounted share or if sabnzbd tries to write to the share, I get an error:
mkdir: cannot create directory ‘test’: Permission denied
 
When /Media/admin on truenas 192.168.0.218 is mounted readonly then the cifs share is readonly as followon error also so maybe you have a pool problem ? Test writing in truenas first, than on pve and last on your lxc to see where the problem is.
 
When /Media/admin on truenas 192.168.0.218 is mounted readonly then the cifs share is readonly as followon error also so maybe you have a pool problem ? Test writing in truenas first, than on pve and last on your lxc to see where the problem is.
I am able to write to the share from proxmox node, but not from the lxc. Truenas pool is set up for read/write.
 
The real error message is ever written on the "server" which is truenas, so take a look into that smb logs regarding your lxc.
 
I don't ever have truenas but it's linux so maybe in /var/log/samba/. but as truenas is gui based if strongly assume you can read them by gui too.
 
i'm still unable to figure this out - this was working yesterday and today it doesn't work. I didn't change anything.
 
I started over.

Mounted both drives on TrueNas VM
qm set 101 -scsi1 /dev/disk/by-id/ata-HGST_HUH721010ALE604_2THDKP1D
qm set 101 -scsi2 /dev/disk/by-id/ata-HGST_HUH721010ALE604_2THND4AD
1734872792136.png

I set up a pool in TrueNas:
1734878376268.png

Group permissions:
1734878401454.png

User permissions:
1734878443637.png

Samba share:
1734878522785.png

Mounted the directory using tank username with pw.
//192.168.0.247/tank/media on /mnt/media type cifs (rw,relatime,vers=3.1.1,cache=strict,username=tank,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.0.247,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)

Accessing the directory from the node and I am able to create new directories within the mounted drive.
1734878239472.png

Set mount point within the container .conf file. I would assume since the node can write to the directory, the container should be able to as well, since the node is mounted with username and password.
1734878645308.png

Enter the container - permission denied. Again - this same config was working 2 days ago.
1734878305588.png


Where am I going wrong?
 
Solution - Mount the drive on the proxmox host with UID and GID = 100000. The below youtube was the only source I could find that explains every step of the process. Essentially the host knows the root user of the lxc of 100000, while locally the user of the lxc is 0. So you have to mount the drive using UID and GID of 100000 to gain write access.

mount -t cifs -o user=tank,password=my_password,uid=100000,gid=100000 //192.168.0.247/mnt/tank /mnt/pve/

https://www.youtube.com/watch?v=CFhlg6qbi5M
 

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!