Page History

Auto-mount remote SMB volumes

Nigel Stanger edited this page on 28 Feb

Clone this wiki locally

Note that / has been read-only since Catalina, but this didn’t affect things until a security update in May 2021 deleted the /mnt symlink. It’s … difficult but not impossible to re-create that, but but it’s much easier to just point directly to the original location, and automount doesn’t care. (I seem to remember there being some problem with using a static mount point in /Volumes, as suggested in, but I can’t recall the details.)

Pre-Catalina initialisation: sudo mkdir -p /System/Volumes/Data/mnt/shares

Post-Catalina initialisation: Use synthetic.conf to recreate /mnt as a firmlink (

# note: tab-delimited, reboot to take effect
mnt /System/Volumes/Data/mnt/shares

Add the following to /etc/auto_master:

/System/Volumes/Data/mnt/shares    auto_shares    -nosuid,noowners

(This change is likely to be clobbered by system updates, especially from Catalina onwards.)

Then in auto_shares (permissions 400):

username    -fstype=smbfs,soft ://
infosci-shared    -fstype=smbfs,soft ://
infosci-software    -fstype=smbfs,soft ://
lecture-dropboxes    -fstype=smbfs,soft ://
# "V2" may differ, "u" is the first letter of the username. Check under Windows to get the actual path.
staff-desktop    -fstype=smbfs,soft ://

(This file is not known to macOS, so it should generally survive system updates.)

Note: If you are already logged into the machine with the corresponding domain account, then the password shouldn’t be needed as you are already authenticated. The username is still necessary (i.e., … ://…). This means the file doesn’t need to be locked down as severely as it does if it contains passwords. Update: It might be necessary to manually mount all the shares first to ensure that credentials are cached or something. I had one share that stubbornly refused to mount until after I had manually mounted it first (and managed to reproduce the same effect with others later). It seemed to be happy once I had done that.

Reload configuration with sudo automount -vc.

See also for a more sophisticated version using a script.

Ensure that the mount point is not indexed by Time Machine. I suspect that this tickles the shares inside the folder, which seems to result in them being mounted over and over again until anything filesystem related grinds to a halt (the most I’ve seen is about 2300 mounts!). This appears to be a known problem under Catalina anyway; see for further discussion and a quick fix without having to reboot (TL;DR: disable the automount in auto_master, reload configuration, then umount repeatedly on anything remaining until it’s had enough ☺️).