Mounting Network Drives

Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
Hey there,

Just thought I'll post something on here about mounting network drives.

I had a problem where I setup iTunes and iPhoto to store their media libraries on a file server. That way, in the event of needing to reinstall the OS or formatting the computer, I never need worry about my music and photos being lost.
I made an application that will launch every time I log in, but I've noticed that when the Mac goes into sleep, on waking, the network drive has been ejected. And I need to run the application manually to before iTunes or iPhoto launch, otherwise I'll errors or messages showing up on my screen.

Reading online, there were a few solutions that involve installing 3rd party software like Sleepwatch and drive mounting solutions.
Then I came to know about Automount in OS X, which allows you map a network drive and solves my issue completely. Another thing is that I won't ever need to use my application again and I will never need any other 3rd party app as well.
That to me is excellent. And its so easy to do using Terminal

  1. Lauch Terminal
  2. Using vi editor, add a line to AutoMaster
    Code:
    sudo vi /etc/auto_master
    I added
    Code:
    /Volumes/		auto_resources
    just above the +auto_master line.
    It will look like this.
    Code:
    # Automounter master map
    /Volumes/		auto_resources
    +auto_master		# Use directory service
    /net			-hosts		-nobrowse,hidefromfinder,nosuid
    /home			auto_home	-nobrowse,hidefromfinder
    /Network/Servers	-fstab
    /-			-static
  3. Now create the auto_resources file.
    Code:
    sudo vi /etc/auto_resources
    in the blank file add...
    Code:
    MediaName	 -fstype=smbfs smb://user:password@serverIP/ShareName
  4. Activate the AutoMount
    Code:
    sudo automount -vc
  5. Restart the computer.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
My Apologies.. Ignore the 1st post. These are the correct instructions

I must apologise.. I made a mistake in the earlier post that will actually stop your OS from loading any dmgs or USBs.
I've corrected and thoroughly tested it now. The following really works. :)

  1. Lauch Terminal
  2. Using vi editor, add a line to AutoMaster
    Code:
    sudo vi /etc/auto_master
    I added
    Code:
    /Volumes/		auto_smb
    It will look like this.
    Code:
    # Automounter master map
    #
    +auto_master		# Use directory service
    /net			       -hosts		-nobrowse,hidefromfinder,nosuid
    /home			auto_home	-nobrowse,hidefromfinder
    /Network/Servers    -fstab
    /-			       -static
    /mnt/                       auto_smb
  3. Now create the auto_smb file.
    Code:
    sudo vi /etc/auto_smb
    in the blank file add...
    Code:
    MediaName	 -fstype=smbfs smb://user:password@serverIP/ShareName
  4. Activate the AutoMount
    Code:
    sudo automount -vc
  5. Restart the computer.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top