Hi all, I’m so confused about what I’m doing wrong and couldn’t find any guides/troubleshooting for my specific problem, so hoping someone here can help.
I’m setting up a new Proxmox server and trying to share a folder between 2 Ubuntu VMs - a “Fileserver” VM running the SMB server and a VM that I will be running docker on (“docker VM”)
my smb.conf on the fileserver:
[pool]
path=/mnt/mergerfs
read only = no
browsable = yes
my fstab entry on the VM running docker:
//192.168.0.20/pool /mnt/pool cifs _netdev,credentials=/etc/.smbcredentials,uid=1000,gid=1000 0 0
On the Docker VM, I can see that the folder is mounted properly with the correct permissions for the uid/gid specified (dockeruser
) and with 755 permissions, but I am unable to write to it with either dockeruser
or root
. Interestingly, I am able to DELETE files on the share, which is confusing the hell out of me.
If I mount is as root
(no uid/gid arguments in fstab), I am able to write to it, but for “best practices” I’d like to get it working with a non-root user. Any ideas?
All I’m saying is that if you’re sharing files between two containers, giving them both volumes and using the network to share those files is not the best practiced way of doing that. One volume, two containers, both mount the same volume and skip the network is the way to do that.
To solve for this, you create user mapping in the samba configs that say “Hey, johndoe in samba is actually the ubuntu user on the OS”, and that’s how it solves for permissions. Here’s an example issue that is similar to yours to give you more context. You can start reading from there to solve for your specific use-case.
If you choose NOT to fix the user mapping, you’re going to have to keep going back to this volume and chown’ing all the files and folders to make sure whichever user you’re connecting with via samba can actually read/write files.