LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 12-07-2009, 02:22 PM   #1
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Rep: Reputation: 0
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.
 
Old 12-07-2009, 02:27 PM   #2
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 0
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.
 
Old 12-07-2009, 03:36 PM   #3
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Have you checked this: http://www.linuxquestions.org/questi...-works-456897/
 
Old 12-07-2009, 03:39 PM   #4
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Everywhere is suggested to use IP instead of host name.
 
Old 12-08-2009, 01:48 PM   #5
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 0
@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?
 
Old 12-08-2009, 01:57 PM   #6
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 0
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).
 
Old 12-08-2009, 02:38 PM   #7
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
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"
 
Old 12-08-2009, 02:49 PM   #8
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
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/

Last edited by nimnull22; 12-08-2009 at 02:51 PM.
 
Old 12-08-2009, 04:22 PM   #9
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 0
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"?
 
Old 12-08-2009, 04:34 PM   #10
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Have you looked at it:

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

Last edited by nimnull22; 12-08-2009 at 04:39 PM.
 
Old 12-08-2009, 05:03 PM   #11
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
And also check if Wireless Multimedia Extensions (WME, Wi-Fi Multimedia (WMM)) is enabled, if so try to disable it in your router.
 
Old 12-08-2009, 05:58 PM   #12
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 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?
 
Old 12-08-2009, 07:32 PM   #13
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Try every thing, it could be just a bug or software error.
 
Old 12-08-2009, 07:57 PM   #14
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
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.
 
Old 08-16-2010, 10:51 AM   #15
hasi
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied CADIT Linux - Newbie 6 11-20-2009 02:48 PM
Can delete files in one smb share but not in another - using cifs.mount in active dir Lordandmaker Linux - Server 4 02-12-2009 05:34 AM
can access a share through smbclient but not though mount.cifs seuchato Linux - Server 2 10-13-2007 09:24 AM


All times are GMT -5. The time now is 02:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration