From owner-freebsd-questions@FreeBSD.ORG Tue Dec 11 16:57:59 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A3648D0 for ; Tue, 11 Dec 2012 16:57:59 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id C81E28FC18 for ; Tue, 11 Dec 2012 16:57:58 +0000 (UTC) Received: from r56.edvax.de (port-92-195-51-39.dynamic.qsc.de [92.195.51.39]) by mx01.qsc.de (Postfix) with ESMTP id 3F5B83CA35; Tue, 11 Dec 2012 17:57:56 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id qBBGvx0m003941; Tue, 11 Dec 2012 17:57:59 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 11 Dec 2012 17:57:59 +0100 From: Polytropon To: Hanafi Syahroini Subject: Re: Mounting a samba share on boot? Message-Id: <20121211175759.310ec79f.freebsd@edvax.de> In-Reply-To: References: 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 Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 16:57:59 -0000 On Tue, 11 Dec 2012 23:25:56 +0700, Hanafi Syahroini wrote: > [nothing] First of all, it's not uncommon to place the question into the message body (which you did not), and using a descriptive subject (which you did). :-) So I assume your question is _how_ to mount a SMB share at boot. This can be easily done by adding the required line to the /etc/fstab file. Because network connection is required to perform the mount, you could use the "late" option in addition to other options you might need. See "man mount" for detais, as well as /etc/rc.d/mountlate. The line would be like this: //USERNAME@SERVERNAME/share /smb/share smbfs rw,late 0 0 In this example, SERVERNAME is the server to access, and "share" the name of the share; /smb/share will be the directory it will be mounted at. Access to multiple "drive letters" would look like this: //Administrator@WINPC/a$ /smb/a smbfs rw,late 0 0 //Administrator@WINPC/c$ /smb/c smbfs rw,late 0 0 //Administrator@WINPC/d$ /smb/d smbfs rw,late 0 0 //Administrator@WINPC/e$ /smb/e smbfs rw,late 0 0 //Administrator@WINPC/f$ /smb/f smbfs rw,late 0 0 Here "WINPC" is the name of the server. Using "Administrator" in this case is not safe, but no problem in settings where people don't care for security anyway. :-) Also see "man smbfs" and "man fstab" for details. It might be required to put additional information in /etc/nsmb.conf, for example: [default] workgroup=YOUR_WORKGROUP_NAME [SERVERNAME] addr=192.168.2.2 [SERVERNAME:USERNAME] password=TOPSECRET Substitute SERVERNAME, USERNAME and TOPSECRET for the organisational information and access credentials that apply. See "man nsmb.conf" for details. Further instructions can easily be found in the online docs: http://www.freebsd.org/doc/faq/book.html#mount-smb-share http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-samba.html Note that if you still encounter network problems, it's better to write a short rc.d style script that performs the mount_smb commands, and use the proper keywords to have it run when the network connection is up and running. See "man rc.d" for details. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...