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

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.

If you want to appear at more than one location in the file tree for other reasons you'd use either a bind mount or a symbolic link.

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.

For a symbolic link add the partition via fstab and run the following once.

Code:

sudo ln -s /mnt/foo/bar /mnt/baz
The ln command can be run and will succeed whether the partition is currently mounted or not. Attempts to access it will fail if the partition is not mounted.

Some suggested reading:
Filesystem Hierarchy Standard
[shameless self promotion]
Building A Pi Based NAS
Using fstab A Beginner's Guide
[/shameless self promotion]

Statistics: Posted by thagrol — Fri Aug 08, 2025 10:22 pm



Viewing all articles
Browse latest Browse all 8037

Trending Articles