NFS 就是 Network FileSystem 的缩写,最早之前是由 Sun 这家公司所发展出来的 。 它最大的功能就是可以透过网络,让不同的机器、不同的操作系统、可以彼此分享个别的档案 (share files)。所以,你也可以简单的将他看做是一个文件服务器 (file server) 呢!这个 NFS 服务器可以让你的 PC 来将网络远程的 NFS 服务器分享的目录,挂载到本地端的机器当中, 在本地端的机器看起来,那个远程主机的目录就好像是自己的一个磁盘分区槽一样 (partition)!使用上面相当的便利!

nfs服务器:192.168.116.128 centos6.7 64bit

nfs客户端:192.168.116.129 centos6.7 64bit

服务器操作

 rpm -qa|grep nfs    #默认是有安装如下包的

nfs-utils-1.2.3-64.el6.x86_64

nfs4-acl-tools-0.3.3-7.el6.x86_64

nfs-utils-lib-1.1.5-11.el6.x86_64

service nfs start 

 cat /etc/exports     #配置nfs的共享目录并共享给哪个ip或ip段,是否有读写功能

/nfs 192.168.116.0/24(insecure,rw,no_root_squash,no_all_squash,sync)

mkdir /nfs

service nfs restart

客户端操作

 rpm -qa|grep nfs    #默认是有安装如下包的

nfs-utils-1.2.3-64.el6.x86_64

nfs4-acl-tools-0.3.3-7.el6.x86_64

nfs-utils-lib-1.1.5-11.el6.x86_64


showmount -e 192.168.116.128

Export list for 192.168.116.128:

/nfs 192.168.116.0/24


mkdir /nfs

mount -t nfs 192.168.116.128:/nfs /nfs

df -h

192.168.116.128:/nfs   35G  4.0G   30G  12% /nfs

写入/etc/fstab

192.168.116.128:/nfs    /nfs                    nfs     rw              0 0