linux下nfs配置

来源:互联网 发布:mac 安装sass 编辑:程序博客网 时间:2024/05/29 12:02
操作系统:redhat

1、nfs配置

服务端
1. mkdir /test 假如/test就是我们需要发布的目录
2. vim /etc/exports
/test *(rw) *所有IP r 可读 w 可写
3. service nfs restart
4. showmount -e 192.168.110.xxx
如果发现
Export list for 192.168.110.254:
/test *
发布成功

客户端连接主机nfs服务
1.showmount -e 192.168.110.xxx (主机IP)
Export list for 192.168.110.254:
/test *
2. mount -t nfs 192.168.110.xxx:/test /mnt (客户机目录)
3.df -h
192.168.110.254:/test
193G 33G 151G 18% /mnt
证明挂载成功
*注意:客户端
如果处理完事情要及时解挂
umount /mnt
如果没有及时解挂,只要服务器意外关机,客户端将死机(慢慢)

2、cifs使用

cifs用于window与linux之间共享文件,和samba功能一样。
mount -t cifs 192.168.2.211:/share /mnt
df -h
umount /mnt
0 0
原创粉丝点击