搭建NFS服務器
1.安裝nfs-utils
[root@linux1 ~]
2.創建共享目錄,修改目錄權限爲777
3.在配置文件/etc/exports 裏寫入需要共享的配置信息
[root@linux1 ~]
/nfsshare 192.168.100.*(rw,sync,root_squash)
4.重啓 rpcbind 和 nfs 服務
[root@linux1 ~]
[root@linux1 ~]
(注意先後順序,否則客戶端報錯如下)
[root@Linux2 ~]
clnt_create: RPC: Program not registered
在Linux客戶端使用
1.用showmount命令查看遠程主機NFS共享列表
[root@linux2 ~]
Export list for 192.168.10.10:
/nfsfile 192.168.10.*
2.創建掛載點然後掛載使用
[root@linux2 ~]
[root@linux2 ~]
3.寫入/etc/fstab文件
[root@linux2 ~]
192.168.100.10:/nfsshare /nfsshare nfs defaults 0 0