您的位置:首页 > 运维架构 > Linux

centos6.4 *64 Linux挂载windows下共享文件夹

2014-06-26 13:52 615 查看
centos6.4 *64 Linux挂载windows下共享文件夹

mount //192.168.1.21 /mnt/pub
结果无法正常挂载,提示以下错误,开始以为是因为windows下共享文件夹是ntfs格式的问题,下了一个ntfs-3g,依旧无效,后来发现是少了组件包cifs-utils

[root@localhost ~]# mount //192.168.1.25/pub /mnt/pub
mount: wrong fs type, bad option, bad superblock on //192.168.1.25/pub,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so

安装完cifs-utils后直接挂载根目录会显示以下错误
[root@localhost mnt]# mount -t cifs //192.168.1.25 /mnt/pub
Password:
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
#经多次尝试后发现不能挂载根目录,只能挂载共享文件名,

经过多次搜索及尝试后发现几个问题
1.少了一个组件包cifs-utils
2.linux无法直接挂载根目录,如://192.168.1.21,只能挂载文件//192.168.1.21/pub

解决方案
1.缺少了一个cifs-utils包,安装即可 yum -y install cifs-utils
2.linux无法直接挂载根目录,如://192.168.1.21,只能挂载共享文件夹 //192.168.1.21/pub
3.如果共享文件没有设置密码Password:直接回车即可;mount //192.168.1.25/pub /mnt/pub
4.如果共享文件设置了密码mount -o username=username,passwd=passwd //192.168.1.21/pub /mnt/pub
#按照以上命令挂载即可,注意username及passwd之间必须加"," 且间隔不能有空格.
5.我这里尝试 mount 后面加不加参数 -t cifs 都可以挂载

最后解除挂载的问题:
[root@localhost pub]# umount /mnt/pub
umount: /mnt/pub: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1)).
#卸载挂载文件时用户不能操作已挂在的文件,否则会出现以上错误,如果进入了/mnt/pub目录,此时退出/mnt/pub目录后可以正常卸载挂载文件

[root@localhost pub]# cd ..
[root@localhost mnt]# umount /mnt/pub

本文出自 “statby的博客” 博客,请务必保留此出处http://statby.blog.51cto.com/7588140/1431156
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: