-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update guide.en-ie: Linux CIFS Backup mount parameters #7291
base: develop
Are you sure you want to change the base?
Conversation
sec=ntlm removed from Linux kernel so removed from mount instructions. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76a3c92ec9e0668e4cd0e9ff1782eb68f61a179c Mounting Cifs by hostname on Ubuntu requires additional package cifs-utils https://serverfault.com/questions/609365/cifs-mount-in-fstab-succeeds-on-ip-fails-on-hostname-written-in-etc-hosts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for your PR. I've left some comments.
|
||
```sh | ||
mount -t cifs -o sec=ntlm,uid=root,gid=100,dir_mode=0700,username=root,password= //HostName/ServiceName /mnt/FolderMount | ||
mount -t cifs -o vers=2.0,uid=root,gid=100,dir_mode=0700,username=root,password= //HostName/ServiceName /mnt/FolderMount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend leaving out security options:
mount -t cifs -o vers=2.0,uid=root,gid=100,dir_mode=0700,username=root,password= //HostName/ServiceName /mnt/FolderMount | |
mount -t cifs -o uid=root,gid=100,dir_mode=0700,username=root,password= //HostName/ServiceName /mnt/FolderMount |
The manpage for mount.cifs
says that the default for vers
is Tries to negotiate the highest SMB2+ version supported by both the client and server.
so I wouldn't mess with it.
As mount.cifs
is part of cifs-utils
, maybe we should recommend installing it unconditionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi sbraz, and thanks for comments.
About that security options, you can surely understand that update to this document came from the realization that the mount didn't work without setting vers=2.0, as 2.1 is newer, as is 3.0. I'm not sure which kind of people set vers=2.0 if it's not required.
About cifs-utils, is not my decision. Some people seem to try install as few packages as possible. But I see no harm unconditionally suggesting installing cifs-utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
came from the realization that the mount didn't work without setting vers=2.0
I actually wasn't sure why you added the version as you hadn't mentioned it anywhere in the commit message or the PR. So, even with cifs-utils installed, you had to specify a vers=
parameter? What OS are you running?
I will perform tests on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct. vers=2.0 ( or lower ) is required for successful CIFS mount of FTP backup space.
This test was done on updated Ubuntu Noble 24.04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll reply as soon as possible after performing the tests. I want to debug this a little to see if there is any way to avoid forcing a version while mounting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that on newer kernels, vers=2.0
, because (as per the manpage):
The default since v4.13.5 is for the client and server to negotiate the highest possible version greater than or equal to 2.1. In kernels prior to v4.13, the default was 1.0. For kernels between v4.13 and v4.13.5 the default is 3.0.
So, if vers
is not forced, we get, in dmesg
:
[Fri Jan 31 20:36:02 2025] CIFS: VFS: \\xxx.ovh.net Dialect not supported by server. Consider specifying vers=1.0 or vers=2.0 on mount for accessing older servers
[Fri Jan 31 20:36:02 2025] CIFS: VFS: cifs_mount failed w/return code = -95
@@ -353,6 +353,8 @@ The code example above contains variables, which you will need to substitute wit | |||
* **ServiceName**: The name of your server (e.g. ns0000000.ip-123-123-123.net) | |||
* **FolderMount**: The folder where you want to mount the share (it must already exist) | |||
|
|||
cifs-utils is needed for hostname resolution ([src](https://serverfault.com/questions/609365/cifs-mount-in-fstab-succeeds-on-ip-fails-on-hostname-written-in-etc-hosts)). Otherwise use IP address. SMB versions 2.1 and 3.0 are not supported as of December '24. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not link to a Stack Overflow question.
Also, the second sentence doesn't seem necessary since the highest possible version will be negotiated by mount.cifs
. When the SMB servers get updated, a newer version will automatically be used, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I like SO questions more than kernel discussion pages or personal tests. Each this his/her own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, if we link to something, it should be a documentation page or a source code manual, not a mailing list or forum of any kind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is necessary to install the package that provides the mount.cifs
utility. This is usually the cifs-utils
package. mount.cifs
is a wrapper which adds the ip=
parameter to the mount parameters.
For example, with mount.cifs
installed:
root@localhost ~ $ mount -v -t cifs //xxx.ovh.net/nsxxx /mnt/FolderMount -o vers=2.0,username=root,password=xxx
mount.cifs kernel mount options: ip=a.b.c.d,unc=\\xxx.ovh.net\nsxxx,vers=2.0,user=root,pass=********
Without mount.cifs
installed:
mount: /mnt/FolderMount: mount(2) system call failed: No route to host.
dmesg(1) may have more information after failed mount system call.
and dmesg
contains:
CIFS: Unable to determine destination address
sec=ntlm removed from Linux kernel so removed from mount instructions.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76a3c92ec9e0668e4cd0e9ff1782eb68f61a179c
Mounting Cifs by hostname on Ubuntu requires additional package cifs-utils
https://serverfault.com/questions/609365/cifs-mount-in-fstab-succeeds-on-ip-fails-on-hostname-written-in-etc-hosts