之前,写过一个http://blog.csdn.net/commshare/article/details/17020041 用来挂在其他linux主机的samba共享文件。

现在在新的ubuntu12.04的64位真机上,想挂在我在ubuntu32的虚拟机的samba共享文件夹。



遇到了这个问题:

root@Seagate64:/home/zhangbin/magicdev# mount -t smbfs -o iocharset=utf8,username=zhangbin,password=zhangbin//192.168.1.88/AlexHome /home/zhangbin/magicdev/u32magicdev/
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational 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 does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type 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 the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given 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 more details, say  man 8 mount .


命令有错误的地方。


起初,以为是不支持samba,于是:


root@Seagate64:/home/zhangbin/magicdev# apt-get install samba
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gir1.2-ubuntuoneui-3.0 libubuntuoneui-3.0-1 thunderbird-globalmenu
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  tdb-tools
Suggested packages:
  openbsd-inetd inet-superserver smbldap-tools ldb-tools ctdb
The following NEW packages will be installed:
  samba tdb-tools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,063 kB of archives.
After this operation, 23.5 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main samba amd64 2:3.6.3-2ubuntu2.9 [8,040 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ precise/main tdb-tools amd64 1.2.9-4 [23.2 kB]
Fetched 8,063 kB in 7s (1,023 kB/s)                                            
Preconfiguring packages ...
Selecting previously unselected package samba.
(Reading database ... 178428 files and directories currently installed.)
Unpacking samba (from .../samba_2%3a3.6.3-2ubuntu2.9_amd64.deb) ...
Selecting previously unselected package tdb-tools.
Unpacking tdb-tools (from .../tdb-tools_1.2.9-4_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Setting up samba (2:3.6.3-2ubuntu2.9) ...
Generating /etc/default/samba...
Importing account for nobody...ok
Importing account for zhangbin...ok
update-alternatives: using /usr/bin/smbstatus.samba3 to provide /usr/bin/smbstatus (smbstatus) in auto mode.
smbd start/running, process 13799
nmbd start/running, process 13834
Setting up tdb-tools (1.2.9-4) ...
update-alternatives: using /usr/bin/tdbbackup.tdbtools to provide /usr/bin/tdbbackup (tdbbackup) in auto mode.


还是不行。


原来是少了空格,没有识别到是把啥挂载。这个是两//,之前有个个空格的。

root@Seagate64:/home/zhangbin/magicdev# mount -t smbfs -o iocharset=utf8,username=zhangbin,password=zhangbin //192.168.1.88/AlexHome /home/zhangbin/magicdev/u32magicdev/
mount: unknown filesystem type 'smbfs'

这个问题,可以参考 http://www.51testing.com/html/00/130600-207951.html


说smbfs改为cifs了

于是,
root@Seagate64:/home/zhangbin/magicdev# mount -t cifs -o iocharset=utf8,username=zhangbin,password=zhangbin //192.168.1.88/AlexHome /home/zhangbin/magicdev/u32magicdev/
root@Seagate64:/home/zhangbin/magicdev# ls
u32magicdev
root@Seagate64:/home/zhangbin/magicdev# cd u32magicdev/
root@Seagate64:/home/zhangbin/magicdev/u32magicdev# ls

OK了。

不过我的1.88的虚拟机1g内存,感觉好慢啊,也可能是samba的问题吧。


Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐