NFS服務器端
apt-get install nfs-kernel-server nfs-common portmap
vi /etc/hosts.allow
portmap: 192.168.0.
lockd: 192.168.0.
rquotad: 192.168.0.
mountd: 192.168.0.
statd: 192.168.0.
vi /etc/hosts.deny
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
vi /etc/default/portmap
將 -i 127.0.0.1 注釋掉
/etc/init.d/portmap restart 重啟portmap daemon
vi /etc/exports
/home/zp/share 220.181.8.*(rw,sync,no_root_squash) 若更改了/etc/exports, 運行 $sudo exportfs -r 更新
/etc/init.d/nfs-kernel-server restart
(可以到/var/log/messages里面查看是否正確激活)
showmount -e ip 查看NFS server的export list.
NFS客戶端
apt-get install nfs-common portmap nfs-client
mount 192.168.86.111:/home/mnt/share /home/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
那么
mount 192.168.86.111:/home/mnt/share /home/mnt -o nolock 掛起
umount /home/mnt 撤銷