linux如何掛載windows下的共用檔案

來源:互聯網
上載者:User

標籤:windows   linux   共用資料夾   

***************當你發現自己的才華撐不起野心時,就請安靜下來學習吧***************


說明:
windows下有一共用資料夾APP,windows本地ip是192.168.9.155
現在需要在linux伺服器上掛載這個APP檔案夾,linux伺服器ip是192.168.9.200

操作記錄如下:

1)windows上的準備工作

首先將windows上D盤下的APP檔案夾設定為共用。右擊APP檔案夾的“共用”屬性.

650) this.width=650;" src="http://images2015.cnblogs.com/blog/907596/201610/907596-20161018182709170-2029542032.png" />

選擇“特定使用者”共用,添加共用使用者。如下

650) this.width=650;" src="http://images2015.cnblogs.com/blog/907596/201610/907596-20161018182854107-463275219.png" />

650) this.width=650;" src="http://images2015.cnblogs.com/blog/907596/201610/907596-20161018183258201-1770898842.png" />

 這樣,APP檔案夾就設定為共用資料夾了,上面的O3zyrm2d4gnp5j2是windows的機器名。查看APP下裡面的檔案

650) this.width=650;" src="http://images2015.cnblogs.com/blog/907596/201610/907596-20161018182954529-1264363942.png" /> 

2)linux伺服器上的操作

建立掛載目錄/mnt/APP

[[email protected] ~]# mkdir /mnt/APP

使用mount.cifs進行掛載操作:(下面的使用者名稱和密碼是登陸windows的)

[[email protected] ~]# yum provides */mount.cifs

[[email protected] ~]#yum -y install cifs-utils-4.8.1-20.el6.x86_64

[[email protected] ~]# mount.cifs //192.168.9.155/APP /mnt/APP/ -o user=administrator,pass=Taren1

查看下,發現已經掛在上了
[[email protected] ~]# ls /mnt/APP/                      
2.sql 3.sql 8633上線sql.zip


[[email protected] mnt]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 450G 97G 331G 23% /
tmpfs 3.9G 228K 3.9G 1% /dev/shm
/dev/sda1 194M 34M 150M 19% /boot
//192.168.9.155/APP 123G 12G 111G 10% /mnt/APP

[[email protected] mnt]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
//192.168.9.155/APP on /mnt/APP type cifs (rw)

卸載
[[email protected] mnt]# umount /mnt/APP
[[email protected] mnt]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       450G   97G  331G  23% /
tmpfs           3.9G  228K  3.9G   1% /dev/shm
/dev/sda1       194M   34M  150M  19% /boot



本文出自 “12336621” 部落格,請務必保留此出處http://12346621.blog.51cto.com/12336621/1914816

linux如何掛載windows下的共用檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.