You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Prevent SMB Share to automount in Big Sur

Hi,

I am currently using an external program to mount my NAS over NFS in a custom folder, and it's all working great.

However, often my iMac M1 will automount the same NAS over SMB under /Volumes, and this creates some problems:

  • I believe that indexing starts, as I hear the NAS disk work like crazy for an hour or so, and if I unmount the NAS from the Finder, NAS activity stops. In any case, after some hour, the disk gets mounted again and I know that from the sound of my disks
  • Some programs like Word have problems in saving the file to the right path, since there is both an NFS and a SMB connection (Word complains about file write problems and if I unmount the NAS from Finder, leaving just the NFS connection, it will all work well)


While I could tell the Mac not to index the NAS, still I don't want to have twice the same connection with the NAS and moreover, I don't need SMB access - I prefer NFS one.


I have tried to avoid this automount to start, without any luck. I searched in /etc and in my hidden files in my profile to see if I could find something interesting, but I couldn't find anything.


The list of the mounted disks is here below:


Lucas-iMac:Downloads luca$ mount
/dev/disk3s1s1 on / (apfs, sealed, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk3s6 on /System/Volumes/VM (apfs, local, noexec, journaled, noatime, nobrowse)
/dev/disk3s2 on /System/Volumes/Preboot (apfs, local, journaled, nobrowse)
/dev/disk3s4 on /System/Volumes/Update (apfs, local, journaled, nobrowse)
/dev/disk1s2 on /System/Volumes/xarts (apfs, local, noexec, journaled, noatime, nobrowse)
/dev/disk1s1 on /System/Volumes/iSCPreboot (apfs, local, journaled, nobrowse)
/dev/disk1s3 on /System/Volumes/Hardware (apfs, local, journaled, nobrowse)
/dev/disk3s5 on /System/Volumes/Data (apfs, local, journaled, nobrowse, protect)
map auto_home on /System/Volumes/Data/home (autofs, automounted, nobrowse)
192.168.1.120:/FILM on /Users/luca/mount/FILM (192.168.1.120) (nfs, nodev, nosuid, mounted by luca)
/dev/disk3s1 on /System/Volumes/Update/mnt1 (apfs, sealed, local, journaled, nobrowse)
192.168.1.120:/iMac on /Users/luca/mount/iMac (192.168.1.120) (nfs, nodev, nosuid, mounted by luca)
//DRIVE@localhost:49821/Google%20Drive on /Volumes/GoogleDrive (smbfs, nodev, nosuid, nobrowse, mounted by luca)
//xxxx@192.168.1.120/iMac on /Volumes/iMac (smbfs, nodev, nosuid, mounted by luca)


As you see, /Users/luca/mount contains my NFS folders (the ones I mount with the script) while the last line contains the automounted SMB volume.


I read about a post where I should edit the fstab file adding the UUID of my Disk, but when I tried to get this information, nothing good is retrieved, even if the disk is mounted indeed:


Lucas-iMac:~ luca$ diskutil info /Volumes/iMac/
Could not find disk: /Volumes/iMac/



The auto_home doesn't seem to contain anything interesting:


Lucas-iMac:etc luca$ cat /etc/auto_home 
#
# Automounter map for /home
#
+auto_home	# Use directory service
#
# Get /home records synthesized from user records
#
+/usr/libexec/od_user_homes


Lucas-iMac:etc luca$ cat auto_master
#
# Automounter master map
#
+auto_master		# Use directory service
#/net			-hosts		-nobrowse,hidefromfinder,nosuid
/home			auto_home	-nobrowse,hidefromfinder
/Network/Servers	-fstab
/-			-static


Any help to avoid automounting the SMB share would be appreciated.

Thanks

Luca


iMac 24″, macOS 11.6

Posted on Feb 6, 2022 5:09 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 6, 2022 10:14 AM

Thanks for your comments, I will give it a try. I cannot disable SMB forever on the NAS because SMB is used by my iPhone and iPad when connecting, and also by Windows10, but of course this could help me.

Thanks also for the explanation about the diskutil manager.

I will post here what I find.

Meanwhile, with LittleSnitch, I have created a rule to block any TCP 445 and 139 access to my NAS, and actually so far so good, but of course this is the hard way!

BTW, the software I am using is ConnectMeNow.

Luca

Similar questions

6 replies
Question marked as Top-ranking reply

Feb 6, 2022 10:14 AM in response to Barney-15E

Thanks for your comments, I will give it a try. I cannot disable SMB forever on the NAS because SMB is used by my iPhone and iPad when connecting, and also by Windows10, but of course this could help me.

Thanks also for the explanation about the diskutil manager.

I will post here what I find.

Meanwhile, with LittleSnitch, I have created a rule to block any TCP 445 and 139 access to my NAS, and actually so far so good, but of course this is the hard way!

BTW, the software I am using is ConnectMeNow.

Luca

Feb 6, 2022 10:10 AM in response to etresoft

I understand you believe I am totally crazy to run such an old FS like NFS, although I don't think it's such an old FS...

There are many reasons behind this decisions:


  • I need some nested access control mechanisms which are easier to achieve with NFS and users (id and gid)
  • I have 4 accounts on my Mac (me, my wife, my two kids) and I just mount the NFS share once and they all have permission to read and write only to some folders; with SMB, I would need to create 4 accounts and mount the same NAS 4 times (actually, 8 because I have two shares)


Luca

Feb 6, 2022 7:08 AM in response to ciclista71

A network share should not mount on its own. Do you have anything set up to mount that share?

Maybe the NAS software auto mounts it for you?

Any aliases created to that share that open from Login Items?

Can you disable SMB and AFP from the NAS such that anything that is trying to mount would fail? Maybe the failure message might give a hint as to what is mounting the share.


diskutil manages devices, not network shares. While a network share gets mounted to /Volumes much like a drive, it is not a device.


I have several network shares (none from a NAS) that I can connect when I want, but none are auto mounted.

I don't know if the NFS mount causes some interaction that also mounts the SMB share.

Feb 6, 2022 8:31 AM in response to ciclista71

I think Barney-15E is on the right track. There is absolutely nothing in macOS that is going to "automount" some randomly accessible network share. That would be complete and utter chaos.


Furthermore, macOS actually does have an automount system. You seem to have found it on your own. Unfortunately, it is extremely difficult to use. The idea that it would spontaneously spin up and actually work on its own beggars belief.


The explanation is most likely a bug in whatever you are using to mount the network share in the first place.


You could trying using the automount system to properly mount the share using NFS, but that is extraordinarily difficult. I'm actually pretty impressed that your software is able to do it at all. NFS is an old, decrepit relic of another era. Sometimes here in the forums we will seem some old UNIX admin who has been living in a shed by themselves up in north Quebec for the past 34 years who for some reason decided to upgrade macOS and how their NFS mounts don't work anymore. Eventually they just downgrade, or switch to Linux, then hitch the sled dogs back up and away they go.


In your case, I would recommend just switching to SMB. Uninstall that automount software. Maybe put an alias to the server on your desktop and be done with it. 5 minutes - tops. If you are really a masochist, you could search the dark web for an illegal copy of Apple's old, but excellent technical white paper titled, "Autofs: Automatically Mounting Network File Shares in Mac OS X". That might be a good COVID quarantine projects - assuming long-covid, of course.

Prevent SMB Share to automount in Big Sur

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.