Samba – CIFS error -512 on a mount

alfrescocifslinux-kernelsamba

So we have Alfresco running at work and I like to have our repository mounted via CIFS:

mount /mnt/alfresco/ -v
mount.cifs kernel mount options: ip=192.168.8.91,unc=\\alfresco.example.com\alfresco,dir_mode=0755,nounix,sec=ntlm,uid=1001,gid=1000,user=me,pass=********

The first time this runs, it works fine. I can use it for a few hours, but then it completely locks up. If I try to ls /mnt/alfresco, it just hangs for several minutes. The only thing I can do is umount -lf /mnt/alfresco But then, if I try to mount it again, it just hangs. When I do a Ctrl+C, I see the following:

[86897.151480] CIFS VFS: cifs_mount failed w/return code = -512
[86897.155297] CIFS VFS: No task to wake, unknown frame received! NumMids 6
[86897.155302] Received Data is: : dump of 37 bytes of data at 0xffff88023366fb80
[86897.155307]  23000000 424d53ff 00000da4 c00188c0 . . . # \xffffffff S M B \xffffffa4 . . . \xffffffc0 . . \xffffffc0
[86897.155311]  00000000 00000000 00000000 31c60001 . . . . . . . . . . . . . . \xffffffc6 1
[86897.155313]  02260001 08000000 . . & . .

My /etc/fstab line looks like the following:

//example.com/alfresco /mnt/alfresco cifs user=me,uid=me,gid=me,credentials=/home/me/.smbcredentials,dir_mode=0755,nounix,auto,sec=ntlm 0 0

I'm on kernel Linux-3.10.25-gentoo, but I had the same problem with 3.10.8-gentoo. If I reboot my computer, I can remount the share and use it for a couple of hours again. Is there anyway I can get more debugging information on what's going on here?

Best Answer

You can use the --verbose cifs mounting option when using mount.cifs. For example:

mount.cifs //winserver/folder /mnt/foo --verbose -o rw,-dom=addomain,dir_mode=0775,file_mode=0664,soft

or if you are using an fstab entry you can try:

echo 7 > /proc/fs/cifs/cifsFYI

Then type:

dmesg

or simply check /var/log/messages or /var/log/syslog

and to disabled it with:

echo 0 > /proc/fs/cifs/cifsFYI

This is per this link: https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting