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?
Thank you!
(sorry for my english, my native language is German)
I believe that standby is designed to dismount remote file systems while sleeping, thus it is dismounted when the system goes to standby.
The fact that your fstab entry contains the ‘user’ option should allow you to mount and dismount the device as your regular user without requiring sudo to do that.
You should also be able to mount and dismount it from the file manager if you choose.
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.
Today I tried to access the NAS via the internet browser directly after waking up Fedora from standby. Strange, but it work perfect and I can immedently access to the NAS.
After that I opened Gnome files and got this error:
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
Where: /mnt/samba
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.
But it is automatically unmounted after 60 seconds of idle. Or I am wrong?
Tomorrow morning I will first wake up the NAS manually. After that I will wakeup Fedora from standby. Maybe the Fedora computer has some problems to wake up the NAS in the first minutes after wakeup.
just a quick feedback:
In the last time the problem seems to be gone. Don´t know why… Maybe with the latest kernel 5.19.
After standby the connection to the NAS is instantly available now.