Bugzilla – Bug 1216138
Mounting SMB?CIFS folder from CLI failes with read-only error
Last modified: 2024-06-11 11:04:41 UTC
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0 Build Identifier: When trying to mount an SMB share from my NAS on my Aeon Device using the mount command I get a read-only error. I am trying to mount the share to a folder in my home directory. Mount Command used: sudo mount -t cifs -o username=user,uid=user,gid=user,iocharset=utf8 //10.0.0.20/share /home/user/NAS/share Rights on both the NAS as well as the user folder are set to: drwxrwxrwx. error: mount: /home/user/NAS/share: cannot mount //10.0.0.20/share read-only. dmesg(1) may have more information after failed mount system call. dmesg: [ 1185.462138] CIFS: Attempting to mount //10.0.0.20/share [ 1185.473604] CIFS: Status code returned 0xc000006d STATUS_LOGON_FAILURE [ 1185.473611] CIFS: VFS: \\10.0.0.20 Send error in SessSetup = -13 [ 1185.473622] CIFS: VFS: cifs_mount failed w/return code = -13 Mounting the share within nautilus works fine. Running the same command on a different device with Tumbleweed also works fine. running sudo mount -t cifs -o username=user //10.0.0.20/share /home/user/NAS/share or sudo mount -t cifs //10.0.0.20/share /home/user/NAS/share results in the same error Reproducible: Always Steps to Reproduce: 1.Mount share using command listed. Actual Results: read-only error Expected Results: Mounting of share.
As CIFS mounting works fine in GNOME Files/Nautilus I'm tempted to close this as WONTFIX I suspect the root cause is likely a mismatch between the SELinux labeling in your /home and the SELinux labelling of files on your NAS I suspect they'd need to be labelled similarly for what you're attempting to do to work Could you investigate and report back?
Hi Richard, Thanks for the feedback. The NAS I am running is Unraid and this does not use SELinux. I checked the AEON system and when checking for denials I get no matches: sudo ausearch -ts boot -m avc <no matches> Also putting SELinux in permissive mode using sudo setenforce Permissive does not help. If this is really something that happens with my NAS, then I would expect others to be able to mount SMB/NFS shares successfully using Mount? Would be interesting to know others experiences. As for closing it as non fix please also consider the following: - The performance difference between using the mount command and the user space mounting of Nautilus is real. Using Nautilus I can not saturate a 1gb link, let alone my 10gbe link. Using the mount command this is not an issue. If Nautilus / user space mounting had the same performance than I agree this should be preferred. - Using Nautilus I can not decide the Mount location. I am stuck with whatever location Nautilus assigned to it. making using the location in any scrips or automatons a lot harder. - Depending on Nautilus means making use of shares in the CLI a lot harder. As Aeon is meant as THE linux desktop I think all core functionality of Linux should be expected to work. Mounting shares (either SMB or NFS or anything else) is probably expected to be one of those core functionalities.
To give a comparison of the speed difference between using Nautilus vs the mount command. I mounted the same share on my NAS using NFS with both. I copied the same file from my main tumbleweed machine to the NAS in both cases and ran the test several times just to be sure. The connection between my main tumbleweed machine and the NAS is a 10GBE connection. Using Nautilus to mount the file I reach speeds of not even 100MB/s. Usually high 90ś MB/s Using the mount command I reach speeds of about 870 MB/s to 900 MB/s. So this is a speed difference of about 9 times. If you work with large files, like video files for example, this difference really adds up.
So, I actually get some more results on this after playing around with NixOS, where I faced a similar issue. Turned out that the entire issue is the fact that I can not get an interactive password prompt. When I change the command and add password=xxxx to the mount options the command runs fine. This would mean however that I would need to add the password to the script that runs the mount command. Not ideal, as I would prefer to not store the password on the device. In NixOS I was able to solve this by adding the samba package and adding CIFS to boot.SupportedFilesystems. However, I have no idea what the equivalent of that would be in Aeon. Here is hoping that you do and it is a simple fix. So, it seems it does work, there is just something missing for full interactive functionality.
Some more research seems to indicate you might need cifs-utils in order to get the password prompt. Would it be possible to add this?
After setting up a test environment and installing cifs-utils with transactional update I can confirm that that solves the issue. If there is no objection to adding this, can this be added?
Sounds like a valid approach,thanks for the debugging
Thanks. Just happy to contribute somehow to this great project. :)
addressed in https://build.opensuse.org/request/show/1179986