server : 192.168.0.1:/data/nfs.server
client : 192.168.0.2:/data/nfs.client
##############
#
# server: 192.168.0.1:/data/nfs.server
#
###############
# aptitude -y install nfs-kernel-server
# vim /etc/exports
/data/nfs.server 192.168.0.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)
或者,只针对一个IP的开放mount
/data/nfs.server 192.168.0.1(rw,sync,no_root_squash,no_subtree_check)
# /etc/init.d/nfs-kernel-server start
# /etc/init.d/nfs-kernel-server status # 查看其否启动
nfsd running
# netstat -tunlp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:35389 0.0.0.0:* LISTEN 27436/rpc.mountd
udp 0 0 0.0.0.0:57471 0.0.0.0:* 27436/rpc.mountd
# showmount -e 192.168.0.1
Export list for 192.168.0.1:
/data/nfs.server 192.168.0.0/255.255.255.0
##############
#
# client : 192.168.0.2:/data/nfs.client
#
###############
# aptitude -y install nfs-common
# /etc/init.d/nfs-common
# /etc/init.d/nfs-common status # 查看是否启动
all daemons running
# netstat -tunlp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:40973 0.0.0.0:* LISTEN 21818/rpc.statd
udp 0 0 0.0.0.0:794 0.0.0.0:* 21818/rpc.statd
udp 0 0 0.0.0.0:47347 0.0.0.0:* 21818/rpc.statd
# showmount -e 192.168.0.1
Export list for 192.168.0.1:
/data/nfs.server 192.168.0.0/255.255.255.0
# mount -t nfs 192.168.0.1:/data/nfs.server /data/nfs.client
# df -h
192.168.14.222:/data/nfs.server
462M 11M 428M 3% /data/nfs.client
阅读(1011) | 评论(0) | 转发(0) |