I would recommend you to use the systemd service instead of fstab when using Samba.
I think fstab has some limitations (I have not tried Samba in the fstab):
There is a lack of order between the Samba client process and the mount process.
For example: The mount process should wait until Samba client process is activated after booting without crashing.
No logical management. What happens if the server is not online? → Fstab still tries to mount it without checking?
Writing your own Systemd service script could prevent two problems.
Try to create /etc/systemd/system/Your-samba.service
I created an example for the Systemd service, you should adjust it yourself:
Description=[Your-samba.service]
After=network.target
#After=samba-client.service? # Waiting for the Samba client to start
Before=shutdown.target reboot.target halt.target poweroff.target
[Service]
EnvironmentFile=/etc/environment # You add SERVER_IP=192.168.178.25 in /etc/environment
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/mount -t cifs //${SERVER_IP}/data /mnt/hp25 -o credentials=/home/tobias/.smb
TimeoutStartSec=60
ExecStop=-/usr/bin/umount /mnt/hp25
TimeoutStopSec=20
# If this service fails, then it will be restarted.
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target
The only Problem I have with this solution. What happen, when I am not at home and have no access to the Server? Does the Service try every 10 seconds to connect to the Samba Share?
Yes, but this service is just an example. If you do not like it, you can change it.
There are many different possible ways to customize the service to you needs. There is no single way.
Final Edit: Moving to Linux 6.6 LTS fixed this issue for me.
This is happening to me now as well after updating the system and restarting.
I was mounting via fstab, but I did migrate them to systemd with proper .mount and .automount unit files and the problem still occurs just as described in OP.
Files are still mostly accessible but it enumerates ‘resource temporarily unavailable’ for every single folder. and filestat doesn’t seem to work? Also seems to be a lot slower, subjectively.
When listing the mount this appears in journalctl:
kernel: CIFS: VFS: reconnect tcon failed rc = -11
My kernel:
6.1.71-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Jan 5 17:36:36 UTC 2024 x86_64 GNU/Linux
Seems to be a widespread linux 6.1.x kernel issue?