Monday, October 21, 2013

Mounting a Windows Share from Windows 7 in Linux: Mount Error(12): Cannot Allocate Memory

I wanted to mount a network share from a Windows 7 host in Fedora Linux. I encountered a problem below,

[user@fedora]$ sudo mount -t cifs -o username=my-windows-7-username,uid=my-linux-user-name,rw  //windows7host/path-to-network-share /directory-to-mount
[sudo] password for user:
Password for my-windows-7-username@//windows7host/path-to-networshare: ********
mount error(12): Cannot allocate memory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

A few web searches produced quite a few hits. Most suggest to change "IRPStackSiz"; however, that is not for Windows 7 host. The correct answer is from the "archlinux" site that has a page,
which explicitly states "Note: Googling will reveal another tweak recommending users to add a key modifying the "IRPStackSize" size. This is incorrect for fixing this issue under Windows 7. Do not attempt it." Kudos to that!

For the impatient, run the following as administrator in Windows 7,
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 1 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "Size" /t REG_DWORD /d 3 /f
Then reboot the Windows 7 host.

No comments:

Post a Comment