# automount smbfs fails on access



## bangmyhead (Jun 12, 2018)

Hello again, sorry but I have no other option that ask for help here. My FreeBSD was working fine with automount but now when I try to access a smbfs share it gives the next errors:


```
Jun 12 19:02:07 BSD111 automountd[1269]: "mount -t smbfs -o automounted //user@server61/text /mnt/text/", pid 1270, terminated with exit status 1
Jun 12 19:02:07 BSD111 automountd[1269]: mount failed
Jun 12 19:02:07 BSD111 kernel: WARNING: autofs_trigger_one: request for /mnt/text/ completed with error 5
```

It was working well, I mean I could access at first but do not know why it comes with this error now. I restarted also but keep saying the same.


----------



## ShelLuser (Jun 12, 2018)

So what happens if you try to mount it manually? Also: is the remote server still available?


----------



## bangmyhead (Jun 12, 2018)

ShelLuser said:


> So what happens if you try to mount it manually? Also: is the remote server still available?



Yes, its still available and manually works


----------



## ShelLuser (Jun 13, 2018)

I don't use automount myself but I just learned that it got updated today. You might want to consider an upgrade to rule out any possible software glitches.

Which brings me to an important question: you said it worked fine then stopped working. So... what changed in the mean time? Did you upgrade the FreeBSD server or... because these problems usually don't start on their own.


----------



## rigoletto@ (Jun 13, 2018)

If you need that share mounted all the time, it would be more reliable to have it set on /etc/fstab.


----------



## SirDice (Jun 13, 2018)

What version of FreeBSD?


----------



## bangmyhead (Jun 13, 2018)

ShelLuser said:


> I don't use automount myself but I just learned that it got updated today. You might want to consider an upgrade to rule out any possible software glitches.
> 
> Which brings me to an important question: you said it worked fine then stopped working. So... what changed in the mean time? Did you upgrade the FreeBSD server or... because these problems usually don't start on their own.



Nop, I just restarted the server to see if all was working fine after reboot since it's a fresh install. I use it for backups with rsync and other stuffs, that's for I need to have it working and after restart it didn't worked again on smbfs. I will take alook at the update


----------



## bangmyhead (Jun 13, 2018)

bangmyhead said:


> Nop, I just restarted the server to see if all was working fine after reboot since it's a fresh install. I use it for backups with rsync and other stuffs, that's for I need to have it working and after restart it didn't worked again on smbfs. I will take alook at the update





lebarondemerde said:


> If you need that share mounted all the time, it would be more reliable to have it set on /etc/fstab.



Hello, I can't use /etc/fstab since sometimes some others servers starts before mine when for example an electricity problem shows up, so in this way it hungs up at the start because the share is not ready.


----------



## bangmyhead (Jun 13, 2018)

SirDice said:


> What version of FreeBSD?


Hello, this version it's FreeBSD 11.0 Release-p1


----------



## SirDice (Jun 13, 2018)

FreeBSD 11.0 has been End-of-Life since November 2017 and is not supported any more. Please upgrade to a _supported_ version.

Topics about unsupported FreeBSD versions
https://www.freebsd.org/security/unsupported.html


----------



## bangmyhead (Jun 13, 2018)

SirDice said:


> FreeBSD 11.0 has been End-of-Life since November 2017 and is not supported any more. Please upgrade to a _supported_ version.
> 
> Topics about unsupported FreeBSD versions
> https://www.freebsd.org/security/unsupported.html


Ok. I will upgrade and let you all know if it works.


----------



## SirDice (Jun 13, 2018)

Just for information, where is the CIFS/SMB share hosted? Is it on a Windows machine? Keep in mind that mount_smbfs(8) only supports SMBv1 and Microsoft has disabled SMBv1 quite some time ago due to serious bugs and malware actively exploiting those bugs.


----------



## bangmyhead (Jun 13, 2018)

SirDice said:


> Just for information, where is the CIFS/SMB share hosted? Is it on a Windows machine? Keep in mind that mount_smbfs(8) only supports SMBv1 and Microsoft has disabled SMBv1 quite some time ago due to serious bugs and malware actively exploiting those bugs.



It is an old Linux RedHat


----------



## bangmyhead (Jun 13, 2018)

I just tried with FreeBSD 11.1 and the last `automount` version and not working, the logs drops this:


```
Jun 13 20:00:48 BSD111 automountd[1082]: "mount -t smbfs -o automounted //user@server/text /mnt/text/", pid 1083, terminated with exit status 1
Jun 13 20:00:48 BSD111 automountd[1082]: mount failed
Jun 13 20:00:48 BSD111 kernel: WARNING: autofs_trigger_one: request for /mnt/text/ completed with error 5
```


----------



## vermaden (Jun 14, 2018)

ShelLuser said:


> I don't use automount myself but I just learned that it got updated today. You might want to consider an upgrade to rule out any possible software glitches.
> 
> Which brings me to an important question: you said it worked fine then stopped working. So... what changed in the mean time? Did you upgrade the FreeBSD server or... because these problems usually don't start on their own.



You confused /usr/sbin/automount and /usr/sbin/automountd which are in FreeBSD base and 'my' automount from Ports which has nothing to do with the 'base' ones and is installed as /usr/local/sbin/automount file.

The thread creator has a problem with the FreeBSD base one, 'my' automount does not even mount NFS/SMBFS shares, only physical devices.


```
12:42 t420s vermaden ~ % which automount
/usr/sbin/automount

12:42 t420s vermaden ~ % which automountd
/usr/sbin/automountd

12:42 t420s vermaden ~ % pkg info -l automount | grep sbin   
/usr/local/sbin/automount
```


----------



## bangmyhead (Jun 14, 2018)

vermaden said:


> You confused /usr/sbin/automount and /usr/sbin/automountd which are in FreeBSD base and 'my' automount from Ports which has nothing to do with the 'base' ones and is installed as /usr/local/sbin/automount file.
> 
> The thread creator has a problem with the FreeBSD base one, 'my' automount does not even mount NFS/SMBFS shares, only physical devices.
> 
> ...


Oh. Ok, thanks a lot anyways


----------



## bangmyhead (Jun 14, 2018)

It finally worked, after shearching a lot I found this https://forums.freebsd.org/threads/mount-samba-share-automatically-on-boot.20523/

Inside of this it says you have to edit /etc/nsmb.conf and inside there you have to add

```
[SERVER:USER]
password=passxxx
```

It has to be uppercase just like that. Maybe also it could be added to the handbook for future questions. Thanks all for the time and the help.


----------

