起因:想要通过samba协议把网络上其他机器mount到本地目录下, 使用如下命令:
$ sudo mount -t smbfs server:/dir ./local
结果报错:
$ mount: unknown filesystem type 'smbfs'
google了一下,都说要把smbfs改为cifs,继续报错:
mount: wrong fs type, bad option, bad superblock on //192.168.28.152/otadownload,
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
继续google,说是因为“缺少/sbin/mount.nfs这个文件,需要apt-get nfs-common”,ls查看一下果然没有该文件,继续安装之,安装完毕后再ls看一下,OK,文件已经存在了。
继续尝试,仍然报同样的错误。。。
怎么回事?
再仔细看看上面一段的错误提示,看样子我所需要的/sbin/mount.<type>文件是和要mount的文件系统类型相关的,再试试smbmount命令呢,提示:
$ smbmount
The program 'smbmount' is currently not installed. You can install it by typing:
sudo apt-get install smbfs
继续安装,果然安装完毕后就有了/sbin/mount.cifs 和 /sbin/mount.smbfs这两个文件,这时再使用最上面的命令就能够正确挂载了。
感悟:命令行提示要看清!
PS. 我的系统版本是Ubuntu 12.04
$ cat /etc/issue
Ubuntu 12.04.5 LTS \n \l
据说在12.10之后的版本已经废弃了smbfs,使用cifs替代,各位可以根据自己的实际情况灵活对待。