Do you have the following situation:
- You’ve got a share on Windows (XP, Vista, 7) that you’re trying to access from a Linux system, in this case Ubuntu.
- Mounted through /etc/fstab or directly through the command line.
- Initially, it works great, but then loses the mountpoint – you’ll go to, say, /mnt/server/mountpoint but there are no directory contents. “mount” shows the path as still mounted.
- umount’ing the directory and then trying to remount it provides this gem of a message:
mount error(12): Cannot allocate memory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Of course, since you’re probably a reasonable system administrator, you go and check the memory allotment. top looks fine and nothing else on the system is complaining.
The solution, kindly provided by Alan LaMielle’s blog, gives a registry fix on the Windows side of things. In case that link ever breaks, here is the summary of what needs to happen on the Windows system:
- In HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management, set the LargeSystemCache key to 1 (hex).
- In HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters, set the Size key to 3 (hex).’
- Restart the “Server” service and its dependencies (on my Windows 7 box, these were “Computer Browser” and “Homegroup Listener”, and I had to restart the service twice for the dependencies to also come back up.) Alternatively you can just restart the Windows system as you’re probably due for a large set of updates anyway.
Then re-run the mount command (for entries defined in /etc/fstab, use sudo mount -a) and your shares should be restored to their former glory.
Worked perfectly for Windows 7 and ubuntu 12.04. Thanks!
Thanks!!
It worked like a charm. It fixed a problem I had been searching a solution for for a long time.
Thanks a lot!
I was receiving this error, and wondering what I could did wrong…
Very helpfull
Thank you very much…I will post about this later on the blog, but you just saved me hours and much *face*!!!
Works perfectly!
Thanks fixed my problem too! Saved me hours of figuring this out. Gotta love Windows!
Thanks a ton, this has been tormenting me for years. You da’man!!!!
I knew intuitively that this had to be a bug, not surprised it was Windows’ problem, not Linux. Worked like a champ for me – Win 7, FC 16 running as a guest under VM Ware player. Thanks, chap.
Perfect solution! Thanks!
What would you do if you have no access to the Windows side?
I would never have resolved this in a trillion years without your help. Many thanks!
Wow very helpful thanks. No way I woulda figured this out on my own.
Thanks for your help. Worked for me CentOS 6.4 to Win7 Enterprise
Worked great for Windows 7 and Centos 6.4 …..
Did I mention hate Windows ……..
Worked for me. LOVED the fact I only had to restart a service. Will you take over microsoft please?
One typically views suggested “fixes” with a jaundiced eye … this one worked and worked immediately. Many thanks!
Our IT department is looking for good people …