Ubuntu – Can’t mount networked Windows external drive via cifs

16.04cifsmountnetworkingsamba

Ever since I did the Windows 10 Anniversary Update, I've been having issues mounting an external drive plugged into a Windows machine on my network.

My fstab:

//bowser.local/Fire  /media/Fire  cifs  auto,_netdev,comment=systemd.automount,sec=ntlm,uid=cameron,credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0755,dir_mode=0755,defaults  0  0

I get the error:

mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I've searched around and tried a bunch of different options (my options didn't start that long!).

The thing is, it works fine with other shares. I tried sharing Desktop from the C drive on Windows just to test and it works fine, so I know it's not bad credentials or that it can't find the PC on the network or something… it appears to be something specific about the external drive? Well, drives… I have two I'm trying to mount and both have this same issue.

If I try the GUI and use "Connect to Server" in Nautilus to comment to smb://bowser.local, the Fire share shows up there, but if I click on it, I get the error:

Unhandled error message: Failed to mount Windows share: Invalid argument

The Desktop share works fine.

Don't know if it helps, but on my Mac, going to Shared > bowser > Fire in Finder works fine, too.

As mentioned, using Windows 10 with the Anniversary Update:

  • Windows 10 Enterprise 14393
  • Ubuntu 16.04 Desktop
  • Mac OS X 10.11.6

Update: Thanks to emk2203's comment, I got a new error trying to connect directly with smbclient: tree connect failed: NT_STATUS_INSUFF_SERVER_RESOURCES.

This led to more evidence that it was Windows' fault and a friend suggested I looked in logs. In the Windows logs, I found this error:

The server's configuration parameter "irpstacksize" is too small for the server to use a local device. Please increase the value of this parameter.

Best Answer

Thanks to the irpstacksize error I discovered in the Windows logs, I was able to find an article that talked about how to increase that value (putting the gist of it below in case the link breaks).

It's a registry entry (edit via regedit) (create it if it doesn't exist--it did not exist for me):

HKEY_LOCAL_MACHINE
 \SYSTEM
  \CurrentControlSet
   \Services
    \LanmanServer
     \Parameters
IRPStackSize DWORD 0x0000000f (15)

IRPStackSize is case sensitive. Decimal 15 is the default. They say to increase it to 5 until (50 is the max?). I couldn't find any evidence that increasing it to 50 would have any real negative consequences (and most people seemed to believe it won't), so after it still wasn't working at 33, I jumped to 50 and it worked!

In between each change you need to restart Services > Server for the change to take effect.

Related Question