# autofs problem



## zkab (Nov 26, 2015)

Hi,

I am new to this forum.
Right now I run Linux (desktops & servers) and I was curious about BSD so I installed PC-BSD 10.2 on a spare computer (192.168.0.38).
I tried to set up autofs(5) for my Linux servers NFS shares on the PC-BSD computer but something went wrong ...
Appreciate help.

Here is the error message:

```
sudo /etc/rc.d/automount start
/etc/rc.d/automount: WARNING: $autofs_enable is not set properly - see rc.conf(5).
Will not 'start' automount because autofs_enable is NO.
```
Here is what I did:

```
cat auto_master 
# $FreeBSD$
#
# Automounter master map, see auto_master(5) for details.
#
/net -hosts -nobrowse,nosuid,intr
# When using the -media special map, make sure to edit devd.conf(5)
# to move the call to "automount -c" out of the comments section.
#/media -media -nosuid
#/- -noauto

#NFS
/nfs /etc/auto_nfs
----------------------
cat auto_nfs 
# $FreeBSD$
#
# Automounter master map, see auto_master(5) for details.
#
/net -hosts -nobrowse,nosuid,intr
# When using the -media special map, make sure to edit devd.conf(5)
# to move the call to "automount -c" out of the comments section.
#/media -media -nosuid
#/- -noauto

#NFS
FARBAUTE -intr,nfsv4 192.168.0.32:/home/jurka/my_data
---------------------
sudo showmount -e 192.168.0.32
Password:
Exports list on 192.168.0.32:
/home/jurka/my_data 192.168.0.4 192.168.0.37 192.168.0.38 
--------------------
cat rc.conf
# Auto-Enabled NICs from pc-sysinstall
ifconfig_alc0="DHCP"
# Auto-Enabled NICs from pc-sysinstall
ifconfig_alc0_ipv6="inet6 accept_rtadv"
hostname="pcbsd"
pcsysconfig_enable="YES"
zfs_enable="YES"
sshd_enable="YES"

#AUTOFS
autofs_enable=”YES”

#NFS CLIENT
nfs_client_enable="YES"
```


----------



## SirDice (Nov 26, 2015)

Please read Thread pc-bsd-freenas-nas4free-and-all-other-freebsd-derivatives.7290/.


----------



## zkab (Nov 26, 2015)

I have posted the problem to PC-BSD forum but have not got any answers yet ... maybe my problem is too simple


----------



## wblock@ (Nov 26, 2015)

zkab said:


> ```
> Will not 'start' automount because autofs_enable is NO.
> ```


That seems fairly explanatory.  Add in /etc/rc.conf:

```
autofs_enable="YES"
```


----------



## tobik@ (Nov 26, 2015)

zkab said:


> autofs_enable=”YES”


These are not the correct quotes! Be careful when copy/pasting text from the internet.

wblock@'s snippet is safe to copy. Or you could also run `sysrc autofs_enable=YES` to set autofs_enable to the correct value in /etc/rc.conf.


----------



## zkab (Nov 26, 2015)

OK - I ran `sysrc` (both with autofs_enable and nfs_client_enable) and now they are enabled.

```
[raivox@pcbsd] /usr/local/etc% sysrc -a | grep -i 'nfs\|auto'
autofs_enable: YES
nfs_client_enable: YES
```
The command `sudo /etc/rc.d/automount start` did not give any error message now and `mount` gives me map /etc/auto_nfs on /nfs (autofs) which seems OK.
Also `showmount` tells me that right shares are exported from my Linux server ... so far so good ... BUT /nfs - which is my mount point - is empty ... hmmm ... don't understand this.


----------



## tobik@ (Nov 26, 2015)

IIRC you should be able to e.g. run `ls /nfs/192.168.0.32/home/jurka/my_data` at which point your share will be mounted.

From autofs(5):


> Directories for individual NFS servers are not present until the first access, when they are automatically created.



EDIT: Ignore me that is the default for /net not for your setup.


----------



## zkab (Nov 26, 2015)

`ls /nfs/192.168.0.32/home/jurka/my_data` gives Input/output error ...

I think there are some problems with autofs in pc-bsdPC-BSD... I tried the conventional method with `mount -v 192.168.0.32:/home/jurka/my_data  /nfs` and now the shares were mounted correctly.


----------



## junovitch@ (Nov 27, 2015)

zkab said:


> Hi,
> 
> ```
> ...
> ...



I'm unsure what FARBAUTE is from but auto_master(5) has examples on what should be in these files.  Please double check the syntax with the man page.


----------



## trasz@ (Feb 23, 2016)

There are three pieces of code that need to be started.  /etc/rc.d/automount is one, but there are also /etc/rc.d/automountd, and /etc/rc.d/autounmountd.  The autofs_enable controls all three, but if you don't start those at boot and instead run it by hand, you need all three.


----------



## zkab (Feb 23, 2016)

OK


----------

