Problem mounting NAS volume as afp from command line. Mac OS

I want to setup some automatic backup scripts so I was trying to make sure the drive gets mounted before running rsync. When I try something like “mount -t afp //user:pass@NAS/share /mnt/somewhere” I get:
mount_afp: AFPMountURL returned error 22, errno is 0

But when I try: “mount -t smbfs //user:pass@NAS/share /mnt/somewhere” it works fine!

I have AFP enabled and I can mount from finder using “afp://…”.
So any idea why the command line mount doesn’t work?

Perf tests indicate AFP is faster than SMB so I’d really prefer to always mount as AFP.
Cheers!

Hopefully an experienced User will be able to assist.

Hi there phbcanada,

I was searching for the same thing and ran across this to do the mount for me, however, I am getting two icons on my desktop to the Share.

mkdir /mnt/somewhere
mount_afp -k afp://user:pass@servername/share /mnt/somewhere

It works for me. Maybe you can help me get rid of the second icon on my desktop when the mount happens.

You can “man mount_afp” for details.

Hope this helps.
Daniel

Try running the mount command in a Terminal window and see what it shows you.