close

為何使用動態掛載,是因為能避免一些意外性的問題,

 

作者的情況需要掛載的對象為網芳,

所以會先安裝 mount.cifs

yum install samba-client samba-common cifs-utils -y

再來就是autofs服務

yum install autofs -y

 

再設定autofs時,需要從/etc/auto.master開始,加入一行

/mnt /etc/auto.mymount

第一個路徑/mnt,為進入此目錄時autofs會幫你自動對應掛載的設定檔/etc/auto.mymount

接著編輯/etc/auto.mymount,加入掛載指令

gitlab  -fstype=cifs,rw,noperm,user=username,pass=password ://ip/git/gitlab
這邊第一個gitlab為/mnt下的掛載目錄(會自動產生),後面的://ip/git/gitlab則為網芳路徑.

 

參考

https://wiki.centos.org/zh-tw/TipsAndTricks/WindowsShares

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 abcg5 的頭像
    abcg5

    Aaron Yang

    abcg5 發表在 痞客邦 留言(0) 人氣()