centos7挂载windows共享文件
? ? ? ? 我的centos7是安裝在vm虛擬機(jī)中筆記本系統(tǒng)windows7
現(xiàn)在想訪問windows7中的數(shù)據(jù)。
?
實(shí)現(xiàn)步驟
1。共享windows7系統(tǒng)中的數(shù)據(jù)
2。設(shè)置掛載點(diǎn)我的是在/mnt/share下
? ? ?創(chuàng)建目錄 touch /mnt/share
3。mount 用法 mount必備的兩個(gè)參數(shù)目錄文件,掛載點(diǎn) ?
mount -t cifs -o username="Administrator",password="***" ?//192.168.1.117/dir目錄 ?/mnt/share
查看掛載信息 df -h
到此還沒有結(jié)束重啟系統(tǒng)后發(fā)現(xiàn)掛載點(diǎn)沒了
待續(xù)
掛載中遇到問題
[root@localhost /]# mount -t cifs -o username="Administrator",password="" //192.168.1.100/share /mnt/share
mount: 文件系統(tǒng)類型錯(cuò)誤、選項(xiàng)錯(cuò)誤、//192.168.1.100/share 上有壞超級(jí)塊、
? ? ? ?缺少代碼頁(yè)或助手程序,或其他錯(cuò)誤
? ? ? ?(對(duì)某些文件系統(tǒng)(如 nfs、cifs) 您可能需要
? ? ? ?一款 /sbin/mount.<類型> 助手程序)
? ? ? ?有些情況下在 syslog 中可以找到一些有用信息- 請(qǐng)嘗試
? ? ? ?dmesg | tail ?這樣的命令看看。
網(wǎng)上看了一些解決辦法,嘗試了沒有解決。
最后把掛在目錄所在的系統(tǒng)加了登錄密碼123 ?掛載成功
[root@localhost /]# mount -t cifs -o username="Administrator",password="123" //192.168.1.100/share /mnt/share
[root@localhost /]# cd ..
[root@localhost /]# ls
bin ?boot ?dev ?etc ?home ?lib ?lib64 ?media ?mnt ?opt ?proc ?root ?run ?sbin ?srv ?sys ?tmp ?usr ?var
[root@localhost /]# cd mnt/share
[root@localhost share]# ls
jdk-7u79-linux-x64.rpm ?mysql-5.6.30.tar.gz ?MySQL-server-5.6.22-1.el6.x86_64.rpm
[root@localhost share]#?
最后加上開機(jī)自動(dòng)掛載
修改fstab文件 ?vim /etc/fstab?
在文件的末尾加上一行
//192.168.1.101/share ?/mnt/share cifs username=administrator,password=123 0 0
要保障你的電腦ip地址固定
收工
轉(zhuǎn)載于:https://blog.51cto.com/chinaji/1895682
總結(jié)
以上是生活随笔為你收集整理的centos7挂载windows共享文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jetty权威指南
- 下一篇: JAVA总结之数组篇