1

Until "recently", when I mounted a SMB share from the command-line using either open ... or Applescript with osascript -e "mount volume ...", it would mount the share at /Volumes/ShareName.

The current "AppleScript Language Guide" documentation for "mount volume" does not specify how the folder under /Volumes will be named. I had read that it would use the share name, and that is what it used to do.

But now, at least with MacOS 10.14.6, 10.15.7 and 11.5.2, the folder created under /Volumes uses the server name instead.

On all machines, I tried both

open "smb://$user:$pass@elefant/R"

and

osascript -e "mount volume \"smb://$user:$pass@elefant/R/\""

On all 3 machines, the output of the osascript command is

file:R

The shortcut created on Desktop is labelled with the share name as before ("R" in this case). But that is not the name of the mount point, and I get:

$ ls -1 /Volumes/
Macintosh HD
elefant

Only on a 10.13.6 machine does it not happen, and the share is mounted using the share name at /Volumes/R.

Is this documented somewhere?

And most importantly, can this be reverted to the old behaviour of using the share name?

2
  • If I run mount volume "smb://ServerName/ShareName" in Script Editor or osascript -e 'mount volume "smb://ServerName/ShareName"' from Terminal , it mounts as /Volumes/ShareName not /Volumes/ServerName and I cannot reproduce your issue. When's the last time you rebooted? Commented Sep 7, 2021 at 15:56
  • @user3439894 : yes, I did reboot now amd still have this problem. See also the updated question.
    – mivk
    Commented Sep 7, 2021 at 18:29

1 Answer 1

1

It turns out this happens when the share name is only 1 character. If the share name is longer than a single letter, it mounts as usual under /Volumes/ShareName.

But in the example in my question, the share name was just the letter "R" (which is the drive letter on that Windows machine).

Renaming the share on the server to "R_" instead fixes the problem and

open "smb://$user:$pass@$server/R_"

now mounts the share in /Volumes/R_ as expected.

(I have not found if this is documented somewhere, but it seems to have started with MacOS 10.14)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .