Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

Networking and servers • Re: Samba Guidance

$
0
0
For stuff you're serving you'd generally mount it under /srv not /mnt.

There's also no need to (re)mount a directory to make it available as a Samba share or even to make it appear at a different place in the file tree. Samba can export any arbitrary directory as a share.
Ah, Mr Thagrol, hello again... your documentation (Building A Pi Based NAS) was excellent, I just want to go further :)
For a bind mount you'd do something like the following in your fstab:

Code:

PARTUUID=*/mnt/fooext4defaults,nofail00/mnt/foo/bar/mnt/baznonedefaults,bind,nofail00
I've included the nofail option as it allows boot to continue should the mount fail (e.g. if teh drive is nto present at boot) which makes troubleshooting thins much easier.
So, the current state of my smb.conf is (at this point I have pretty much what your PDF describes):

Code:

[global]log file = /var/log/samba/log.%mserver role = standaloneunix password sync = yes[nvme02]path = /mnt/nvme02/available = yesvalid users = xxxxxxxxread only = nobrowsable = yespublic = yeswritable = yesforce create mode = 666force directory mode = 777
Figuring that would work, I simply copied that for my music share (appeared to work), then again for others and rebooted ... which didn't. Initially it appeared the folders I'd created on the partition were being wiped and I couldn't recreate the Samba shares but further investigation suggested it was a permissions error, permissions previously set using chmod. When I tried to reset them, I got an "Input/output error") but reverting it all to the above, corrected that (and the folders I'd created returned).
Some suggested reading
I'll look at those links (even the "shamelessly self-promoting" ones).
If you use the fstab entry you have specified, then that's exactly what happens - you end up with the directories in the NASData partition appearing under /mnt/nvme02. Any of those directories can then be shared out using an entry in smb.conf, for example:

Code:

[shareone]path = /mnt/nvme02/firstdirread only = no[sharetwo]path = /mnt/nvme02/seconddirread only = no
Samba has no concept of drives - it just shares out any location in Linux's filesystem hierarchy. The following is therefore also perfectly valid:

Code:

[sharethree]path = /mnt/nvme02/firstdir/anotherdirread only = no
That's what I did when I mentioned above that I copied that for multiple "shares" and rebooted.
I'd rather have specific mappable drives for each category of data
you mean this from the perspective of the client machines - i.e. they're Windows boxes, and you want a mapped drive (U:, V:, W: etc) per category of data. If I've understood you correctly, then the above example should allow you to do this, i.e. a directory in NASData for each category of data, each with it's own share specified in smb.conf.
That is what I meant, yes but unless I've done something wrong (entirely likely), it didn't work.

Thanks both :)

James

Statistics: Posted by JamesCRocks — Sat Aug 09, 2025 12:10 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles