zzl001 发表于 2018-6-19 06:21:14

linux如何挂载windows下的共享文件

  ***************当你发现自己的才华撑不起野心时,就请安静下来学习吧***************
  说明:
  windows下有一共享文件夹APP,windows本地ip是192.168.9.155
  现在需要在linux服务器上挂载这个APP文件夹,linux服务器ip是192.168.9.200
  操作记录如下:
  1)windows上的准备工作
  首先将windows上D盘下的APP文件夹设置为共享。右击APP文件夹的“共享”属性.

  选择“特定用户”共享,添加共享用户。如下


  这样,APP文件夹就设置为共享文件夹了,上面的O3zyrm2d4gnp5j2是windows的机器名。查看APP下里面的文件

  2)linux服务器上的操作
  创建挂载目录/mnt/APP
  # mkdir /mnt/APP
  使用mount.cifs进行挂载操作:(下面的用户名和密码是登陆windows的)
  # yum provides */mount.cifs
  #yum -y install cifs-utils-4.8.1-20.el6.x86_64
  # mount.cifs //192.168.9.155/APP /mnt/APP/ -o user=administrator,pass=Taren1
  查看下,发现已经挂在上了
  # ls /mnt/APP/
  2.sql 3.sql 8633上线sql.zip
  # df -h

  Filesystem>  /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
  # 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)
  卸载
  # umount /mnt/APP
  # df -h
  Filesystem      SizeUsed Avail Use% Mounted on
  /dev/sda2       450G   97G331G23% /
  tmpfs         3.9G228K3.9G   1% /dev/shm
  /dev/sda1       194M   34M150M19% /boot
页: [1]
查看完整版本: linux如何挂载windows下的共享文件