debian安裝nfs server

1.apt-get install nfs-kernel-server nfs-common

2.修改 /etc/exports

加入

/ 192.168.0.0/24(rw,async,no_root_squash,subtree_check)
^^^^^^^^^^^
這是你要許可開啟服務的 IP

3.
移除先前設定
exportfs -ua
重新載入exports設定
exportfs -a

4.執行
/etc/init.d/nfs-kernel-server restart

5.好像是出了些問題,系統說我沒有安裝statd
root@amd64:/etc# mount 192.168.0.10:/ /mnt
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use ‘-o nolock’ to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

所以要掛載得用
root@amd64:/etc# mount -o nolock 192.168.0.10:/ /mnt

但其他電腦連到server則無此問題。納悶中…

找到了,要執行
rpc.statd

就行了。

NFS FAQ中,有很多nfs問題的解決方法。

分類: 網路。這篇內容的永久連結

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *