mount -t smbfs -o username=administrator,password=123456 //192.168.100.224/public /mnt/winkernel
mount -t cifs -o username=administrator,password=123456,codepage=cp936 //192.168.100.224/public /mnt/winkernel
[92615.408159] smbfs is deprecated and will be removed from the 2.6.27 kernel. Please migrate to cifs
參考
公司發存新程式由專人負責的。我需要講war包上傳到一個windws共用目錄。由於現在換成Gentoo + xfce4環境了。Thunar又不支援 smb://協議。所以只有自己手動mount了。由於之前已經裝過samba了。所以就直接mount一把。
gentoo ~ # mount -t smbfs -o username=aaa,password=aaa //10.200.106.252/updatepack release
ERROR: smbfs filesystem not supported by the kernel
Please refer to the smbmnt(8) manual page
smbmnt failed: 255
發現核心不支援smbfs.就重新編譯了一下核心。
< > SMB file system support (OBSOLETE, please use CIFS)
<M> CIFS support (advanced network filesystem, SMBFS successor)
[*] CIFS statistics
[*] Extended statistics
[*] Support legacy servers which use weaker LANMAN security
[*] CIFS extended attributes
[*] CIFS POSIX Extensions
[*] Enable additional CIFS debugging routines
[ ] CIFS Experimental Features (EXPERIMENTAL)
當看到SMB file system的時候看到OBSOLETE了,看來不建議使用了。建議使用CIFS,所以就把CIFS選上了。看起來是 SMBFS的繼承者。
編譯替換核心重啟,再mount一把。鬱悶的是還提示不行。但是選擇CIFS的時候自己想當然的以為CIFS肯定支援SMBFS的。沒想到就不是這麼回事。如果要mount -t smbfs就必須要選擇 SMB file system support 才行。當時就只好用vbox裡的windows去訪問共用目錄了。不過不知道為什麼出奇的慢。100M的區域網路拷貝十幾M的包要20分鐘(Orz)。
後來意識到自己的想法是錯誤的。又不想用廢棄的SMB file system support。所以在gentoo-wiki.com中找到了答案。
gentoo ~ # mount -t cifs //10.200.106.252/updatepack /home/rory/release -o "username=aaa,password=aaa,uid=1000,isocharset=cp936"
一切搞定。再把這命令寫到啟動指令碼裡。
rory@gentoo ~ $ more /etc/conf.d/local.start
# /etc/conf.d/local.start
# This is a good place to load any misc programs
# on startup (use &>/dev/null to hide output)
############## smbmount release from dual ################
mount -t cifs //10.200.106.252/updatepack /home/rory/release -o "username=aaa,password=aaa,uid=1000,isocharset=
cp936"
##########################################################
如果你沒有local.start 應該有 local 檔案。