CentOS挂载windows共享文件夹

CentOS挂载windows共享文件夹

1、挂载命令

​ mount -t cifs -o username=user,password=123456,gid=500,uid=500 //{ip}/upload /share/upload

2、遇到的问题及解决方法

a、mount: block device //{ip}/upload is write-protected, mounting read-only

​ mount: cannot mount block device //{ip}/result read-only

​ 或mount: wrong fs type, bad option, bad superblock on \{ip}{dir}

​ missing codepage or helper program, or other error

​ (for several filesystems (e.g. nfs, cifs) you might

​ need a /sbin/mount. helper program)

​ In some cases useful info is found in syslog - try

​ dmesg | tail or so

解决方法:

​ yum search cifs

​ yum install -y cifs-utils

b、mount error(13): Permission denied

​ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

解决方法:

​ 切换用户。

c、umount: /mnt/files: device is busy.

​ (In some cases useful info about processes that use

​ the device is found by lsof(8) or fuser(1))

解决方法:

​ 退出一次窗口。

d、mount -t cifs -ro username=user,password=123456 //{ip}/[{dir}/{dir}/{dir}] /share/upload

提示:mount: //{ip}/upload is not a valid block device

原因:只能挂一层
解决方法:

​ windows上面FileUpload目录设置共享,命令修改为:

mount -t cifs -o username=user,password=123456 //{ip}/upload /share/upload

e、上传文件:提示The upload destination folder does not appear to be writable.(没有写入权限)

解决方法:

挂载时设置权限组,命令如下:mount -t cifs -o username=user,password=123456,gid=500,uid=500 //{ip}/upload /share/upload

500为www。

f、mount -t cifs -o username=user,password=123456 \{ip}/{dir} /share/upload

出现错误提示:mount.cifs: bad UNC (\{ip}/{dir})

正常为:

mount -t cifs -o username=user,password=123456 //{ip}/{dir} /share/upload

3、项目中的使用步骤

1、创建文件夹,修改拥有者权限

2、挂载 mount -t cifs -o username=guest,password=”“,gid=501,uid=501 //192.168.1.24/upload /share/upload

3、软链

cd /usr/local/nginx/html/website/

ln -s /share/upload upload

遇到的问题:

PHP写入文件时出现:The upload destination folder does not appear to be writable

解决方法:挂载时指定目录权限或者挂载命令增加gid=501,uid=501。

http://www.centoscn.com/image-text/config/2014/0718/3308.html

参考地址:

http://www.cnblogs.com/maning2018/p/6241462.html?utm_source=itdadao&utm_medium=referral

http://blog.sina.com.cn/s/blog_544f183101013zd7.html

http://blog.csdn.net/pearhuaer/article/details/8681359

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值