# Location for shared directory (samba, netatalk, nfs)?

## Daytona

Hello together,

I am in the process of setting up a file server, and am unsure of where best to place the shared directories.

Primarily they will be shared via samba, but I will also share via NFS for my *nix specific things (/usr/portage is already), and netatalk for classic Apple things. So it is not strictly necessary that they be in the same (relative) root, though it would be preferable so, for example so I can add some files for classic Mac from my Win machine, and so on. (I am aware this example may cause issues with netatalk, that's another issue, let's assume it's ok). I would also like my media (pictures, music, video) accessible by all clients (which are approved, that is)- that is  a big part of my motivation.

Where do you place your shares? I have looked at the Filesystem Hierarchy Standard, it doesn't give specifics but seems to point towards somewhere in /var, but I could also see some other options: creating a directory in /home for the user that nfs, netatalk and samba run under; creating a new partition (or adding a drive) and mounting into /mnt; or my initial thought was /usr/share, though with further investigation this seems less preferable.

Thanks,

/Ben

----------

## Jaglover

/shared is kind of scary, I have stuff in /usr/shared or in /usr/local/shared depending on OS in use. But you could have it in /opt/<something>.

----------

## Daytona

Thanks for the input!

Hmm, back to /usr/something. Given that I run one big partition, I guess it doesn't matter too much.

----------

## gerdesj

 *Daytona wrote:*   

> Thanks for the input!
> 
> Hmm, back to /usr/something. Given that I run one big partition, I guess it doesn't matter too much.

 

From the FHS: http://www.pathname.com/fhs/pub/fhs-2.3.html#PURPOSE16A

It would seem /srv is the place you might be looking for. It's not just for www and ftp as seen on eg SuSE.

Cheers

Jon

----------

## Daytona

 *Quote:*   

> It would seem /srv is the place you might be looking for. It's not just for www and ftp as seen on eg SuSE.

 

Hmm, yes I either overlooked that, or paid no attention since it's not present by default (makes sense, because there are no servers by default) on Gentoo.  That definitely has the advantage of being easily accessible, and also I won't have to worry about accidentally clobbering it as well.

I think that would be the best choice. Thanks for pointing it out!

I've been looking for a "best practice".  Some time or another, I've seen about every option I originally mentioned. So that got me wondering if one was better than the other, and why.  The two reasons I gave are the only two I've found that promote this location over any other.

----------

## derk

Another example : A well known bookshelf linux based network file server system uses    /shares  for nfs, samba and afs mounts  by users

----------

## krinn

as nfsv4 need a root to start playing with and you'll need to bind your export to it, i would have taken that one for sharing, and nfs doc refer to /export, seems like a default.

----------

## djinnZ

 *Daytona wrote:*   

> Where do you place your shares?

 depend: how you share, why you share and what you share?. This is the question

By example (and is useful form me work directly on the pc used a server) i have:/opt/acct - smb - accounting system (cobol-based shitware) - something must run directly on the server, some data and executables must be exported to the clients (and all must be in the same dir)/opt/prg - nfs and smb - some (java or .net crapware) - multi-platform service shared between local users, remote users and windows pcs (something I find useful to run directly on the server something not)/home/Documents - nfs and smb - documents shared between users and computers/usr/portage - nfs - i have the overlay(s) in the same dir, speak as itselfshare, documents, prg and storage; in /srv - nfs and smb - the big waste of all the files shared between the others computers in the small network i have./home/p2p - smb - jdownloader (but the code is installed in /opt), mule, torrent ann so more run from a dedicated user on this directory

/exports is a legacy from solaris os and in the LFHS is replaced by the /srv as i am able to understand.

/usr/shared and /shared (or shares) seems be another legacy to me (do not remember the linux distribution, but was in SCO also).

I remember an /usr/acct, used also for user's home, on very old systems (~1980) and often (as in the accounting shitware i use) there is something as /u/... used but not remember from what legacy it come.

Perhaps /srv/exports will be a good replacement for the old concept of /exports in nfs documentation.

Do not forget the partitions needs; some shared applications must never run on the host (as i do for the crap in /srv/prg) so mount an entire dedicated partition on /srv (-o noexec, nodev but nosuid is useful also) is better and this is the reason to have /opt/prg and /srv/prg also.

the ¼ cents of mine

----------

## nomilieu

/srv

I find it easy to have shares in just one place.

----------

