I have connected my NAS (Synology DS 220j)) to my Fedora computer (Fedora 36 with Gnome 42.2). To mount that drive I created an entry in fstab. After starting my computer it automatically connects the NAS. But when I move my computer to Standby over night, the NAS is not availiable at the next morning. The error message shows “The resource is currently unavailable” (see screenshot).
But when I type in in terminal sudo mount -a it immediately connects to the NAS.
When the Standby time is only some hours it is also working without problems. Also there is no problem connecting that NAS at the morning via my Android-App.
The fstab line regarding the NAS: //IP-Adress/gemeinsam /mnt/Gemeinsam-NAS cifs x-systemd.after=network-online.target,_netdev,credentials=/home/aunda/.smbcredentials,user,uid=1000,gid=1000
Is there something to make better in that entry?
(sorry for my english, my native language is German)
I have two folders on my NAS. One of them is mounted manually by clicking on the folder in the file manager. After that the folder is availiable.
The other folder is used by me and my girlfried. This is the folder mounted via fstab.
At this morning I first tried to mount the “manually mounted folder”. I wanted to see that the NAS is available after sleep. Everything was fine. The folder was mountet.
But when I click on the folder mounted via fstab after that, that folder is not available.
Waiting some minutes seems to solve the problem. When the computer is awake some minutes (maybe 5 minutes) the fstab-folder is connected.
The udev rules tell the system how to do automounts.
If you wish to do automount of the NAS then anticipate a delay in response at all times as it senses the need and then takes action, all before it is available.
Thank you for the suggestion with systemd mount @alciregi
It worked until I turned off the computer to standby. In the morning it shows me the same problem: no connection to NAS for some minutes.
But systemctl status mnt-samba.automount tells me (with green dots):
● mnt-samba.automount - automount my share
Loaded: loaded (/etc/systemd/system/mnt-samba.automount; enabled; vendor preset: disabled)
Active: active (waiting) since Sun 2022-07-31 22:55:38 CEST; 8h ago
Until: Sun 2022-07-31 22:55:38 CEST; 8h ago
Triggers: ● mnt-samba.mount
This is the content of /etc/systemd/system/mnt-samba.mount:
I checked it with mount.
When I access the NAS, the device is listed as last entry. After some minutes not using the NAS it disappears (when I run mount again). So it seems to be unmounted correctly as in mnt-samba.automount defined.
I commented out the line regarding the fstab entry for the NAS to concentrate on using systemd mount. So fstab is not mounting the NAS anymore.