windows自带共享功能,可以在别的机器通过类似 \\aslibra\share 访问windows的共享。
Linux也有samba服务,可以提供此项功能,访问方式也是一样的。

如何解决磁盘空间问题?
假设windows空间不够,可以开一个linux机器,通过samba服务,映射为本地磁盘。
linux空间不够,也可以开一个windows的机器,通过共享,映射到本地文件系统。

前者是配置linux的samba服务的问题,不说了,参考《samba的机器访问共享名设置

linux挂载windows的共享也很简单,先得检查是否支持smbfs:

[root@gx ~]# cat /proc/filesystems | grep smbfs
nodev   smbfs

然后可以建立目录,挂载到本地文件系统里了:

mkdir -p /mnt/movie

mount -t smbfs -o username=aslibra,password=aslibra,uid=daemon,iocharset=utf8,codepage=cp936 \
//192.168.1.4/movie /mnt/movie


这里主要有几个注意的:

1 类型要声明是smbfs
2 如果是匿名可以访问,可以用guest参数
3 如果是用户名密码的,那就要带上username和password
4 uid要声明是挂载为哪个用户的文件,读写会有限制的
5 本地字符集,Linux charset (iso8859-1, utf8)
6 windows的字符集,cp850或者cp936之类的
以上两个字符集只有设置正常了,才能正常显示中文文件名,否则都变成小问号啦~

具体还可以看看别的参数:

[root@gx ~]# smbmount
Unknown parameter encountered: "revalidate"
Ignoring unknown parameter "revalidate"
Usage: mount.smbfs service mountpoint [-o options,...]
Version 3.0.10-1.4E

Options:
      username=                  SMB username
      password=                  SMB password
      credentials=          file with username/password
      krb                             use kerberos (active directory)
      netbiosname=               source NetBIOS name
      uid=                       mount uid or username
      gid=                       mount gid or groupname
      port=                      remote SMB port number
      fmask=                     file umask
      dmask=                     directory umask
      debug=                     debug level
      ip=                        destination host or IP address
      workgroup=                 workgroup on destination
      sockopt=                   TCP socket options
      scope=                     NetBIOS scope
      iocharset=                 Linux charset (iso8859-1, utf8)
      codepage=                  server codepage (cp850)
      unicode                         use unicode when communicating with server
      lfs                             large file system support
      ttl=                       dircache time to live
      guest                           don't prompt for a password
      ro                              mount read-only
      rw                              mount read-write

This command is designed to be run from within /bin/mount by giving
the option '-t smbfs'. For example:
  mount -t smbfs -o username=tridge,password=foobar //fjall/test /data/test


原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
Tags: , , ,
发表评论
表情
emotemotemotemotemotemotemotemotemotemotemotemotemot
emotemotemotemotemotemotemotemotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写
 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐