一、在Windows服务器上进行安装NFS服务
首先,打开服务管理器,选择添加角色;

选中文件服务,下一步;

出现一个提示,不管它,继续下一步;

在接下来的页面中选中“网络文件系统服务”(NFS),下一步;

点击安装;

系统开始安装,大约需要几分钟;

安装完成,点击关闭;

这样,在Windows Server 2008
R2建立了NFS服务,然后选择一个分区,新建一个文件夹,比如NFS;

在文件夹上右键,属性,可以看到属性列表多了一个NFS共享;

点击管理NFS共享,选择共享此文件夹,下面的验证默认就好;

点击“权限”,这里默认显示所有计算机都有只读权限,不允许根目录访问,不必管它,选择“添加”;

在添加名称这里输入XenServer主机的ip地址,访问类型选择“读写”,并选中“允许根目录访问”,如果不选择这个,在XenCenter中
是不能新建存储的,然后“确定”

因为我的2台主机都安装了XenServer,因此这里添加了2台主机的ip地址;

二、Linux设置办法
# 安装nfs协议客户端
yum install -y nfs-utils portmap
# 在授权的机器上显示一下是否能看到这台Windows提供的NFS服务
showmount -e 10.10.14.227
# 映射NFS到本地的磁盘目录上
mkdir /usr/local/test -p
mount -t nfs -o ro,bg,soft,nolock 10.10.14.227:/down /usr/local/test
# 其它机器也能看到这个映射,但无法完成mount
[root@localhost ~]# mount -t nfs -o ro,bg,soft,nolock 10.10.14.227:/down /usr/local/test
mount.nfs: access denied by server while mounting 10.10.14.227:/down
三、关于端口
这个NFS不是使用的445端口,而是其它的端口,这样,永恒之蓝就我们say good bye!
经测试,WINDOWS NFS共享只需开放2049端口即可。
四、启动LINUX就挂载的办法
最后,可以编辑 /etc/exports 添加其他挂载目录

五、其它
还需要检查现在samba的挂载办法去掉,定时磁盘检查shell 改造,安装包改造等问题,请运维同事持续修改。
使用Windows 2008R2中的NFS替代Samba协议,解决Windows 与Linux共享文件的问题
原文:https://www.cnblogs.com/littlehb/p/9086266.html