How to get "fast user switching" and network shares playing nice

Discussion in 'Mac OS X Lion (10.7)' started by Omniver, Aug 11, 2011.

  1. Omniver macrumors member

    Joined:
    May 6, 2011
    Location:
    Boston, MA
    #1
    I've been alternating between banging my head against a wall and reading every forum I could find to try and get a reasonable compromise between using "Fast user switching" and sharing a folder from a file server. It baffles me how the network share/mount model of OSX/AFP is completely killed by fast-user-switching; this is a big problem with Apple requiring users to be actively logged in to share music/video from iTunes which therefore essentially requires fast-user-switching if anyone else wants to use the computer. (anyone find it odd that you can share files without being logged in, but sharing songs requires an active login for each user who is sharing? Apple: time to make iTunes sharing a service!)

    For the sake of example, lets just say I want to share my /Groups folder from my desktop and have it be accessible to my laptop. Here are all the things that I tried:

    Apple Method 1) Share /Groups in the Server.app on the desktop (running Lion Server), use finder on the laptop and drag the share icon to "Login Items", alternative use a startup Apple script using "mount volume" Both of the options work and will mount the /Groups folder under /Volumes/Groups, of course when the second person logs in via fast-user-switching (and occasionally the first person for no apparent reason), they will get /Volumes/Groups-1 since /Volumes/Groups is already taken. Tomorrow we log in a different order and now the previously /Volumes/Groups-1 user has their mount at /Volumes/Group and vice-versa. Any links, aliases, finder sidebar references, and application settings which pointed to yesterday's location are now BROKEN. Not very user friendly to my mother-in-law who is trying to find those pictures of the kids and doesn't know anything about mount points. I also can't reasonably mirror the file location structure on the desktop so that application preferences that are synced between the two (portable home directories) work. fail.

    Apple Method 2) Use automounter and set up by hand direct maps for /Groups or an indirect maps for the children of /Groups. Now it will automatically get mounted to /network/servers/SERVER/Groups/ on the laptop and on the desktop it will automatically create a similar symlink structure so that the same path (/network/servers/SERVER/Groups) work both on desktop and laptop. Cool. Except when the second person logs in, the /network/servers/SERVER/Groups/ mountpoint is already owned by the first user and they don't have any permissions to access it. Fail.

    Apple Method 3) Use mount_afs and specify directly the mount-points. Have each user have their own startup AppleScript which mounts /Groups to a different location (e.g. /Users/Shared/username/Groups) that way they don't conflict with multiple users. On the desktop, set up symlinks from /Users/Shared/username/Group to /Groups so that it will be the same as the client and applications settings will work when synchronized back/forth by portable-home-directories. Will it work, yes it does, but what a bear to maintain. Is this really what I should expect to do just to have multiple users on my desktop and laptop (which again is essentially required now if I want to do any type of iTunes sharing). This can't be what apple expects.

    What I ended up doing - the "not quite apple" solution.

    Non-Apple Method 4) After a read of "Autofs: Automatically Mounting Network File Shares in Mac OS X" (http://images.apple.com/business/docs/Autofs.pdf) at the very end there is a single paragraph of "Kerberized NFS": "A Kerberized NFS mount can have multiple connections from multiple users, each using the correct user’s credentials for each transaction. This allows administrators to support multiple users, each authenticated with their own credentials to the same mount point. This is very different from AFP and SMB mounts," (emphasis mine)

    It appears that by using good 'ole NFS (albeit with Kerberos for security!) you can actually have multiple users on the same mount point. Roughly following the guidance at https://support.apple.com/kb/TA24986?viewlocale=en_US. What I needed to do was:

    1) create /etc/exports on my desktop and add a single line "/Groups -sec=krb5". The existence of /etc/exports triggered a start of nfsd which no longer has any GUI options in Lion.

    2) Add a line to /etc/auto_master on my laptop "/- auto_mymounts" to reference a new direct map.

    3) Create /etc/auto_mymounts and add a single line "/Groups SERVER:/Groups" to create the direct map.

    THAT'S IT. Three lines in three files.

    Now when I log into my laptop, there is a /Groups that is a network mount of my desktop's /Groups, same location AND it works for all of my users, even simultaneously.

    In the end I'm happy with what I've got, but man was this a difficult path just to support fast-user-switching. In Lion, Apple appears to be getting away from NFS (no longer turned on by default and remove from the GUI controls) but clearly this really useful functionality which doesn't exist in AFP.

    I'm really curious, after all this work. Any other ways to accomplish this?
     
  2. Archidrafting macrumors newbie

    Joined:
    Nov 25, 2011
    #2
    Nfs auto mount in Lion Server

    Hi
    I know nothing of OSX beyond being a user
    I am trying to figure out how to create & auto mount 2 NFS share Volumes on 2 osx lion laptops so I can do Backup Clones to them (needs to be an nfs share to Clone)
    I can mount the volumes via startup but not as NFS
    Am hoping you may be able to guide a newbie
    The Server has NFS running as per below By default as its still required for some services in Lion Server Although there is No GUI in server app or in server Admin.

    [from terminal]
    nfs:mountd = "RUNNING"
    nfs: portmap = "STOPPED"
    nfs:state = "RUNNING"
    nfs:setStateVersion = 1
    nfs:readWriteSettingsVersion = 1
    nfs:servicePortsRestrictionInfo = _empty_array
    nfs:rpc.statd = "RUNNING"
    nfs:servicePortsAreRestricted = "NO"
    nfs:nsfd = "RUNNING"
    nfs:rpc.lockd = "RUNNING"


    I am not following your Non Apple Method & i may be getting Confused :confused: with all the reading & searching.
    All I wish to do is Automount an nfs volume (a different one on each machine) as an authorised user when the laptops boot.
    Thanks In Advance
     

Share This Page