バージョン4を使用してRPi NFSサーバーに接続するにはどうすればよいですか?

バージョン4を使用してRPi NFSサーバーに接続するにはどうすればよいですか?

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サーバーログは試行間で変更されませんでした。 v4 の試行に失敗するとサーバーログは/var/log/syslog変更されませんが、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

ベストアンサー1

おすすめ記事