OpenBSD configuration: Client unable to mount via NFS using Berkeley Automounter (amd)

Posted by Rilindo on Server Fault See other posts from Server Fault or by Rilindo
Published on 2011-11-26T21:52:46Z Indexed on 2011/11/30 17:58 UTC
Read the original article Hit count: 505

Filed under:
|
|
|

What I am trying to do is to have my openBSD client (OpenBSD 4.9) auto mount a Linux NFS file system (Scientific Linux 6.1). So far, I am not sure if it is configured correctly.

To get things out of the way, I am able to mount nfs manually:

# mount_nfs -T -3 192.168.15.100:/exports /mnt
# ls -la /mnt
total 52
drwxr-xr-x   7 root    wheel   4096 Oct  4 22:42 .
drwxr-xr-x  16 root    wheel    512 Nov 26 16:33 ..
drwxrwxr-x   5 _sndio  _sndio  4096 Oct 31 21:58 centos
drwxr-xr-x  15 root    wheel   4096 Nov  6 09:17 home
drwxr-xr-x   5 root    wheel   4096 Oct 31 21:27 sl
drwxr-xr-x   3 root    wheel   4096 Nov 19 16:02 sles
drwxr-xr-x  17 503     503     4096 Nov 10 17:37 users
# 

So connectivity is not an issue, as far as I can tell.

As per man page, the following is configured in /etc/amd/auto.home:

/defaults type:=nfs;sublink:=${key};opts:=rw,soft,intr,vers=3,proto=tcp
*         rhost:=192.168.15.100;rfs:=/exports

In turn, /etc/amd/master is configured as such:

# cat /etc/amd/master                                                                                                                                                                    
/exports amd.home

Upon reboot, I can it see mount, but curiously enough, instead of the hostname:

amd:24490                        0         0         0   100%    /exports

From what I understand, amd acts a little different from FreeBSD. Still, I tried to see if I it can automount.

Nope:

ksh: cd: /exports/users - Resource temporarily unavailable
# cd /exports/192.168.15.100/host/users
ksh: cd: /exports/192.168.15.100/host/users - Resource temporarily unavailable

A search in google doesn't help too much - it seems that automounting NFS with OpenBSD is not something that is usually done. Other than this, information is fairly sparse.

I can, of course, always mount is permanently, but I tend to be a bit anal on convention, so no for now. :)

Some direction would be appreciation.

(And oh, in case you are a wondering, I tried FreeBSD way of using amd and that hasn't worked out - although I wouldn't mind an explanation of the difference between how FreeBSD implements and how OpenBSD implements it)

UPDATE: After re-writing the map file several times, I got as far as actually communicating with the NFS server with this configuration:

/defaults type:=nfs;rhost:=kerberos.monzell.com;rfs:=/exports;\
          sublink:=${key};opts:=rw,nodev,nosuid,soft,intr,tcp,resvport
*         ${host}==${rhost};type:=nfs;fs:=${rfs};opts:=rw,nodev,nosuid,soft,intr,tcp,resvport

However, for some reason, it seems that amd will only default to NFS version 2 over udp:

# tcpdump dst kerberos
tcpdump: listening on pcn0, link-type EN10MB
tcpdump: WARNING: compensating for unaligned libpcap packets
20:38:28.558385 openbsd.monzell.com.856 > kerberos.monzell.com.sunrpc: udp 100
20:38:28.559154 openbsd.monzell.com.856 > kerberos.monzell.com.892: udp 96
20:38:30.592761 openbsd.monzell.com.856 > kerberos.monzell.com.nfsd: xid 0x22000000 (NFSv2) 40 null
20:38:33.558107 arp reply openbsd.monzell.com is-at 52:54:00:52:8f:66

I tried various options of forcing it to try to mount as nfsv3 such as:

/defaults type:=nfs;rhost:=kerberos.monzell.com;rfs:=/exports;\
          sublink:=${key};opts:=rw,nodev,nosuid,soft,intr,vers=3,proto=tcp,resvport
*         ${host}==${rhost};type:=nfs;fs:=${rfs};opts:=rw,nodev,nosuid,soft,intr,vers=3,proto=tcp,resvport

or:

/defaults type:=nfs;rhost:=kerberos.monzell.com;rfs:=/exports;\
          sublink:=${key};opts:=rw,nodev,nosuid,soft,intr,vers=-3,proto=tcp,resvport
*         ${host}==${rhost};type:=nfs;fs:=${rfs};opts:=rw,nodev,nosuid,soft,intr,vers=3,proto=tcp,resvport

Nothing yet still.

Curious enough, OpenBSD mounts defaults to version 3, so I am not sure why it would start with version in amd. What would be the correct options to pass?

© Server Fault or respective owner

Related posts about nfs

Related posts about openbsd