1.mount:Win7文件夹共享到SuSE系统

1.Win7中创建一个文件夹,放置共享的文件 :D:\\share

2.点击文件夹,右键选择属性

3.选择共享菜单,设置共享属性,进入“要与其共享的用户”

4.选择系统管理员,意味着默认设置自己可见

5.点击完成退出

在虚拟机中linux系统进行简单的操作

1.在虚拟机中创建共享的文件夹,挂载Win7共享文件夹:

   mkdir share

2.Win7共享文件夹挂载到新创建的文件目录下

mount    -t cifs -o username=*****,password=******  //192.168.20.242/sharelinux    share/

2.mountWin7文件夹共享到RedHat

1uname -a

inux bogon2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64GNU/Linux

2)共享命令

#mount    -t cifs -o username=*****,password=******  //192.168.20.242/sharelinux    share/

3)错误信息:

mount:block device//192.168.20.242/sharelinux  iswrite-protected ,mounting read-only

mount:can notmount block device

4)查看日志文件:/var/log/messages

Oct 11 01:27:03bogon kernel: CIFS VFS: cifs_mount failed w/return code = -6

Oct 11 01:51:05bogon kernel: CIFS VFS: cifs_mount failed w/return code = -13

Oct 11 01:54:42bogon kernel: CIFS VFS: cifs_mount failed w/return code = -101

5)原因:

当启动SELinux安全访问机制会造成这个错误

6)解决问题的方法:

1.进入文件

cd /etc/selinux

2.打开文件

vi config

3. 修改

SELINUX=disabled

or

SELINUX=permissive

重启电脑

reboot

3 mount:Win7共享文件夹到Ubuntu

操作过程:

1)采用SuSE平台下使用过的命令:#:mount -t cifs -o username=***,password=***//192.168.20.12/WinShare  /mnt/WinShare



2)得到错误的信息如下:

mount: wrong fstype, bad option, bad superblock on //192.168.20.123/WinShare,

      missing codepage or helper program, orother error

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

      need a /sbin/mount.<type> helperprogram)

      In some cases useful info is found insyslog - try

      dmesg | tail  or so



3)解释上面的错误信息:

******************************

******************************

4)查看系统的日志信息(Ubuntu/var/log/syslog)

采用指令:cat /var/log/syslog

注意:如果没有这个文件,可以查看/var/log文件夹下面

的所有文件,一一查找,这是不同平台,不同的版本,之

间的区别。



5)获取的错误信息如下:

Oct 11 17:38:36ubuntu kernel: [ 7046.019469] FS-Cache: Netfs 'cifs' registered for caching

Oct 11 17:38:36ubuntu kernel: [ 7046.065450] Key type cifs.spnego registered

Oct 11 17:38:36ubuntu kernel: [ 7046.065484] Key type cifs.idmap registered

Oct 11 17:38:36ubuntu kernel: [ 7046.066002] CIFS: no cache= option specified, using"cache=loose". This default will change to "cache=strict"in 3.7.

Oct 11 17:38:36ubuntu kernel: [ 7046.300031] CIFS VFS: Connecting to DFS root not implementedyet

Oct 11 17:38:36ubuntu kernel: [ 7046.344884] CIFS VFS: cifs_mount failed w/return code = -22





6)可以使用其他的查看命令:

1.dmesg syslog(不局限于/var/log目录下)

打印结果如下:

[ 7046.019469]FS-Cache: Netfs 'cifs' registered for caching

[ 7046.065450] Keytype cifs.spnego registered

[ 7046.065484] Keytype cifs.idmap registered

[ 7046.066002]CIFS: no cache= option specified, using "cache=loose". This defaultwill change to "cache=strict" in 3.7.

[ 7046.300031]CIFS VFS: Connecting to DFS root not implemented yet

[ 7046.344884]CIFS VFS: cifs_mount failed w/return code = -22

2.tail -f  syslog(局限于/var/log目录下)

打印结果:

*********

*********



7)安装cifs-utils升级包

使用的命令如下:


sudo apt-getupdate

sudo apt-getinstall cifs-utils




redhat挂载出现问题:

[root@localhost~]# mount -t cifs -o username=jack, password=******** //192.168.40.31/vsms/mnt/Jackplace/

Usage: mount-V                 : print version

      mount -h                 : print this help

      mount                    : list mounted filesystems

      mount -l                 : idem, including volumelabels

So far theinformational part. Next the mounting.

The command is`mount [-t fstype] something somewhere'.

Details found in/etc/fstab may be omitted.

      mount -a [-t|-O] ...     : mount all stuff from /etc/fstab

      mount device             : mount device at the known place

      mount directory          : mount known device here

      mount -t type dev dir    : ordinary mount command

Note that one doesnot really mount a device, one mounts

a filesystem (ofthe given type) found on the device.

One can also mountan already visible directory tree elsewhere:

      mount --bind olddir newdir

or move a subtree:

      mount --move olddir newdir

One can change thetype of mount containing the directory dir:

      mount --make-shared dir

      mount --make-slave dir

      mount --make-private dir

      mount --make-unbindable dir

One can change thetype of all the mounts in a mount subtree

containing thedirectory dir:

      mount --make-rshared dir

      mount --make-rslave dir

      mount --make-rprivate dir

      mount --make-runbindable dir

A device can begiven by name, say /dev/hda1 or /dev/cdrom,

or by label,using  -L label  or by uuid, using  -U uuid .

Other options:[-nfFrsvw] [-o options] [-p passwdfd].

For many moredetails, say  man 8 mount .


注意:通过共享过来的Windows文件,Linux每次只允许打开一个文件,当打开第二个文件的时候出现:Permission Deny,这个问题需要留意!!