Mounts SMB/CIFS shares with Linux
It’s common practice to mount Windows file shares on Linux using the SMB (Samba) implementation on Linux. the command is fairly straight forward.
# Install the required libraries if you haven't done that yet sudo apt update sudo apt install cifs-utils #Next mount the folder you want sudo mount -t cifs -o username=user_name //server_name_or_ip/share_name /mnt/share_name
The command above would:
- mount a server with the server_name or ip in the //server_name/share_name
- to a local /mnt/share_name folder
- so once the mount is complete you can access the shares contents by accessing the /mnt/share_name folder locally.
There are all sorts of options using this command , and when the share is created on the server , things like file access and permissions can be set. You can find a more complete description here on how to access and setup windows shares in Linux
The issue with Samba/Cifs mounts (on Synology and other SMB servers) error 95
Apparently there has been a change to the SMB (Samba) protocol . SMB1 was the default, which may not be sufficient because of upgraded security requirement tof SMB2 . So try setting the version to SMB2 with ver=2.0
Or ver=3.0
, more specifically in my case, Synology updated their SMB server and increased the security , and for those of us that do not keep up to date with the changes may find that our once working mount commands, are not failing with a message such as ..
mount error(95): Operation not supported
This obscure message with its “operation not supported” doesn’t shed light on the true cause of the issue. Online documentation is I was able to find online such as this Samba.Org mount.cifs document doesn’t really help much either. The trick is you can try dmesg
to give you a more precise message.
mount error(95): Operation not supported Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
You can try dmesg
to give you a more precise message
CIFS: VFS: Use of the less secure dialect ver=1.0 is not
recommended unless required for access to very old servers
CIFS: VFS: cifs_mount failed w/return code = -95
So if you haven’t a version set in your configuration (Your connection string) it will assume your client uses SMB1 as default, which may not be sufficient if the server you’re trying to connect to has upgraded there requirement to SMB2 . So try setting the version to SMB2 with ver=2.0
to see if it resolves the issue, as it did in my case,
So my Old error connection string
sudo mount -t cifs -o username=user_name //server_name/share_name /mnt/share_name
Revised working connection string. use vers=2.0
as part of your -0 witch attributes.
sudo mount -t cifs -o vers=2.0,username=user_name,password=password //server_name/share_name /mnt/share_name
Anyways this was just a quick post as it was a pain in the ass as to why all of a sudden my mounts to my Synology began failing.. hope it helps.
If you found this post useful , leave a comment below!
Awesome, was tearing my hair out
A small detail, the option is vers= and not ver=. It helped me a lot, thank you.
Obrigado! , I have revised the code change to show ver. Out of curiosity on what system did you need to make this change was it a nas drive?
yes, ver was giving me error, changed to vers according to your comment and it worked
Brilliant, this helped with my WD Cloud NAS too after I updated the firmware!
Thanks, I finally got ride of my 95 Error !
If the error message was a little more specific, I maybe could have found the problem much quicker.
Many Thanks. – Eldonb
Thanks!
Your welcome!
Is there a similar fix if via NFS?
Not sure, this error is pretty specific to SMB
there a typo
vers=2.0
sudo mount -t cifs -o vers=2.0,username=user_name,password=password //server_name/share_name /mnt/share_name
YMMD 🙂 Thanks from Germany for this very helpful article.
Your’e welcome glad I could help
Niceeeee! I have only mistake, I put a space between Vers=2.0 and username, when I erase this space, Vuolaaaa! Thanks a lot!
TY so much from Denmark! 🙂
TY from Germany!
Yes! Thanks much.
valeuuuuuuuu karaiooo 😀
A useful fix, but only until the next restart.
You can make the mounts stay upon a reboot but it involves editing the /etc/fstab file which is dangerous because if you screw up your system doesnt boot without a rescue /live cd/usb, read here on how to do that..
https://askubuntu.com/questions/164926/how-to-make-partitions-mount-at-startup
thanks a lot, you saved my day!
Glad I could help, yeah when I discovered this myself, I was like finally! figured I’d pass it along
Can you add information about how to mount vers=2.0 or 3.0 using fstab. Where the error 95 exists also.
It can be helpful for automatic mounting this folder.
“`//server_name/share_name /mnt/share_name cifs servers=3.0,credentials=/etc/samba/share.cred,uid=1000,gid=1000,iocharset=utf8 0 0“`
Denis, I think I found what you’re looking for in this stack overflow:
https://askubuntu.com/questions/922682/specify-smb-3-0-in-etc-fstab. probably same post you referenced
Here is my working syntax for mounting a CIFS 3 hosted on FreeNAS to Ubuntu:
//192.168.1.1/Media /mnt/Media cifs credentials=/home/me/.smbcred,uid=100,gid=1000,vers=3.0,iocharset=utf8 0 0
Edit based on your local environment. -o is not needed in /etc/fstab
I was having the same issue “failed: Operation not supported (95)” when mounting my Windows 10 network share. I was using vers=3.0 until I went to the official cifs website (cifs.com/) and noticed that the vers should be changed from vers=3.0 to vers=3.1.1.
Here is my new fstab statement:
“//192.168.25.36/8TBWin /run/media/chris/hpelitedesktop cifs credentials=/root/.smbcred,vers=3.1.1,iocharset=utf8,u
id=1000,gid=1000 0 0
”
I am not filling up my cron job logs with “failed: Operation not supported (95)” anymore!
Thanks a lot. That error 95 was driving me mad. I knew about the vers= option, but erroneously was attempting a vers=3.0 whereas the remote Synology was only expecting vers=2.0 (although it’s a recent DSM version).
After several days of frustrating battle… Now it works.
Thanks a lot!
Awesome saved my time
Simple and Sweet. Thank you.
Thanks!!! Helpful!
Hi
I have an OSError [Errno 95] Operation not supported error. Could someone help me with this? I’ve been stuck on this for a week and need to get on with my work.
If you could dumb down the answer by about 100 IQ points, I would surely appreciate it.
Looking at all the responses and not having a clue what you are talking about gives me hope that our earth is in good hands with a lot of smart people out there.
OsError 95? This particular error is related to the Samba network protocolyou’re may be different, you need to provide a lot more technical details before I can suggest some options
Trying to get the mount to work when not knowing about the SMB version change is really discouraging. Like when you are feeling pretty good about youself and then try to go order somebody else’s dog around . . .
THANKS!!!
I agree, these sorts of background changes, happen all over the place in the networking stack, its even worse for cloud services..
Thank you! This resolved it for me too (Ubuntu 18.04 connecting to SMB)
This also helped my case! Thanks for the post.
Unfortunately this didn’t help me. Just 1 day ago this problem started for me, I’m now getting mount error 95 and if I check dmesg I see this:
[21018.339470] CIFS: Attempting to mount //10.10.20.232/Folders
[21018.345205] CIFS: VFS: parse_reparse_point: unhandled reparse tag: 0x9000e01a
[21018.345210] CIFS: VFS: cifs_read_super: get root inode failed
Everything worked fine and I don’t believe we’ve done any changes. I can connect successfully on another ubuntu computer with the same version 22.04 without any problems, so don’t know why this started all of a sudden.
After try this solution i got this error:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
same error trying:
mount -t cifs -o vers=2.0
or
mount -t cifs -o ver=2.0
But if i try:
mount -t cifs -o vers=1.0
or
mount -t cifs -o ver=1.0
I got:
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Thank you for this information. vers=2.0 was required to mount my NAS too. But after recognizing big problems with copying 200 GB to the NAS (Linux slows down until it stops) I found a better solution for my NAS. I changed SMB protocol from SMB2 to SMB3 in my NAS and now vers=2.0 is no longer required an there is no slow down any more.