I've been using Mac OS X for a while now, but upgraded to a 13-inch Macbook Pro Retina about a year ago. I love having access to the command line and I just RDP when I need to do anything on a Windows machine at work. I often find myself needing to access my NAS and networking is one of the only features of OS X to which I have had trouble adapting. On my Ubuntu laptop, it is effortless to mount a network drive and access it like a local disk or path, but that is not the case on my Mac. Time and time again, I have to re-establish my connections to the NAS, which is time consuming.
Other articles instruct users to mount the volumes and add those volumes to Login Items for automatic mounting. I wanted a solution more closely aligned to editing fstab. After a bit of trial and error and searching the web, I came across this article.
My original idea was to mount my NAS to a folder in /Volumes. This was problematic due to weird permission issues and automatic folder removal after a reboot. I finally realized that for better integration into my normal workflow, I would be far better off mounting the NAS to my home directory in /Users//. I also found that using AFP (Apple Filing Protocol) gave me better performance than CIFS/SMB. I am using AFP in my example, but if you want to use another protocol, the steps are very similar.
- Usually, disk mounting is an automatic process and happens when the external hard drive gets connected to Mac via one of the USB ports. Hard drive mounting can be done manually using Disk Utility.
- I checked Disk Utility - to be honest I didn't know what I was looking for. This is what I can see (photos below). Notice that there is no Macintosh HD and 'disk0s2' is greyed out. I tried to mount it but unsuccessful.
- May 13, 2013 You can mount and unmount drives, volumes, and disks from the command line of MacOS and Mac OS X. For many users, the easiest way to unmount a drive in Mac is to either just drag a volume into the Trash, use the eject keys, disconnect the drive, or use one of the force eject methods.
My NAS is a Seagate GoFlex Home, so I created /Users/brandon/GoFlex as myself. Then I followed the steps outlined by bmorganthaler on the Apple Discussions website.
From a terminal window:
$ sudo touch /etc/auto_afp
$ sudo chmod 600 /etc/auto_afp
Mac Os Terminal Mount Disk
On my Ubuntu laptop, it is effortless to mount a network drive and access it like a local disk or path, but that is not the case on my Mac. Time and time again, I have to re-establish my connections to the NAS, which is time consuming. Other articles instruct users to mount the volumes and add those volumes to Login Items for automatic mounting.
Open the auto_afp file with vi to add the necessary lines.
$ sudo vi /etc/auto_afp
If you are unfamiliar with vi, once it launches, type i to get into insert mode and enter the following, edited to your needs: (local_mountpoint) -fstype=afp afp://(username):(password)@(hostname)/(share). For example:
/Users/brandon/GoFlex -fstype=afp afp://brandon:[email protected]/brandon
Hit esc to get out of insert mode, type :wq to save and exit. Now we have to configure the system to call the new auto_afp configuration we created.
$ sudo vi /etc/auto_master
Add the following line using the vi techniques outlined above.
/- auto_afp -nosuid
Save & quit, then restart the automount process to mount the new path(s).
Mount Disk Mac Os High Sierra
$ sudo automount -vc
Verify that your path is mounted an accessible and reboot just to make sure it mounts as expected.
Mac Os Disk Recovery
That's pretty much it! You now have the mounts you always dreamed of having. I was able to add some of my media folders to my Favorites bar for quick access, something I was not able to do when I had the mount point located in /Volumes. I was lucky that my NAS supported AFP, but if you have to use SMB, just replace the AFP names with SMB and I think you should be set — although I haven't tested it.
Brandon has worked in IT for nearly 20 years, and currently serves as a SQL Server DBA for a healthcare company in California. In his spare time, he runs for miles and helps maintain RealCajunRecipes.com. Brandon is a certified SQL Server administrator.