# mount_smbfs on fstab



## adripillo (Oct 4, 2013)

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:


```
[SERVER IP:USERNAME]
password=YOURPASSWORD
```

then edited /etc/fstab and added:


```
//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:


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

Any idea?


----------



## cpm@ (Oct 4, 2013)

Please, read carefully the instructions below (it's a mini-HOWTO) and be sure to follow all the steps listed:
http://blog.up-link.ro/freebsd-how-to-mount-smb-cifs-shares-under-freebsd/


----------



## adripillo (Oct 4, 2013)

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


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


----------



## cpm@ (Oct 4, 2013)

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:
> 
> ...



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


----------



## adripillo (Oct 4, 2013)

adripillo said:
			
		

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



Solved, added -N:


```
//USER@SERVER/SHARE /path/to/mount smbfs rw,-N,-Iip 0 0
```


----------

