记录挂载samba遇到的部分错误
2023-03-16 遇到的一点小问题
我使用的挂载命令是这样子的:
samba="//${ip}/${share}"
mount -t cifs -v "${samba}" "${dir}" -o username="${user}",password="${psd}",iocharset=utf8,vers=3.1.1
#或者这样,不指定用户名,使用当前执行命令的用户名
mount -t cifs -v "${smb}" "${dir}" -o password="${psd}",iocharset=utf8,vers=3.1.1
没有密码时,也加上 password="",这样就不会出现要求输入密码的情况
.
mount.cifs: bad UNC (${samba})
把samba路径修改成/${ip}/${share}
或者其他错误样式
返回结果:1
错误信息:mount.cifs: bad UNC (/192.168.1.1/test)
.
Couldn't chdir to ${dir}: No such file or directory
把挂载的路径修改成不存在的路径,比如/mntt/test
返回结果:1
错误信息:Couldn't chdir to /mntt/test: No such file or directory
.
mount error(113): could not connect to ${ip}Unable to find suitable address.
把ip地址改成格式正确,但不存在的地址
返回结果:32
错误信息:
mount.cifs kernel mount options: ip=192.168.100.250,unc=\192.168.100.250 est,iocharset=utf8,vers=3.1.1,user=root,pass=********
mount error(113): could not connect to 192.168.100.250Unable to find suitable address.
mount error: could not resolve address for ${ip}: Unknown error
把ip地址改成格式错误,比如1921.68.100.250,挂载时就会提示这个。
.
mount error(2): No such file or directory
把share文件夹改成不存在的地址
返回结果:32
错误信息:
mount.cifs kernel mount options: ip=192.168.1.1,unc=\192.168.1.1\testtttt,iocharset=utf8,vers=2.1,user=root,pass=********
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
.
mount error(22): Invalid argument
使用错误的参数进行连接,比如vers的版本写成不存在的3.3
返回结果:32
错误信息:
mount.cifs kernel mount options: ip=192.168.1.1,unc=\192.168.1.1\test,iocharset=utf8,vers=3.3,user=root,pass=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
.
mount error(13): Permission denied
使用错误的账号信息取连接需要密码的节点
返回结果:32
错误信息:
mount.cifs kernel mount options: ip=192.168.1.1,unc=\192.168.1.1\test,iocharset=utf8,vers=2.1,user=root,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
.
mount error(112): Host is down
mount error(95): Operation not supported
samba节点有限制版本,使用不合适的版本去连接
返回结果:32
错误信息:
mount.cifs kernel mount options: ip=192.168.1.1,unc=\192.168.1.1\test,iocharset=utf8,vers=3.0.2,user=root,pass=********
mount error: Server abruptly closed the connection.
This can happen if the server does not support the SMB version you are trying to use.
The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
或者这个信息:
mount.cifs kernel mount options: ip=192.168.1.1,unc=\192.168.1.1\test,iocharset=utf8,vers=2.0,user=root,pass=********
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
.
mount error(115): Operation now in progress
在外地的一台win11电脑上设置共享文件夹,我这边连接不了,提示这个。
这边win11也设置了一个,那边却可以连接。
mount error(11): Resource temporarily unavailable
在win11电脑上设置共享文件夹,使用vers=3.1.1
版本进行连接,提示的这个。
使用vers=3.0.2
或更低版本进行连接,就正常了。
mount error(16): Device or resource busy
${dir}.mount already exists.
mount: bad usage
平时使用过程偶尔有遇到些其他的错误信息,懒得复现了,先贴一下错误信息。