Mac OS X: Auto mount network shares as file system

Author Johnny Josefsson on February 10, 2012 | Print | Bookmark
Instead of manually map them in Plex each start up or using Bonjur Application you can use the native auto mount 'file systems' NOTE: This probably requires a minimum OS version of Mountain Lion (or Mavericks. Yosemite has not been tested). When you send the command you should see you're NAS mounted as the specified user. AUTO_MASTER to allow for SMB and/or AFP
/etc/auto_master
----------------------------------------------------------------
#
# Automounter master map
#
+auto_master  # Use directory service
/net   -hosts  -nobrowse,hidefromfinder,nosuid
/home   auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/-   -static
# smb/cifs
# look in auto_smb and follow it completly for more mount points
/-                      auto_smb             -nosuid
# afp
# look in auto_afp..
/-                      auto_afp             -nosuid
SMB
nano /etc/auto_smb
----------------------------------------------------------------
# Purpose:         Mount HTPC Shares
# Location:        /etc/auto_smb
# Example:
#                  /mount/path/pathname -fstype=smbfs,soft smb://user:password@server/sharedir
# Update mounting points (manually)
#                  sudo automount -vc
#
/Users/johndoe/Shares/mystic -fstype=smbfs,soft smb://username:password@angela.domain.top/share
/Users/johndoe/Shares/spawn -fstype=smbfs,soft smb://username:password@spawn.domain.top/share
/Users/johndoe/Shares/violator -fstype=smbfs,soft smb://username:password@hope.domain.top/share
AFP
nano /etc/auto_afp
----------------------------------------------------------------
# Purpose:         Mount HTPC Shars
# Location:        /etc/auto_afp
# Example:
#                 /mount/path/pathname -fstype=afp,soft afp://username:password@server/sharedir
# Update mounting points (manually)
#                  sudo automount -vc
#
/Users/johndoe/Shares/angela -fstype=afp,soft afp://username:password@angela.domain.top/share

----------------------------------------------------------------
This is how a good mount looks like:
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
map auto_smb on /Users/htpc/Shares/angela (autofs, nosuid, automounted, nobrowse)
//htpc@angela.domain.top/share on /Users/htpc/Shares/angela (smbfs, nodev, nosuid, automounted, nobrowse, mounted by htpc)

This is how a good file system on the mount looks like

drwx------  1 htpc  wheel  16384 Jun  3 11:02 Barn
drwx------  1 htpc  wheel  16384 Oct 11 15:41 Bilder
drwx------  1 htpc  wheel  16384 Nov 14 11:16 Film
drwx------  1 htpc  wheel  16384 Sep  5 09:21 TV-serier

Was this article helpful?

Yes No

Category: Apple, OS X

Last updated on November 30, 2014 with 3011 views