Comment on Help with SMB mount - can read/delete but not write
just_another_person@lemmy.world 3 weeks ago
Two things:
- This is the most inefficient way of sharing files between containers. Use the same volume mount between containers if you just want both to have access to the same files
- In order for SMB to work properly, and not cause file access violations, you need to have unique users for auth that map to a UID on the filesystem. If the files and folders you’re mounting are owned by root with uid=0, and SMB maps to another user you’ve created with uid=1000, then your SMB user won’t be able to read or write anything.
It may be easier to explain exactly what you’re trying to achieve here so someone can offer a better way of setting this up for you.
user9314p@lemm.ee 3 weeks ago
This is a 2nd server I’m building to back up data from my main NAS. The goal is to set up something like restic to back up my important pictures/documents/etc. Since the CPU on this also has Quicksync I’m planning to use it for Jellyfin and migrate my Radarr/Sonarr stack over.
just_another_person@lemmy.world 3 weeks ago
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.
user9314p@lemm.ee 3 weeks ago
Here’s a discussion about whether to install on the host vs making a separate VM to serve the files. I don’t know if there’s a right or wrong way to do this, but since I’m running mergerfs/snapraid I figure I’d put it in a VM to keep it separate from Proxmox.
I ended up getting it to work by checking the permissions on the Samba server. The folders were owned by the right user (uid=1000) but not the right gid (gid=something else). chown’d everything to 1000:1000 and 775 permissions and now everything is functioning as expected. Thanks for the help!