CIFS mount issue

Hello all, I have fedora 40 workstation on a Dell latitude E6540 with the latest kernel. The wireless is alive and well.

I seem to have an issue with my NAS storage cifs mount. The issue is sometimes “files” (nemo) hangs when trying to open a share folder. However, I can ping the IP and it returns a response w/o issue. Also I cd to /media/share I get “Host is down” and it’s not because I can ping it. I ssh to another host on my network and repeat above steps and the mounts work fine. I also have fedora server as a vm on one the hosts and it can ping and connect to my NAS. It seems it’s only my laptop. When it hangs, I usually have to kill the nemo PID. However, when I reboot the laptop, I can open the share(s) in files. Has anyone else have this issue? Is it a bad kernel update. I booted in to an older kernel and for now it works with no issues. My NAS is really important for a number of reasons.

BTW, my fstab looks like this

//192.168.1.XX/share /media/share cifs credentials=/etc/credentials,noperm,vers=1.0,dir_mode=0777,file_mode=0777 0 0

And i tried changing ver=3.0 and it barked about the version. No other machines on my network have this issue.

I found this in the logs
kernel: CIFS: VFS: \192.168.1.XX Error -104 sending data on socket to server

Thanks in advanced
gsurfdude

Welcome @gsurfdude

I don’t use Nemo myself, but in general i prefer to use systemd automounts for network shares rather than fstab, since the latter can be less reliable when connections are interrupted.

Here is an example of how you could mount the share with systemd:

Create /etc/systemd/system/media-share.mount

[Unit]
Description=Mount share 

[Mount]
What=//192.168.1.XX/share
Where=/media/share
Options=_netdev,credentials=/etc/credentials,iocharset=utf8,uid=1000,gid=1000
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target

To make it automount, meaning to only mount it when you access /media/share:

Create /etc/systemd/system/media-share.automount

[Unit]
Description=Automount share

[Automount]
Where=/media/share

[Install]
WantedBy=multi-user.target

Reload and enable the service:

$ sudo systemctl daemon-reload
$ sudo systemctl enable media-share.automount
1 Like

Thanks Olivier. I got this to work with some minor modifications. The weird thing is this only happens on my wireless laptop, not my servers. However, the strange thing is when I open files, the shares are listed twice. E.G the shares look like this

Network
share
share

linux
linux

They mount when opening in files (nemo) but lists them twice. Also, I am using cinnamon as my desktop. I am not a big fan of gnome.

This might be due to the wifi connection that can get disconnected, that can sometimes do unpredictable things to CIFS mounts…

Do you still have the fstab entry as well? You won’t need to keep that if you use the systemd approach.

Edit: you also only need to enable the media-share.automount file, not the .mount file.