mount_smbfs on fstab

adripillo

Well-Known Member

Reaction score: 1
Messages: 410

I am trying to "auto mount" a network drive on my system. From console it works, doing mount_smbfs -I SERVER //name@SERVER/textos /mnt/textos/. Now, I created a ~/.nsmbrc file:

Code:
[SERVER IP:USERNAME]
password=YOURPASSWORD


then edited /etc/fstab and added:

Code:
//username@SERVER IP/stronage  /mnt/storage     smbfs  rw,noauto 0   0


Then to test, I type # mount /mnt/storage. After some seconds of delay it says:

Code:
mount_smbfs: can't get server address: syserr = Operation timed out


Any idea?
 
OP
A

adripillo

Well-Known Member

Reaction score: 1
Messages: 410

This worked but when I reboot the computer it asks me for the password.

Code:
//USER@SERVER/SHARE /path/to/mount smbfs rw,-Iip 0 0
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 948
Messages: 2,140

As quoted per the mini-HOWTO, you can read at the bottom:
The -N option forces to read a password from ~/.nsmbrc file. At run time, mount_smbfs reads the ~/.nsmbrc file for additional configuration parameters and a password. If no password is found, mount_smbfs prompts for it. You need to use the -N option while writing a shell script.

mount_smbfs does not make the mount permanent. If the FreeBSD system is rebooted, you will have to mount the share again. To make the mount occur each time you start the FreeBSD system, you can put an entry in your /etc/fstab file. An example file would look like this:

//myUser@serverName/mySharedFolder /mnt/mySharedFolder smbfs rw,-N,-I192.168.1.1 0 0

Next, you have to add the username and password to /etc/nsmb.conf:

[SERVERNAME]
password=myPassword

Have you missed something of the above? Use the -N option.
 
OP
A

adripillo

Well-Known Member

Reaction score: 1
Messages: 410

adripillo said:
This worked but when I reboot the computer it asks me for the password.

Code:
//USER@SERVER/SHARE /path/to/mount smbfs rw,-Iip 0 0

Solved, added -N:

Code:
//USER@SERVER/SHARE /path/to/mount smbfs rw,-N,-Iip 0 0
 
Top