I am trying to access a shared drive on a Windows server from a Raspberry Pi 3.

My temporary mount works - sudo mount // /home/pi/Files -o username=Myname,password=Mypassword - I can browse the folder and see all the files.

If I add a line to /etc/fstab - // /home/pi/Files cifs username=Myname,password=Mypassword,iocharset-utf8,sec=ntlm,users 0 0

I get a Mount Error(22) but I cannot see what is wrong.

If anyone can point me in the right direction that would be great.


After a little trial and error the following appears to work

// /home/pi/Files cifs username=Myname,password=Mypassword,users

  • Vote your answer as an answer to your question.
    – MatsK
    Aug 9 '21 at 19:51

This may be the same issue I've had in the past. It's poorly documented, and IMHO buggy. I wasted a week on this ~ 3 years ago - including the bug reports submitted to Raspberry Pi, and then to Debian which were ignored.

Anyway - in my case the issue was unique to the software that handles SMB/CIFS mounts (network drives typically) from fstab. As it turns out, there are several versions of SMB; you can see a list of these in man mount.cifs. And - at least in my case - getting the correct version was crucial to a successful mount (consummation? :).

It's still painful to recall (mostly due to how my bug report was handled), and AFAIK it's still buggy. The point of this post is only my effort to raise awareness that when it comes to SMB mounts - version matters.

Here's the fstab specification that I'm still using; note the placement of the vers=xx option.

//NetgearNAS-3/backup /mnt/NetgearNAS-3/backup cifs rw,username=seamus,password=XXXXXXXX,nofail,vers=1.0 0 0

You may be wondering how to determine the SMB protocol version (I did). On a Windows machine, that is said to be available from the "Power Shell" using the command: Get-SmbConnection. On a Linux server (Samba), this should work: sudo smbstatus. If you're using a network appliance (as I am) as a SMB/CIFS file server, you may have to resort to trial-and-error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.