LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   can't mount CIFS share, but smbclient and smb:// (KIO) works (http://www.linuxquestions.org/questions/linux-networking-3/cant-mount-cifs-share-but-smbclient-and-smb-kio-works-774039/)

hasi 12-07-2009 02:22 PM

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.

hasi 12-07-2009 02:27 PM

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 12-07-2009 03:36 PM

Have you checked this: http://www.linuxquestions.org/questi...-works-456897/

nimnull22 12-07-2009 03:39 PM

Everywhere is suggested to use IP instead of host name.

hasi 12-08-2009 01:48 PM

@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?

hasi 12-08-2009 01:57 PM

Btw, this is what syslog says:

Code:

Dec  7 14:49:26 ******** kernel: [23211.836908]  CIFS VFS: Send error in SessSetup = -5
Dec  7 14:49:26 ******** kernel: [23211.836926]  CIFS VFS: cifs_mount failed w/return code = -5

(the asterisks are my hostname).

nimnull22 12-08-2009 02:38 PM

have you tried to use mount.cifs, take a look on its man page as well. May be it helps.

And check this also:
"Did you already try to explicitly disable
the Linux extensions? Run

echo "0" > /proc/fs/cifs/LinuxExtensionsEnabled"

nimnull22 12-08-2009 02:49 PM

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

Take a look:

http://www.linuxquestions.org/questi...t-fail-469006/

hasi 12-08-2009 04:22 PM

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
Code:

sudo mount.cifs //***.***.***.***/nanomat$/ /media/nanomat/ -o credentials=/home/hasi/.encfs/nanomat
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"?

nimnull22 12-08-2009 04:34 PM

Have you looked at it:

http://www.linuxquestions.org/questi...t-fail-469006/

nimnull22 12-08-2009 05:03 PM

And also check if Wireless Multimedia Extensions (WME, Wi-Fi Multimedia (WMM)) is enabled, if so try to disable it in your router.

hasi 12-08-2009 05:58 PM

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?

nimnull22 12-08-2009 07:32 PM

Try every thing, it could be just a bug or software error.

nimnull22 12-08-2009 07:57 PM

I also suggest to write to Ubuntu/Kubuntu forum, kernel 2.6.31-16 is new, may be they forgot to choose something when compiled it. Who knows.

hasi 08-16-2010 10:51 AM

mount.cifs is broken!!!
 
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?

Also, I am not the only one experiencing this problem, as I found more similar reports:
http://lists.samba.org/archive/linux...er/002469.html
https://forum.openwrt.org/viewtopic.php?pid=34729
http://linux.derkeiler.com/Mailing-L.../msg00655.html
http://old.nabble.com/mount-error-5-...d18880592.html
http://osdir.com/ml/file-systems.cif.../msg00047.html
http://software.itags.org/samba/182471/
However, judging by the total volume of information on this problem, it does not seem to be very common.


All times are GMT -5. The time now is 09:47 PM.