Benches macOS

4

Topic : mount_smbfs: mount error: /Volume…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi all,

I am trying to write a script that mounts several samba drives and moves files around.

Now, the command

mount_smbfs //whatever@adrive/share /Volumes/test

works perfectly, asking me for a password; however, if I put the password as specified in the man page for both mount and mount_smbfs, it says that the test directory exists, no matter if this is true or not.

I tried to create it, to remove it, but nothing changes.

What am I doing wrong?

4 replies

Sign in or join Beachball Help to reply.

  1. 0

    D7

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I have no SMB shares to try with, but have you tried using any of the mount command examples at the end of the man page for mount_smbfs? mount_smbfs calls the mount command to do its job. Using mount may help isolate your issue.

    In all cases, though, you should use mkdir to create the mount point prior to calling mount/mount_smbfs. Your text didn't make it clear you were always doing so.

  2. 0

    miguelastico

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi; thanks for the reply

    Yes, I tried all the examples on the man page, and I tried either creating the directory, either not creating it.

    this are the attempts (just the "/" changes) with mount

    401 mount -t smbfs //miguel:[email protected]/movies ./dir/

    402 mount -t smbfs //miguel:[email protected]/movies/ ./dir/

    403 mount -t smbfs //miguel:[email protected]/movies/ ./dir

    and mount_smbfs

    421 mount_smbfs //miguel:[email protected]/movies ./dir/

    422 mount_smbfs //miguel:[email protected]/movies/ ./dir/

    423 mount_smbfs //miguel:[email protected]/movies/ ./dir

    I tried to do something like

    mount -t smbfs miguel:password@//10.0.1.3/movies ./dir

    but nothing

    still, without password I can access (and then I am asked to put it, making this not suitable for a script)

  3. 0

    D7

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Are the examples you're showing the exact statements you are executing, or are you using environment variables to populate or any else that might permute the statements?

    If by chance you are executing these in a script with environment variables it might be helpful to copy the execution line and echo it to the terminal to verify it is resulting in exactly what you expect.

    Also, I noticed that mount_afp has the same syntax as mount_smbfs except that mount_afp includes 'afp:' before the two slashes. Might be worth a try to add 'smb:' or 'smbfs:'. The statement I use to mount my AFP shares is:

    mount_afp afp://username:password@host/share /Volumes/share

    Also, a handy way to get the password without hardcoding in your script is to use the 'security' command similar to the following:

    set USER=`id -un`

    setenv PASSWORD `security find-generic-password -g -a $USER |& grep password | cut -f2 -d"`

  4. 0

    D7

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Please disregard my suggestion about adding 'smb:' or 'smbfs:'. It will not work.