Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to mount a network share (AFP/SMB) for multiple users (fast user switching)?

I'm having the following problem with my network shares from my NAS (Synology 415+ if it matters) in Yosemite.


At home, we have an iMac with two different users. I moved all of our media (music & photos) to the NAS, so that both users could use the data with the according apps. I thought, that it would be easy to mount the network shares for both users, but actually it isn't - or i'm doing it wrong.


I'm using a simple Applescript in the following form


tell application "Finder"
    activate
    mount volume "smb://ipaddress/sharename/"
end tell


that is started automatically when my user logs into the system.


That works fine for me. But when my partner switches to her user account, the mounts aren't accessible for her. Moreover, when she starts the same script as i do, the paths are getting messed up:


If two users mount the network shares, two different folders exist on the system:

/Volumes/music

for the first user and

/Volumes/music-1

for the second user, which messes up all file paths (especially in iTunes, but also in Lightroom or other apps).


Is there ANY way to mount a network share for both users? I really don't care if i use AFP or SMB, i just want a network share which is usable with multiple users and has obviously the same path.

iMac, OS X Yosemite (10.10.1)

Posted on Nov 25, 2014 7:47 AM

Reply
6 replies

Nov 25, 2014 8:44 AM in response to taner82

For AFP and SMB shares you will get each user seeing a different path as you described i.e. /Volumes/music and /Volumes/music-1 depending on the program this will almost certainly cause a problem due to the potential variation in the file path. If some programs use a different method to access files e.g. file-id numbers rather than file paths then they might work.


The only way to have a share accessible to two or more users is to use NFS. NFS is still built-in to Yosemite but is not made easily accessible - at least to act as a server. For the client side using nfs://server/ should be possible but you may need to automate this to happen at boot time rather than user login time.


I don't think this will help but when I hit a similar problem I was able to get round it, I had multiple users all logging in on a single Mac and all accessing the same file server via AFP. This resulted in multiple /Volume/Shared, Shared-1, Shared-2, etc. entries. The users would see multiple icons for these drives on their desktop but only one would let them access it. In my case I also needed an AppleScript to access this share and in my script I got round this by writing a loop that started off at /Volumes/Shared and tried to read a file, if it could read that file it was the particular share belonging to the active user, if not it incremented the counter and tried the next one and so on until it found the one that 'belonged' to the user, the script could then do the remaining steps building a working file path based on what value the counter had reached.


If your trying to access an iTunes or iPhoto or Aperture library on a server e.g. a NAS then this approach is unlikely to work, furthermore iTunes etc. will only allow one user at a time to open the library files for writing.


Have a look at this http://supersync.com/docs/nas.php this would sync copies between the NAS and each user. Each user however ends up with full copies of the files, so with 4 users you would have at least five copies, one for each user plus the central one on the server. However each user would have their own with no conflicts between the others and no file path issues.

Nov 25, 2014 9:00 AM in response to John Lockwood

Thank you for your fast response. NFS could be an option, i will look into that. But I still cannot believe that such a common (at least in my opinion) scenario isn't possible with AFP or SMB?


By the way: I'm not trying to access iTunes or Lightroom libraries on a server - only the actual data (music files and photos) is on the server. Every user has its own iTunes library and Lightroom is used via a shared library which is stored on the iMac (under /Users/Shared/).

Nov 25, 2014 1:22 PM in response to taner82

Hi Linc,


i tried that already.

Here is my auto_master

+auto_master            # Use directory service
/-                    auto_nas
/net                    -hosts          -nobrowse,hidefromfinder,nosuid
/home                  auto_home      -nobrowse,hidefromfinder
/Network/Servers        -fstab
/-                      -static

Here is auto_nas

/mnt/music -fstype=afp afp://user:password@192.168.178.38/music

Johns-iMac:etc John$ ls -alt
total 760
drwxr-xr-x  94 root  wheel    3196 Nov 25 22:05 .
-rw-r--r--  1 root  wheel    225 Nov 25 22:04 auto_master
-rw-r--r--  1 root  wheel      65 Nov 25 22:04 auto_nas


I thought it worked:


Johns-iMac:mnt John$ ls -alt
total 2
drwxr-xr-x  33 root  wheel  1190 Nov 25 22:07 ..
dr-xr-xr-x  2 root  wheel    1 Nov 25 22:06 music
drwxr-xr-x  4 root  wheel  136 Nov 25 22:04 .
dr-xr-xr-x  2 root  wheel    68 Oct 26 02:59 diskstation

But when i cd into that directory it changes to

Johns-iMac:mnt John$ ls -alt
total 0
drwx------@  1 John  wheel  264 Nov 25 22:07 music
drwxr-xr-x  33 root  wheel  1190 Nov 25 22:07 ..
drwxr-xr-x  4 root  wheel  136 Nov 25 22:04 .
dr-xr-xr-x  2 root  wheel    68 Oct 26 02:59 diskstation

So afterwards when i switch the user i get this:


Johns-iMac:mnt Jane$ ls -alt
total 0
drwx------@  1 John  wheel   264 Nov 25 22:07 music
drwxr-xr-x  33 root   wheel  1190 Nov 25 22:07 ..
drwxr-xr-x   4 root   wheel   136 Nov 25 22:04 .
dr-xr-xr-x   2 root   wheel    68 Oct 26 02:59 diskstation
Johns-iMac:mnt Jane$ cd music/
-bash: cd: music/: Permission denied


What am i doing wrong?

How to mount a network share (AFP/SMB) for multiple users (fast user switching)?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.