Unable to mount with mount_smbfs while smbclient works fine
freebsd at edvax.de
Wed Jul 20 12:24:33 UTC 2016
On Wed, 20 Jul 2016 11:51:13 +0000, twilight wrote:
> I'm trying to mount a samba share (actually a D-link sharecenter) in my
> local network to my freebsd machine. But for some reason mount_smbfs
> does nothing, exiting with status 1. Dmesg is empty on errors releated
> to mount. PF firewall lets out packages to local network, so it must not
> be the case.
> I've read the man twice, the isn't anything covering the possible
> errors. I'm confused, what should I do?
Allow me to provide some information refactored from a post I wrote
5 years ago - I'm not fully sure it still applies today, but it did
work as intended. Even though I use mount + fstab, mount_smbfs is at
the center of this approach.
In order to use mount (mount_smbfs), provide the "login information"
as needed in /etc/nsmb.conf (replace uppercase placeholders), for example:
where SERVERNAME and USERNAME correspond to the server's name
and the username you use to access the share (with the proper
See "man nsmb.conf" for details.
You could use a hostname instead of an IP, for example by adding
an entry in /etc/hosts for the target.
Parts of the above information should then be reflected in /etc/fstab,
maybe like this:
//USERNAME at SERVERNAME/share /smb/share smbfs rw,noauto 0 0
This should allow you to use
# mount /smb/share
a bit easier (and automatically, if desired).
If the target exposes more than one share via "drive letters", you
can use a similar approach in /etc/fstab:
//USERNAME at SERVERNAME/a$ /smb/a smbfs rw,noauto 0 0
//USERNAME at SERVERNAME/c$ /smb/c smbfs rw,noauto 0 0
//USERNAME at SERVERNAME/d$ /smb/d smbfs rw,noauto 0 0
//USERNAME at SERVERNAME/e$ /smb/e smbfs rw,noauto 0 0
//USERNAME at SERVERNAME/f$ /smb/f smbfs rw,noauto 0 0
The "generic" mount command will then work as mentioned above.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions