July 2020
Since I upgraded to macOS Catalina, mounting SMB drive from my Synology NAS in the Finder many times gives me an error like this:
"The operation can’t be completed because the original item for SHARE_NAME"
This happens when you leave your Mac up and running for a while, going to sleep, waking it up. Apple did a great job at keeping the OS very stable even with a long period of time without rebooting. Except this file share over SMB that drives people nuts.
I have read many recommendation that didn't work for me:
- Set the IPv6 config to local-link only
- Change permission on /Volumes
- Force the NAS to use SMBv2 at minimum
The only thing that worked was:
- Restart the Finder ( → Force Quit... → Finder)
- Alternatively, rebooting the machine always worked
Some folks took a more drastic approach enabling AFP protocol, the very same Apple started deprecating in the fall of 2013 with 10.9 / Maverick
Since I need this fileshare more or less all the time, I decided to give a shot to autofs.
autofs ships with all macOS, it doesn't require any script to run to mount the shared folder or create the mount folder, it takes care of everything for you.
Follow the 3 steps below and you should be able to continue enjoying your NAS.
To edit/create file, you can use Terminal with text editor like vi or nano.
These file being system files, prefix your commands with sudo.
% sudo vi /etc/auto_master
Add one line at the end:
/- auto_smb -nosuid,noowners
% sudo vi /etc/auto_smb
Add this line (or multiple if you have multiple file shares):
/System/Volumes/Data/SHARENAME -fstype=smbfs,soft ://user:password@NAS-IP-HOSTNAME:/SHARENAME
And since we want to make sure your password stays secret, change the permmission on the file to keep it system only:
% sudo chmod 600 /etc/auto_smb
You need this command only to test your settings are working fine, and anytime you change the 2 files above.
$ sudo automount -vc
You should see you NAS share mounted, type mount
to confirm, on my system it looks like this:
% mount
/dev/disk1s5 on / (apfs, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk1s1 on /System/Volumes/Data (apfs, local, journaled, nobrowse)
/dev/disk1s4 on /private/var/vm (apfs, local, journaled, nobrowse)
map auto_home on /System/Volumes/Data/home (autofs, automounted, nobrowse)
map auto_smb on /System/Volumes/Data/videos (autofs, nosuid, automounted, noowners, nobrowse)
//USER@NAS-IP-HOSTNAME/SHARENAME on /System/Volumes/Data/SHARENAME (smbfs, nodev, nosuid, automounted, nobrowse, mounted by USER)
When you boot your machine, autofs will automatically mount the volume, it usually takes a few seconds.
- Apple technical white paper: Autofs: Automatically Mounting Network File Shares in Mac OS X
- Apple Community: NAS Access in Catalina issues