`
jsntghf
  • 浏览: 2476853 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

通过samba让linux读取windows共享文件夹下的文件

阅读更多

首先在Windows机器上共享出一个share目录,设置好目录的访问权限。本地Windows机器ip地址为192.168.10.152

然后在linux上执行:

 

mount -t smbfs -o username=gaohf,password=gaohf //192.168.10.152/share /var/www/share

 

这样就可以了。如果测试时,提示没有写文件权限,则执行:

 

umount /var/www/share
mount -t smbfs -o rw,fmask=775,dmask=777,uid=www,gid=www,username=gaohf,password=gaohf //192.168.10.152/share /var/www/share

 

如果提示mount: unknown filesystem type 'smbfs',mount不了windows的共享盘,是因为RHE5的kernel已经不再支持smbfs,而改用Common Internet File Systemcifs(cifs)取代了原有的smbfs,所以,将原命令中的smbfs改成cifs即可。

 

如果umount时报错:unmount error 16 = Device or resource busy,则需要使用umount -l /var/www/share命令来卸载,这是启用了umount lazy模式,在需要卸载的对象不忙的情况下卸载。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics