Mounting a samba share on boot?

Polytropon freebsd at
Tue Dec 11 16:57:59 UTC 2012

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

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 at 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 at WINPC/a$  /smb/a  smbfs  rw,late  0  0
	//Administrator at WINPC/c$  /smb/c  smbfs  rw,late  0  0
	//Administrator at WINPC/d$  /smb/d  smbfs  rw,late  0  0
	//Administrator at WINPC/e$  /smb/e  smbfs  rw,late  0  0
	//Administrator at 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:




organisational information and access credentials that apply.
See "man nsmb.conf" for details.

Further instructions can easily be found in the online docs:

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

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list