[SOLVED] can't mount CIFS share, but smbclient and smb:// (KIO) works
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
can't mount CIFS share, but smbclient and smb:// (KIO) works
I am about to go crazy. I need to access a samba share at my university. While I have no problems accessing it using smbclient or the smb:// KIO slave from KDE, I just can't get it mounted using the "mount" command. I played around with options and googled for hours. The only threads I can find with respect to this topic go dead.
All I get from "mount" is the following error message:
Code:
mount error(5): Input/output error
The logs in /var/log, mostly don't contain any hints. Only syslog shows something when I grep it for CIFS. However, it's useless, as only the error number (5) is repeated.
Any help is greatly appreciated.
Let me mention a few more details: this is kubuntu 9.10 (karmic, 32bit). The kernel is 2.6.31-16. Turning my firewall (guarddog) off did not help either. To access the server, I tried both the IP and the hostname (netbios). To specify the credentials, I tried both a file as well as directly putting them into the options. No avail.
@nimnull22:
Thanks very much for your suggestions. I had already tried using the server IP directly, and that did not help. I was also aware of this other thread you mentioned, but there was not really any useful information there. One suggestion was referring to using IPs, another vague comment (going back to 2006) is that it was related to an old version (2.x) of the samba servers. I had already contacted our sysadmins to find out what samba version they are using -- no response yet.
What's strange is that smbclient and the smb:// KIO slave are performing very well, but cifs does not work. Let me show you what I did:
Code:
sudo mount -v -t cifs -o credentials=/home/hasi/.encfs/nanomat //***.***.***.***/nanomat$/ /media/nanomat/
The above code gives me the error (the asterisks represent the IP address given in decimal format). Smbclient, on the other hand does not have any problems:
Code:
smbclient -A /home/hasi/.encfs/nanomat //***.***.***.***/nanomat$/
With this code, I get logged in within less than a second. As you see, I am even using the same credentials file, etc. So I have really no idea what's going on. Also how do you debug something like this if you don't have any meaningful error message?
Also
You might try "echo 1 >/proc/fs/cifs/cifsFYI" to print out more debug information to the system error log. Reference: /usr/src/linux/fs/cifs/README
Thanks again for your quick reply.
I echoed the flags as you suggested, to no avail. (I also made sure that the 0 and 1 were successfully written using the "cat" command for the named destinations.)
I also tried
which did not work (my impression was that "mount.cifs" is just some sort of alias for "mount -t cifs").
However, enabling the extended debug messages gives some more detail:
Code:
Dec 8 16:49:07 ******** kernel: [40356.681331] /build/buildd/linux-2.6.31/fs/cifs/cifsfs.c: Devname: //***.***.***.***/nanomat$/ flags: 64
Dec 8 16:49:07 ******** kernel: [40356.681345] /build/buildd/linux-2.6.31/fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 14 with uid: 0
Dec 8 16:49:07 ******** kernel: [40356.681357] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Domain name set
Dec 8 16:49:07 ******** kernel: [40356.681369] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Username: *********
Dec 8 16:49:07 ******** kernel: [40356.681377] /build/buildd/linux-2.6.31/fs/cifs/connect.c: UNC: \\***.***.***.***\nanomat$ ip: ***.***.***.***
Dec 8 16:49:07 ******** kernel: [40356.681394] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Socket created
Dec 8 16:49:07 ******** kernel: [40356.683465] /build/buildd/linux-2.6.31/fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x6d6
Dec 8 16:49:07 ******** kernel: [40356.683587] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Existing smb sess not found
Dec 8 16:49:07 ******** kernel: [40356.683604] /build/buildd/linux-2.6.31/fs/cifs/cifssmb.c: secFlags 0x7
Dec 8 16:49:07 ******** kernel: [40356.683614] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Demultiplex PID: 31825
Dec 8 16:49:07 ******** kernel: [40356.683621] /build/buildd/linux-2.6.31/fs/cifs/transport.c: For smb_command 114
Dec 8 16:49:07 ******** kernel: [40356.683628] /build/buildd/linux-2.6.31/fs/cifs/transport.c: Sending smb: total_len 82
Dec 8 16:49:07 ******** kernel: [40356.689271] /build/buildd/linux-2.6.31/fs/cifs/connect.c: rfc1002 length 0x6b
Dec 8 16:49:07 ******** kernel: [40356.689308] /build/buildd/linux-2.6.31/fs/cifs/cifssmb.c: Dialect: 2
Dec 8 16:49:07 ******** kernel: [40356.689315] /build/buildd/linux-2.6.31/fs/cifs/cifssmb.c: negprot rc 0
Dec 8 16:49:07 ******** kernel: [40356.689321] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Security Mode: 0x3 Capabilities: 0xb3fd TimeAdjust: 0
Dec 8 16:49:07 ******** kernel: [40356.689328] /build/buildd/linux-2.6.31/fs/cifs/sess.c: sess setup type 2
Dec 8 16:49:07 ******** kernel: [40356.689470] /build/buildd/linux-2.6.31/fs/cifs/transport.c: For smb_command 115
Dec 8 16:49:07 ******** kernel: [40356.689475] /build/buildd/linux-2.6.31/fs/cifs/transport.c: Sending smb: total_len 264
Dec 8 16:49:07 ******** kernel: [40356.690644] /build/buildd/linux-2.6.31/fs/cifs/connect.c: rfc1002 length 0x27
Dec 8 16:49:07 ******** kernel: [40356.690658] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Reconnect after unexpected peek error 0
Dec 8 16:49:07 ******** kernel: [40356.690664] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Reconnecting tcp session
Dec 8 16:49:07 ******** kernel: [40356.690670] /build/buildd/linux-2.6.31/fs/cifs/connect.c: State: 0x3 Flags: 0x0
Dec 8 16:49:07 ******** kernel: [40356.690690] /build/buildd/linux-2.6.31/fs/cifs/netmisc.c: Mapping smb error code 31 to POSIX err -5
Dec 8 16:49:07 ******** kernel: [40356.690697] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Post shutdown state: 0x3 Flags: 0x0
Dec 8 16:49:07 ******** kernel: [40356.690705] /build/buildd/linux-2.6.31/fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
Dec 8 16:49:07 ******** kernel: [40356.690711] /build/buildd/linux-2.6.31/fs/cifs/sess.c: ssetup rc from sendrecv2 is -5
Dec 8 16:49:07 ******** kernel: [40356.690718] /build/buildd/linux-2.6.31/fs/cifs/sess.c: ssetup freeing small buf e4f54380
Dec 8 16:49:07 ******** kernel: [40356.690723] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Socket created
Dec 8 16:49:07 ******** kernel: [40356.690730] CIFS VFS: Send error in SessSetup = -5
Dec 8 16:49:07 ******** kernel: [40356.690745] /build/buildd/linux-2.6.31/fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 14) rc = -5
Dec 8 16:49:07 ******** kernel: [40356.690752] CIFS VFS: cifs_mount failed w/return code = -5
Dec 8 16:49:07 ******** kernel: [40356.690771] /build/buildd/linux-2.6.31/fs/cifs/connect.c: Error -512 connecting to server via ipv4
~
--except I don't know what to do with it. What's the crucial part here? Googling for "smb error code 31" leads nowhere. Or is it the "unexpected peek error 0"?
I suppose your hint with respect to WME does not apply, as I am connected via ethernet (as a matter of fact now part of the same LAN than said Samba server).
I also removed the trailing line feed using the hex editor. No success. Would any of these steps you suggested require a reboot?
OK, my subject line is a little provocative, but more and more evidence is pointing into this direction. I am now on 2.6.32 (a version that's going to be supported for a longer while), and I still have the very same problem: I cannot mount a Windows share using mount.cifs. When I try to connect via smbclient (using the same credentials file), it works. Also, I can connect via the smb:/ KIO slave from KDE. So if mount.cifs is not broken, what else could it be? I did a little more research and found that SMB error code 31 translates into "NT_STATUS_ILLEGAL_CHARACTER". Does that mean anything to anybody?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.