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