我的centos7是安裝在vm虛擬機中筆記本系統windows7
現在想訪問windows7中的數據。
實現步驟
1。共享windows7系統中的數據
2。設置掛載點我的是在/mnt/share下
創建目錄 touch /mnt/share
3。mount 用法 mount必備的兩個參數目錄文件,掛載點
mount -t cifs -o username="Administrator",password="***" //192.168.1.117/dir目錄 /mnt/share
查看掛載信息 df -h
到此還沒有結束重啓系統後發現掛載點沒了
待續
掛載中遇到問題
[root@localhost /]# mount -t cifs -o username="Administrator",password="" //192.168.1.100/share /mnt/share
mount: 文件系統類型錯誤、選項錯誤、//192.168.1.100/share 上有壞超級塊、
缺少代碼頁或助手程序,或其他錯誤
(對某些文件系統(如 nfs、cifs) 您可能需要
一款 /sbin/mount.<類型> 助手程序)
有些情況下在 syslog 中可以找到一些有用信息- 請嘗試
dmesg | tail 這樣的命令看看。
網上看了一些解決辦法,嘗試了沒有解決。
[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]#
最後加上開機自動掛載
修改fstab文件 vim /etc/fstab
在文件的末尾加上一行
//192.168.1.101/share /mnt/share cifs username=administrator,password=123 0 0
要保障你的電腦ip地址固定