1. 程式人生 > >Windows服務器目錄掛載到linux服務器

Windows服務器目錄掛載到linux服務器

windows mount centos 掛載

  把Windows服務器172.17.43.56(內網地址)的目錄mountCentOS服務器172.17.43.57(內網地址)的目錄上。

#linux服務器的掛載狀態

[root@iZ2zeoecj5h2z0720hZtmp]# df -h
Filesystem      Size Used Avail Use% Mounted on
/dev/vda1       493G  87G  381G  19% /
devtmpfs        1.9G    0  1.9G   0% /dev
tmpfs           1.9G     0 1.9G   0% /dev/shm
tmpfs           1.9G 592K  1.9G   1% /run
tmpfs           1.9G     0 1.9G   0% /sys/fs/cgroup
tmpfs          380M     0  380M  0% /run/user/0

#/mnt目錄為空

[root@iZ2zeoecj5h2z0720hZ/]# cd mnt/
[root@iZ2zeoecj5h2z0720hZmnt]# ll
total 0
[root@iZ2zeoecj5h2z0720hZmnt]# cd ..

#掛載失敗

[root@iZ2zeoecj5h2z0720hZ /]# mount -t cifs -ousername="administrator" //172.17.43.56/bak /mnt
mount: //172.17.43.56/bakis write-protected, mounting read-only
mount: cannotmount //172.17.43.56/bak read-only
[root@iZ2zeoecj5h2z0720hZ/]# cd mnt/
[root@iZ2zeoecj5h2z0720hZmnt]# ll
total 0
[root@iZ2zeoecj5h2z0720hZ mnt]# cd ..

#安裝cifs-utils

[root@iZ2zeoecj5h2z0720hZ /]#yum installcifs-utils.x86_64 -y

#再次掛載成功(需要Windows服務器的administrator用戶密碼)

[root@iZ2zeoecj5h2z0720hZ /]# mount -t cifs -ousername="administrator" //172.17.43.56/bak /mnt
Password for administrator@//172.17.43.56/bak:  ****************
[root@iZ2zeoecj5h2z0720hZ /]# cd mnt/
[root@iZ2zeoecj5h2z0720hZ mnt]# ll -h
total 120G
-rwxr-xr-x 1 root root  51G Oct 1818:03 ecyingusystem-20171018175058.bak
-rwxr-xr-x 1 root root 9.8G Oct 18 18:17 ecyingusystem-20171018180614.bak
-rwxr-xr-x 1 root root 9.2G Oct 18 18:51 ecyingusystem-20171018180614.rar

#復制掛載目錄的文件沒有問題

[root@iZ2zeoecj5h2z0720hZmnt]# cp ecyingusystem-20171018180614.bak /tmp/
[root@iZ2zeoecj5h2z0720hZmnt]# ll /tmp/
total 14380696
-rwxr-xr-x 1root root 10434044928 Oct 19 11:29 ecyingusystem-20171018180614.bak
drwxr-xr-x 2root root        4096 Oct 16 17:12hsperfdata_root

#掛載成功後的狀態

[root@iZ2zeoecj5h2z0720hZ~]# df -h
Filesystem          Size Used Avail Use% Mounted on
/dev/vda1           493G 116G  352G  25% /
devtmpfs            1.9G     0 1.9G   0% /dev
tmpfs               1.9G     0 1.9G   0% /dev/shm
tmpfs               1.9G  604K 1.9G   1% /run
tmpfs               1.9G     0 1.9G   0% /sys/fs/cgroup
tmpfs               380M     0 380M   0% /run/user/0
//172.17.43.56/bak 420G  224G  196G 54% /mnt


參考文檔:

http://os.51cto.com/art/201408/449273.htm——WindowsLinux文件系統互訪的幾種方法

http://blog.csdn.net/yasi_xi/article/details/38356247——inux mountWindows目錄遇到 write-protected 問題

本文出自 “dark-matter” 博客,請務必保留此出處http://gagarin.blog.51cto.com/1056957/1974583

Windows服務器目錄掛載到linux服務器