1、安裝mount.cifs軟件包
yum install cifs-utils -y
如果是離線環境,請參考我的另一篇文章
https://blog.csdn.net/qq_37119960/article/details/108331373
2、開始掛載
mount.cifs //192.168.1.110/share /usr/local/winshare -o user=administrator,pass=123456
參數說明
#pass=123456為Windows里administrator用戶的登陸系統密碼
添加開機自掛載
vim /etc/rc.d/rc.local
末尾添加
mount.cifs //192.168.1.110/share /usr/local/winshare -o user=administrator,pass=123456
NAS存儲掛載方式
1、安裝nfs-utils
2、執行
mount -t nfs 192.168.1.80:/NFS /mnt/nfs
3、設置自啟
修改 /etc/rc.local ,設置啟動自動腳本,把你的NAS文件掛載腳本加入。
注意點
如果在rclocal中加入命令后重啟無效,考慮可能是沒有執行權限。
chmod a+x /etc/rc.local