Mount network share (AFP/SMB) for multiple users (fast user switching)

Solution 1:

  1. Setup your NAS to export a NFS-share. Refer to the Synology knowledgebase how to do this or use the following how-to to set it up, fine tune and secure your set-up.

    You may do it manually in the command line also:
    Let's assume your media folder is /Shares/Media. Create or edit a file named exports in /etc. The example below restricts the access to computers with an IP address in the range 192.168.0.1 - 192.168.0.254. You may have to restart your NAS or at least nfsd (nfs-daemon).

    Linux/NAS file /etc/exports:

    /Shares/Media 192.168.0.0/255.255.255.0(rw)
    

    if you use a Mac Server use this line:

    /Shares/Media -network 192.168.0.0 -mask 255.255.255.0
    
  2. Edit /etc/auto_master on your Mac and add the line:

    /-                                  auto_media
    

    file /etc/auto_master:

    #
    # Automounter master map
    #
    +auto_master                        # Use directory service
    /-                                  auto_media
    /net                                -hosts      -nobrowse,hidefromfinder,nosuid
    /home                               auto_home   -nobrowse,hidefromfinder
    /Network/Servers                    -fstab
    /-                                  -static
    
  3. and create a new file auto_media in /etc on your Mac

    file /etc/auto_media:

    /Media         IP-NAS:/Shares/Media
    
  4. Please don't forget: all files mentioned above need a trailing empty line

  5. enter sudo automount -vc in Terminal on your Mac with the output:

    $ sudo automount -vc
    automount: /Media updated  
    automount: /net updated  
    automount: /home updated  
    automount: no unmounts  
    

/Media will now always be visible in the root folder of your Mac and accessible for both of you as long as the NAS is up & running. No Apple Script to mount it nor a Connect to Server needed.

(Set up and tested on a Server 10.7 (no Synology NAS, because i don't own one, but it shouldn't make a difference) and Client 10.9)