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

时间:2014-06-27 06:43:38   收藏:0   阅读:427


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

centos6.4 *64 Linux挂载windows下共享文件夹,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!