# libmOUNT_DEBUG=0xffff mount //fileserver/db-MysqL /mnt/MysqLBackups -t cifs -o credentials=/etc/samba/fileserver.password,forceuID,uID=MysqL,forcegID,gID=MysqL,file_mode=0664,dir_mode=0775 -v5561: libmount: INIT: library deBUG mask: 0xffff5561: libmount: INIT: library version: 2.23.05561: libmount: INIT: feature: selinux5561: libmount: INIT: feature: deBUG5561: libmount: INIT: feature: assert5561: libmount: CXT: [0x7ff506842050]: ----> allocate5561: libmount: UTILS: mtab: /etc/mtab5561: libmount: UTILS: /etc/mtab: irregular/non-writable5561: libmount: UTILS: utab: /run/mount/utab5561: libmount: CXT: [0x7ff506842050]: enabling flag 00105561: libmount: CXT: [0x7ff506842050]: mount: preparing5561: libmount: CXT: [0x7ff506842050]: use default optmode5561: libmount: CXT: [0x7ff506842050]: OPTSMODE: ignore=0,append=0,prepend=1,replace=0,force=0,fstab=1,mtab=15561: libmount: CXT: [0x7ff506842050]: fstab not required -- skip5561: libmount: CXT: [0x7ff506842050]: merging mount flags5561: libmount: CXT: [0x7ff506842050]: final flags: VFS=00000000 user=000000005561: libmount: CXT: [0x7ff506842050]: mount: evaluating permissions5561: libmount: CXT: [0x7ff506842050]: mount: fixing optstr5561: libmount: CXT: [0x7ff506842050]: mount: fixing vfs optstr5561: libmount: CXT: applying 0x00000000 flags to '(null)'5561: libmount: CXT: new optstr 'rw'5561: libmount: CXT: [0x7ff506842050]: mount: fixing user optstr5561: libmount: CXT: applying 0x00000000 flags to '(null)'5561: libmount: CXT: new optstr '(null)'5561: libmount: CXT: fixing uID5561: libmount: CXT: fixing gID5561: libmount: UTILS: cannot convert 'MysqL' groupname to GID5561: libmount: CXT: [0x7ff506842050]: fixed options [rc=-34]: vfs: 'rw' fs: 'credentials=/etc/samba/fileserver.password,uID=27,dir_mode=0775' user: '(null)',optstr: 'credentials=/etc/samba/fileserver.password,dir_mode=0775'5561: libmount: CXT: [0x7ff506842050]: mount: preparing Failedmount: Failed to parse mount options: Numerical result out of range5561: libmount: CXT: [0x7ff506842050]: <---- reset [status=0] ---->5561: libmount: CXT: [0x7ff506842050]: tabfiler Disabled5561: libmount: CXT: [0x7ff506842050]: <---- free
MysqL组存在:
# getent group MysqLMysqL:x:27:# grep MysqL /etc/groupMysqL:x:27:# ID MysqLuID=27(MysqL) gID=27(MysqL) groups=27(MysqL)# ls -lZ /etc/group /etc/passwd-rw-r--r--. root root system_u:object_r:passwd_file_t:s0 /etc/group-rw-r--r--. root root system_u:object_r:passwd_file_t:s0 /etc/passwd
如果发现有趣的是直接使用mount.cifs它正在工作:
# mount.cifs //fileserver/db-MysqL /mnt/MysqLBackups --verbose -o credentials=/etc/samba/fileserver.password,dir_mode=0775Credential formatted incorrectly: (null)domain=fileservermount.cifs kernel mount options: ip=10.1.2.20,unc=\fileserver\db-MysqL,dir_mode=0775,gID=27,user=svc_linux,domain=fileserver,pass=********# grep /mnt/MysqLBackups /proc/mounts//fileserver/db-MysqL /mnt/MysqLBackups cifs rw,relatime,vers=1.0,cache=strict,username=svc_linux,addr=10.1.2.20,nounix,serverino,rsize=61440,wsize=65536,actimeo=1 0 0
它发生在:
# uname -rvpio3.10.0-327.36.1.el7.x86_64 #1 SMP Sun Sep 18 13:04:29 UTC 2016 x86_64 x86_64 GNU/linux
同样的问题:
# uname -rvpio3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 GNU/linux
mount和mount.cifs是RHEL7的最新版本:
# rpm -q util-linux cifs-utilsutil-linux-2.23.2-26.el7_2.3.x86_64cifs-utils-6.2-7.el7.x86_64
似乎getgrnam_r(3)调用失败了.
编辑1:
我想使用用户名和组名而不是UID GID.我知道使用数字ID我可以解决问题.我知道删除gID = MysqL它会起作用.为什么用户mount能够找到UID,但是对于grup,它无法找到GID?
编辑2:
这段代码似乎抛出了这个错误:
https://github.com/karelzak/util-linux/blob/master/libmount/src/utils.c#L703
所以我尝试使用以下代码重现,但调用成功.这对我来说很奇怪.对不起邋C的C代码,我不是程序员.
#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <sys/types.h>#include <grp.h>#define ul_GETPW_BUFSIZ (16 * 1024)int main(voID){ int rc = -1; struct group grp; struct group *gr; char *buf; int _gID=10; gID_t *gID = (gID_t *)& _gID; char *groupname = "MysqL"; if (!groupname || !gID) return -EINVAL; buf = malloc(ul_GETPW_BUFSIZ); if (!buf) return -ENOMEM; if (!getgrnam_r(groupname,&grp,buf,ul_GETPW_BUFSIZ,&gr) && gr) { *gID= gr->gr_gID; printf("gID=%i\n",*gID); rc = 0; } else { printf("cannot convert '%s' groupname to GID\n",groupname); rc = errno ? -errno : -EINVAL; } free(buf); return rc;}// vim:ts=4:sts=4:sw=4:et:
没有报告错误:
# gcc -Wall -W test.c# ./a.outgID=27#
编辑3:
如果我尝试gID = dbus它正在工作:
# egrep 'MysqL|dbus' /etc/passwd /etc/shadow /etc/group /etc/gshadow/etc/passwd:dbus:x:81:81:System message bus:/:/sbin/nologin/etc/passwd:MysqL:x:27:27:Percona Server:/var/lib/MysqL:/bin/false/etc/shadow:dbus:!!:17086::::::/etc/shadow:MysqL:!!:17104::::::/etc/group:dbus:x:81:/etc/group:MysqL:x:27:/etc/gshadow:dbus:!::/etc/gshadow:MysqL:!::# libmOUNT_DEBUG=0xffff mount //fileserver/db-MysqL /mnt/MysqLBackups -t cifs -o credentials=/etc/samba/fileserver.password,gID=dbsu10777: libmount: INIT: library deBUG mask: 0xffff10777: libmount: INIT: library version: 2.23.010777: libmount: INIT: feature: selinux10777: libmount: INIT: feature: deBUG10777: libmount: INIT: feature: assert10777: libmount: CXT: [0x7f687bf74050]: ----> allocate10777: libmount: UTILS: mtab: /etc/mtab10777: libmount: UTILS: /etc/mtab: irregular/non-writable10777: libmount: UTILS: utab: /run/mount/utab10777: libmount: CXT: [0x7f687bf74050]: mount: preparing10777: libmount: CXT: [0x7f687bf74050]: use default optmode10777: libmount: CXT: [0x7f687bf74050]: OPTSMODE: ignore=0,mtab=110777: libmount: CXT: [0x7f687bf74050]: fstab not required -- skip10777: libmount: CXT: [0x7f687bf74050]: merging mount flags10777: libmount: CXT: [0x7f687bf74050]: final flags: VFS=00000000 user=0000000010777: libmount: CXT: [0x7f687bf74050]: mount: evaluating permissions10777: libmount: CXT: [0x7f687bf74050]: mount: fixing optstr10777: libmount: CXT: [0x7f687bf74050]: mount: fixing vfs optstr10777: libmount: CXT: applying 0x00000000 flags to '(null)'10777: libmount: CXT: new optstr 'rw'10777: libmount: CXT: [0x7f687bf74050]: mount: fixing user optstr10777: libmount: CXT: applying 0x00000000 flags to '(null)'10777: libmount: CXT: new optstr '(null)'10777: libmount: CXT: fixing uID10777: libmount: CXT: fixing gID10777: libmount: UTILS: cannot convert 'dbsu' groupname to GID10777: libmount: CXT: [0x7f687bf74050]: fixed options [rc=-34]: vfs: 'rw' fs: 'credentials=/etc/samba/fileserver.password,gID=dbsu' user: '(null)',gID=dbsu'10777: libmount: CXT: [0x7f687bf74050]: mount: preparing Failedmount: Failed to parse mount options: Numerical result out of range10777: libmount: CXT: [0x7f687bf74050]: <---- reset [status=0] ---->10777: libmount: CXT: [0x7f687bf74050]: tabfiler Disabled10777: libmount: CXT: [0x7f687bf74050]: <---- free解决方法 启用CIFS的系统无法将组名MysqL映射到GID 27,而是尝试将MysqL解析为数字GID值.这显然会超出范围,因为它是一个字符串而不是一个int.到目前为止,我还不清楚这是否是主机或客户端的失败.
如果化妆品组和用户名MysqL和附带的ID不在两台服务器上,则通过groupmod命令或编辑/ etc / group文件进行修复.如果所需的GID和UID在两台主机上相同,或者是固定的默认值(如MysqL,27为),则按编号指定GUID和UID,而不是按名称指定.这有点像kludge,但它可能会奏效.
有必要进一步调查为什么它没有将名称映射到ID的编号.自mount.cifs 1.10以来,我们已经能够使用装饰用户名和组名.再说一次,如果你没有在这个卷的平常挂载过程中调用mount.cifs帮助器,你可能永远不能使用化妆品名称,除非它在你正在使用的任何帮助器中显式实现.
总结以上是内存溢出为你收集整理的linux – 挂载CIFS共享失败:数值结果超出范围全部内容,希望文章能够帮你解决linux – 挂载CIFS共享失败:数值结果超出范围所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)