Topic : mount_smbfs: mount error: /Volumes/test: File exists

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?

mbp 2.2, Mac OS X (10.5.6)

Posted on May 25, 2009 6:36 PM

Reply
4 replies

May 26, 2009 10:49 PM in response to miguelastico

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.

May 27, 2009 6:56 AM in response to D7

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:password@10.0.1.3/movies ./dir/
402 mount -t smbfs //miguel:password@10.0.1.3/movies/ ./dir/
403 mount -t smbfs //miguel:password@10.0.1.3/movies/ ./dir

and mount_smbfs

421 mount_smbfs //miguel:password@10.0.1.3/movies ./dir/
422 mount_smbfs //miguel:password@10.0.1.3/movies/ ./dir/
423 mount_smbfs //miguel:password@10.0.1.3/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)

May 28, 2009 8:13 AM in response to miguelastico

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\"`

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Topic : mount_smbfs: mount error: /Volumes/test: File exists

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