How to Resolve “mount error(12): Cannot allocate memory” on a Windows Share

If you mount a Windows 7 share using Samba/CIFS you may run into “mount error(12): Cannot allocate memory” if you are using very large files on the Windows machine. Looks like in certain situations Windows needs to be told to run as a file server and to expect large files. You can read more details at Large Files are locking up Windows 7 32 bit and 64 bit, but the solution is to make two registry edits and then restart a service:

Set “HKLMSYSTEMCurrentControlSetControlSession ManagerMemory ManagementLargeSystemCache” to “1″.
Set “HKLMSYSTEMCurrentControlSetServicesLanmanServerParametersSize” to “3″.
Restart the “server” service.
Once you have done that you should be able to mount the share using a command

like “sudo mount -a” or just reboot the Linux machine.

ref: http://jlcoady.net/windows/how-to-resolve-mount-error12-cannot-allocate-memory-windows-share

Problems using multiples interfaces. Likely a route issue….

Many times when i setup multiple nic’s on the same machine using LAN (eth0) and WAN (eth1) ip’s. The reason is likely due to a Gateway not being setup correctly in your nic settings. In this case my WAN nic is bound to eth0 and would not ping.

[root@cn2 ~]# ping nike.com
PING nike.com (66.54.56.30) 56(84) bytes of data.
From cn2 (192.168.1.2) icmp_seq=2 Destination Host Unreachable
From cn2 (192.168.1.2) icmp_seq=3 Destination Host Unreachable
From cn2 (192.168.1.2) icmp_seq=4 Destination Host Unreachable
From cn2 (192.168.1.2) icmp_seq=5 Destination Host Unreachable

See current routes…

[root@cn2 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
10.200.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth0

Add new route on correct device.

[root@cn2 ~]# route add default gw 10.200.1.2 netmask 0.0.0.0 dev eth1
[root@cn2 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
10.200.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth0

Delete old route.

[root@cn2 ~]# route del default dev eth0
[root@cn2 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
10.200.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth1

Done!