文件服務器(被掛載機):192.168.1.100
操作機(掛載到機):192.168.1.200
也就是說,你在操作機上進行的操作,實際上都到文件服務器上去了;
1. 開啟NFS服務:
在文件服務器(被掛載機)上
# chkconfig --level 35 nfs on //開啟NFS開機運行 # service nfs start //手動啟動服務
2. 編輯/etc/exports文件:
加入:
/tmp 192.168.1.100 (rw,sync,no_root_squash) //編輯需要共享的目錄和允許訪問的服務器及權限。 或 /opt/apache-tomcat-6.0.37/webapps/fileShare/file * (rw,sync,no_root_squash) /mnt * (ro,sync)
3. 在被搭載機上新建目錄,配置權限:
在操作機(掛載到機)上
# mkdir /tmp # chmod 777 -R /tmp
4. 建立連接:
在操作機(掛載到機)上
mount 192.168.1.100:/tmp /tmp
5. 開機自動掛載:
將這行
mount 192.168.1.100:/tmp /tmp
添加到/etc/rc.local,開機就會自動掛載了