Saturday, October 18, 2014

OSX Yosemite Automount NAS Share

Saturday, October 18, 2014 Posted by Andre Broers 15 comments
On my fresh installed Yosemite on my Macbook Air I want a mounted folder in my homedir when I am at home near my NAS. When I'm not at home it must not bother me with the none existing share. And when I'm back home it must silently reconnect.

This can be done by using autofs.

edit the file /etc/auto_master

## Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/Users/broersa/Documents/Shares auto_resources
/- -static 


The line starting with /Users is added. This will automount on the path selected. It will pick the resources from auto_resources. This is a new file we have to create:

all -fstype=smbfs ://username:password@192.168.2.254/all 

This will automount the share all on the path /Users/broersa/Documents/Shares/all

do a "chmod 600 auto_resources" to protect the username password from other users then root.

reload the config.

automount -vc

Don't forget to do everything as sudo.

Now you have your share always available when in range.

15 comments:

  1. Hi, everything fine and well explained.
    But I get empty shares ( the server is mac mini running 10.10 )

    ReplyDelete
  2. I get empty shares also and Terminal says "No locks available"

    ReplyDelete
  3. Is it possible to do this without including the username and password in the file and instead use the username and pass of the currently logged in user? This would be helpful in a multi-user environment

    ReplyDelete
  4. this solitary wanted to Build a Nationwide Playground process The idea will be the Individual envy in the world; and also the Shawnee Inn aided they undertake The idea - That is the way.http://www.mordocrosswords.com/2015/10/mt-olive-offerings.html

    ReplyDelete
  5. i have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates.
    Digital Marketing Company in Chennai
    Digital Marketing Services in Chennai

    ReplyDelete
  6. Try adding smb before the ://Username:password part. So smb://Username:password, this worked for me on OSX Sierra

    ReplyDelete