Autofs自動掛載
autofs是一個程式,實際由automount執行自動掛載。
可根據需要自動掛載指定的目錄,一段時間不用後會自動卸載。
rpcbind服務啟動在port 111
nfs服務啟動在port 2049
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
在掛載前需要有NFS連線,可使用showmount -e <IP>查看可掛載目錄
在NFS的 Client端有關autofs的設定檔共有2個:/etc/auto.master、/etc/auto.nfs(此名稱可自訂)
- autofs的主要設定檔為/etc/auto.master
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
注意事項
- /home/nfsfile 是由autofs所自動建立,因此原本系統中"不應"存在這個目錄
- /home/nfsfile 可掛載的目錄會寫在/etc/auto.nfs
範例
NFS伺服器:redhattest 192.168.200.139
NFS客戶端:ub1 192.168.200.140
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
伺服器端提供2個掛載點
設定主要設定檔
設定資料對應檔
重新啟動autofs服務
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
列出nfsfile下的目錄發現是空的,這是正常的,因為還未掛載任何目錄
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
進入目錄後可發現已被成功掛載
參考連結
鳥哥:NFS伺服器