![バージョン 4 を使用して RPi NFS サーバーに接続するにはどうすればよいですか?](https://rvso.com/image/50570/%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%204%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%20RPi%20NFS%20%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E3%81%AB%E6%8E%A5%E7%B6%9A%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
Raspberry Pi を NFS サーバーとして設定しましたが、NFS バージョン 4 では接続できません。ただし、バージョン 3 では動作します。Kubuntu 13.04 クライアントから:
$ sudo mount -t nfs -o proto=tcp,port=2049,vers=4 192.168.1.91:/export /mnt/pi -v
mount.nfs: timeout set for Tue Sep 17 09:47:26 2013
mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=4,addr=192.168.1.91,clientaddr=192.168.1.7'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.1.91:/export
$ sudo mount -t nfs -o proto=tcp,port=2049,vers=3 192.168.1.91:/export /mnt/pi -v
mount.nfs: timeout set for Tue Sep 17 09:47:31 2013
mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=3,addr=192.168.1.91'
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 192.168.1.91 prog 100005 vers 3 prot TCP port 35976
サーバーから見ると、NFS バージョン 4 がカーネルにコンパイルされているようです。
$ rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 51953 status
100024 1 tcp 42383 status
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 2 tcp 2049
100227 3 tcp 2049
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100227 2 udp 2049
100227 3 udp 2049
100021 1 udp 41873 nlockmgr
100021 3 udp 41873 nlockmgr
100021 4 udp 41873 nlockmgr
100021 1 tcp 35095 nlockmgr
100021 3 tcp 35095 nlockmgr
100021 4 tcp 35095 nlockmgr
100005 1 udp 60943 mountd
100005 1 tcp 44936 mountd
100005 2 udp 52342 mountd
100005 2 tcp 56312 mountd
100005 3 udp 57888 mountd
100005 3 tcp 35976 mountd
両方の試行で、 のサーバー ログ/var/log/messages
は変更されません。 のサーバー ログは、/var/log/syslog
失敗した v4 の試行では変更されませんが、成功した v3 の試行では次のように追加されます。
Sep 17 21:48:27 raspberrypi rpc.mountd[24098]: authenticated mount request from 192.168.1.7:1021 for /export (/export)
Sep 17 22:09:12 raspberrypi rpc.mountd[24098]: authenticated mount request from 192.168.1.7:790 for /export (/export)
Sep 17 22:09:51 raspberrypi rpc.mountd[24098]: authenticated mount request from 192.168.1.7:1002 for /export (/export)
奇妙なことに、2049 を指定したにもかかわらず、ポートが変更されているようです。
サーバーの内容/etc/export
/export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async,crossmnt)
注: これは元々Raspberry Pi Stackexchange サイト2 週間前に投稿しましたが、まともな反応がなかったので、ここで試しています。ここで良い反応が得られたら、他のものを削除します。
==編集==
/etc/default/nfs-common
サーバー上のコンテンツ:
# If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are "yes" and "no".
# Do you want to start the statd daemon? It is not needed for NFSv4.
NEED_STATD=
# Options for rpc.statd.
# Should rpc.statd listen on a specific port? This is especially useful
# when you have a port-based firewall. To use a fixed port, set this
# this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
# For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
STATDOPTS=
# Do you want to start the idmapd daemon? It is only needed for NFSv4.
NEED_IDMAPD=yes
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=no