![버전 4를 사용하여 RPi NFS 서버에 어떻게 연결할 수 있나요?](https://rvso.com/image/50570/%EB%B2%84%EC%A0%84%204%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20RPi%20NFS%20%EC%84%9C%EB%B2%84%EC%97%90%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%97%B0%EA%B2%B0%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%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
두 시도 모두에서 서버 로그가 변경되지 않았습니다. 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)
NB 이것은 원래 다음 위치에 게시되었습니다.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