nfs安装与配置(debian)

nfs安装与配置(debian)


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 撤销

你可能感兴趣的:(nfs安装与配置(debian))