From owner-freebsd-questions@freebsd.org Wed Jul 20 12:24:32 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDE1CB9D6C6 for ; Wed, 20 Jul 2016 12:24:32 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9D0618DE for ; Wed, 20 Jul 2016 12:24:32 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-96-167.dynamic.qsc.de [92.195.96.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 917E327725; Wed, 20 Jul 2016 14:24:23 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u6KCOM2q002636; Wed, 20 Jul 2016 14:24:22 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 20 Jul 2016 14:24:22 +0200 From: Polytropon To: twilight Cc: freebsd-questions@freebsd.org Subject: Re: Unable to mount with mount_smbfs while smbclient works fine Message-Id: <20160720142422.520d2d08.freebsd@edvax.de> In-Reply-To: <094cb9cb-79fc-ee1f-062d-a1153b5e7fc6@openmailbox.org> References: <094cb9cb-79fc-ee1f-062d-a1153b5e7fc6@openmailbox.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2016 12:24:33 -0000 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: [default] workgroup=YOUR_WORKGROUP_NAME [SERVERNAME] addr=192.168.2.2 [SERVERNAME:USERNAME] password=TOPSECRET where SERVERNAME and USERNAME correspond to the server's name and the username you use to access the share (with the proper password). 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@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@SERVERNAME/a$ /smb/a smbfs rw,noauto 0 0 //USERNAME@SERVERNAME/c$ /smb/c smbfs rw,noauto 0 0 //USERNAME@SERVERNAME/d$ /smb/d smbfs rw,noauto 0 0 //USERNAME@SERVERNAME/e$ /smb/e smbfs rw,noauto 0 0 //USERNAME@SERVERNAME/f$ /smb/f smbfs rw,noauto 0 0 The "generic" mount command will then work as mentioned above. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...