(you may want to read this on GitHub @ https://gist.github.com/l422y/8697518, since syntax formatting on coderwall is a bit wonky)
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
- Note: Old devices which does not contain UUID cannot be tracked for auto-mount; Russian Credits Page added (again, thanks to Anton) Version 1.8 - 12th of Sep 2018. Added Russian Localization (thanks to Anton) Added feature to automount volumes (without the notification) fixed equal volume name bug; Version 1.7 - 4th of Nov 2017.
- AutomountMaker is designed to help you eliminate repetitive actions when mounting network volumes: the app creates scripts that you can run with a mouse click or include in the list of login items to have them launched automatically at startup. Develop and run scripts automatically to streamline your day.
- Mac; Prevent automounting volumes in OS X. Posted on February 3, 2014 December 31, 2016 by Wolf Paulus. F you have multiple hard drives connected to your Mac, or maybe you have multiple partitions on a single hard drive, by default, OS-X will mount all those volumes at boot time.
Using automount. For use OSXFUSE on a Mac, we need to write a single line in the file /etc/autohome, but, we need to prepare a few other items. The automount system runs as a daemon without user interaction. This means that we need to create a shared key, which the.
/etc/auto_master (see last line):
/etc/auto_nfs (this is all one line):
Make sure you:
Otherwise the automounter will not be able to read the config and fail with a
bashsudo chmod 644 /etc/auto_nfs
Otherwise the automounter will not be able to read the config and fail with a
... parse_entry: getmapent for map failed...
error in /var/log/messages
This will not work (anymore!) though it 'should'.
bash$ sudo automount -cv...automount: /Volumes/my_mount: mountpoint unavailable
Note that, if you manually create the mount point using
But, upon restart, OS X removes the mount point, and automounting will fail.
mkdir
, it will mount.But, upon restart, OS X removes the mount point, and automounting will fail.
What's the solution?
It's so easy my jaw dropped when I figured it out.
Basically, we trick OS X into thinking we're mounting * somewhere else. *
Basically, we trick OS X into thinking we're mounting * somewhere else. *
When you're talking about paths in just about any environment, the root folder is the highest path you can reach, whether it's
C:
(windows) or /
(*nix)When you're at this path, attempting to reach the parent path, via
..
will keep you at the root path.For example:
/../../../../
is still just /
By now, a few of you have already figured it out.
TL;DR / Solution:
Change your
/etc/auto_nfs
config from (this is all one line):To (this is all one line):
And re-run the automounter:
..... there you go! Technically
/../Volumes
is still /Volumes
, but the automounter does not see things that way ;)This configuration persists the mount across restarts, and creates the mountpoint automatically in 10.8.5 (Mountain Lion) and 10.9.1 (Mavericks)
I KNOW, RIGHT?
Feel free to send me large checks and/or high five the screen (and hit the big red upvote button on top of this page)
[email protected]
[email protected]
Some questions that might come up
My NTFS disk diapppears for Desktop when using Mounty
Automount Macos Catalina
Unfortunately this is by design.
Mounty is using the Apple kernel driver. It allows read/write mount of NTFS drives only with the 'nobrowse' option. The mount point becomes hidden and disappears from Desktop and Finder menu. To make it easier to re-locate the drive I have added the 'Show in Finder' option in Mounty menu.
Mounty is using the Apple kernel driver. It allows read/write mount of NTFS drives only with the 'nobrowse' option. The mount point becomes hidden and disappears from Desktop and Finder menu. To make it easier to re-locate the drive I have added the 'Show in Finder' option in Mounty menu.
My USB stick will not re-mount. An alert is popping up telling me to re-attach the stick, but this doesn't help.
Automount For Mac Mojave
This can happen when the USB stick is not cleanly unmounted from the Windows PC. If you simply unplug the USB stick from PC without using the little tray icon to detach the hardware correctly, the volume will be marked as 'not cleanly unmounted'. There might be some dirty sectors left and Mac OS X will not be able to re-mount in read-write mode for that reason.
Suddenly all my files disappeared - please help!
This is usually happen when not all files are written properly due to an unmount operation not finishing. The NTFS partition might be marked as 'dirty' and the Apple NTFS driver cannot recover from that situation. Mounty will not delete anything by itself, please try to restore your files on a Windows PC using usual recovery s/w, i.e. chkdsk command line utility or professional tools like GetDataBack for Windows. If you do not own any Windows you can use tools for macOS that can deal with NTFS partition maintenance, like Paraogn Harddisk Manager or Tuxera Disk Manager.
Sometimes the files are grayed out and cannot be modified anymore.
This is because the file has extended attributes, refer to the Manpage of xattr for further explanation. If you open the file path in terminal application, you can list the attributes with
ls -l@ <filename>
, and remove those attributes with xattr -d com-apple.<attribute> <filename>, i.e.: xattr -d com.apple.FinderInfo testfile.txt
Automount Mac Os X Smb
Unable to re-mount in read/write mode when trying to mount Windows 10 partition
Automounter For Mac
If you try to mount a Windows System partition, Mounty might fail when Hibernation feature is enabled. There is a Fast Start feature in Windows which might be enabled by default, and this is causing the drive to be locked. Within Windows running, you need to run the command
powercfg /hibernate off
in an admin powershell and restart Windows to disable this feature and remove the lock to enable it for Mounty. Thanks to Art Schultz pointing that out.