I am running KDE desktop with an NFS client connection using autofs. The server configuration was done on a Leap 15.5 machine using Yast with NFSv4 enabled and the export setting details are:-
from /etc/systemd/system the client mount and automounts are:-
cat home-alastair-NFS_from_ibmserv_135_alastair.mount
[Unit]
Description=nfs mount for 135 /home/alastair
[Mount]
What=192.168.169.135:/home/alastair
Where=/home/alastair/NFS_from_ibmserv_135_alastair
Type=nfs4
Options=rw,noauto
TimeoutSec=5
[Install]
WantedBy=multi-user.target
and
alastair@HP-Z640-1:/etc/systemd/system> cat home-alastair-NFS_from_ibmserv_135_alastair.automount
[Unit]
Description=nfs automount for 135 /home/alastair
[Automount]
Where=/home/alastair/NFS_from_ibmserv_135_alastair
TimeoutIdleSec=10
[Install]
WantedBy=multi-user.target
The mount point on my system is:
/home/alastair/NFS_from_ibmserv_135_alastair/
All this seems to work as it did with my now dead workstation and as expected until I select the mount point using Dolphin and expand it. The exported directory then shows as required directory tree for a few seconds and then Dolphin reverts to my home directory tree and I get the message:-
Current location changed, ‘/home/alastair/NFS_from_ibmserv_135_alastair’ is no longer accessible.
What is happening here and how can I fix it please?
No Idea what was happening. When using Dolphin the “Places” column, which includes a Remote heading shows the NFS automount and this was appearing and disappearing every few seconds.
Since as far as I knew the configuration was all correct I left this and went away to do other things.
On returning a few hours later the connection appears to have stabilised and is now OK to use.
Just as a reference, my reliable autofs configuration –
> cat /etc/auto.master
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc /etc/auto.misc
/mnt/NAS-Bureau-001 file:/etc/auto.NAS-Bureau-001 --timeout=120
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
#+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
>
> dcu@eck001:..Users/dcu> cat /etc/auto.NAS-Bureau-001
NFS -rw,hard NAS-Bureau-001.fritz.box:/NFS
>
Ditto for a Laptop which additionally uses the automounter to access the NFS server on this Desktop machine –
Almost the same configuration except for an additional entry pointing to this host …
Hi Don,
Many thanks for the info. I spent some time on the openSUSE documentation but when I first started with autofs I used a thread posted here but with excellent and clear instructions which did not actually require editing /etc/auto.master.
The thread to which I referred is
Using that info worked well but out of interest here is my /etc/auto.master:-
alastair@HP-Z640-1:~> cat /etc/auto.master
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# To add an extra map using this mechanism you will need to add
# two configuration items - one /etc/auto.master.d/extra.autofs file
# (using the same line format as the auto.master file)
# and a separate mount map (e.g. /etc/auto.extra or an auto.extra NIS map)
# that is referred to by the extra.autofs file.
#
#+dir:/etc/auto.master.d
#
# If you have fedfs set up and the related binaries, either
# built as part of autofs or installed from another package,
# uncomment this line to use the fedfs program map to access
# your fedfs mounts.
#/nfs4 /usr/sbin/fedfs-map-nfs4 nobind
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
alastair@HP-Z640-1:~>
Why is my setup so different. I assume the ‘+’ sign is significant in front of auto.master but since the above link appeared to work I stuck with it. Since last evening it has been solid and I have been running many gigabytes using rsync.
I would like to understand a bit more but not urgent as I am OK for now!!!
Regards,
Alastair.
Having restored my workstation please could I resume this thread because, after restoring my autofs mounts I am still getting the instability with which I started this thread. I have only two NFS automounts, one to each workstation. Here is my mount configuration:-
GNU nano 7.2 home-alastair-NFS_from_ibmserv_134_alastair.mount
[Unit]
Description=nfs mount for 134 /home/alastair
[Mount]
What=192.168.169.134:/home/alastair
Where=/home/alastair/NFS_from_ibmserv_134_alastair
Type=nfs4
Options=rw,noauto
TimeoutSec=5
[Install]
WantedBy=multi-user.target
and the automount configuration:-
GNU nano 7.2 home-alastair-NFS_from_ibmserv_134_alastair.automount
[Unit]
Description=nfs automount for 134 /home/alastair
[Automount]
Where=/home/alastair/NFS_from_ibmserv_134_alastair
TimeoutIdleSec=10
[Install]
WantedBy=multi-user.target
Why would this connection disconnect for about 90 seconds and then reconnect?
Where I am in trouble is understanding the role of /etc/auto.master. What should I have in that file and how does this relate to the above configuration?
Many thanks for clarifying that as I had been confused by my reading the wrong document.
I have been trying to understand this intermittent behaviour and do not understand what I am reading from the status. Here is what I have for the mount unit:-
alastair@HP-Z640-1:~> cd /etc/systemd/system
alastair@HP-Z640-1:/etc/systemd/system> sudo systemctl status home-alastair-NFS_from_ibmserv_134_alastair.mount
[sudo] password for root:
○ home-alastair-NFS_from_ibmserv_134_alastair.mount - nfs mount for 134 /home/alastair
Loaded: loaded (/etc/systemd/system/home-alastair-NFS_from_ibmserv_134_alastair.mount; enabled; preset: disabled)
Active: inactive (dead) since Sat 2024-01-13 17:32:32 GMT; 10min ago
Duration: 17.520s
TriggeredBy: ● home-alastair-NFS_from_ibmserv_134_alastair.automount
Where: /home/alastair/NFS_from_ibmserv_134_alastair
What: 192.168.169.134:/home/alastair
CPU: 19ms
Jan 13 17:32:14 HP-Z640-1 systemd[1]: Mounting nfs mount for 134 /home/alastair...
Jan 13 17:32:14 HP-Z640-1 systemd[1]: Mounted nfs mount for 134 /home/alastair.
Jan 13 17:32:31 HP-Z640-1 systemd[1]: Unmounting nfs mount for 134 /home/alastair...
Jan 13 17:32:32 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.mount: Deactivated successfully.
Jan 13 17:32:32 HP-Z640-1 systemd[1]: Unmounted nfs mount for 134 /home/alastair.
alastair@HP-Z640-1:/etc/systemd/system>
I do not understand the lines showing unmounting and Deactivated but this would certainly explain my problem, however the automount should stop this because I am using the NFS in question. Here is the automount status:
alastair@HP-Z640-1:/etc/systemd/system>
alastair@HP-Z640-1:/etc/systemd/system> sudo systemctl status home-alastair-NFS_from_ibmserv_134_alastair.automount
● home-alastair-NFS_from_ibmserv_134_alastair.automount - nfs automount for 134 /home/alastair
Loaded: loaded (/etc/systemd/system/home-alastair-NFS_from_ibmserv_134_alastair.automount; enabled; preset: disabled)
Active: active (waiting) since Thu 2024-01-11 22:57:21 GMT; 1 day 18h ago
Triggers: ● home-alastair-NFS_from_ibmserv_134_alastair.mount
Where: /home/alastair/NFS_from_ibmserv_134_alastair
Jan 13 16:59:48 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:00:31 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:01:45 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:03:29 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:06:26 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:07:07 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:07:50 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:08:32 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:09:41 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
Jan 13 17:32:14 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.automount: Got automount request for /home/>
alastair@HP-Z640-1:/etc/systemd/system>
Clearly I have made a mistake somewhere but need help sorting this out please.
Well, you have set idle timeout to 10 seconds, this may explain your issue. Enable debug logs in systemd and post them. Debugging can be enabled and disabled at run-time, see man systemd.
Sorry to be so dumb but I have read the man pages and am not much wiser. I can see the intended signals but how do I post the relevant section of the logs please?
I had set the time for 10 seconds on the understanding that if the nfs connection was not made in 10 seconds it would be dropped but it would leave time to be sure server was running. Perhaps I was too cautious and should reduce the time but I hope the logs will show what is going on.
Hi Karl,
All this shows is that my unit is mounting and unmounting as in:-
alastair@HP-Z640-1:~> sudo journalctl --since 11:00 --unit home-alastair-NFS_from_ibmserv_134_alastair.mount
Jan 14 11:36:54 HP-Z640-1 systemd[1]: Mounting nfs mount for 134 /home/alastair...
Jan 14 11:36:54 HP-Z640-1 systemd[1]: Mounted nfs mount for 134 /home/alastair.
Jan 14 11:37:19 HP-Z640-1 systemd[1]: Unmounting nfs mount for 134 /home/alastair...
Jan 14 11:37:19 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.mount: Deactivated successfully.
Jan 14 11:37:19 HP-Z640-1 systemd[1]: Unmounted nfs mount for 134 /home/alastair.
Jan 14 11:39:32 HP-Z640-1 systemd[1]: Mounting nfs mount for 134 /home/alastair...
Jan 14 11:39:32 HP-Z640-1 systemd[1]: Mounted nfs mount for 134 /home/alastair.
Jan 14 11:39:57 HP-Z640-1 systemd[1]: Unmounting nfs mount for 134 /home/alastair...
Jan 14 11:39:57 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.mount: Deactivated successfully.
Jan 14 11:39:57 HP-Z640-1 systemd[1]: Unmounted nfs mount for 134 /home/alastair.
Jan 14 11:41:21 HP-Z640-1 systemd[1]: Mounting nfs mount for 134 /home/alastair...
Jan 14 11:41:21 HP-Z640-1 systemd[1]: Mounted nfs mount for 134 /home/alastair.
Jan 14 11:41:42 HP-Z640-1 systemd[1]: Unmounting nfs mount for 134 /home/alastair...
Jan 14 11:41:42 HP-Z640-1 systemd[1]: home-alastair-NFS_from_ibmserv_134_alastair.mount: Deactivated successfully.
Jan 14 11:41:42 HP-Z640-1 systemd[1]: Unmounted nfs mount for 134 /home/alastair.
This confirms that my NFS mounts are up and down.
What I need is the debug logs to find out what signals are being sent and why and I need further help on the system. I am well outside my comfort zone and into my ignorance area here.
(sd-expire) is forked off every one-third of idle timeout (rounded to the whole second).
This message means autofs expired this mount.
So it appears you configured idle timeout as 5 seconds, not 10 seconds. Which does not really change anything - your system behaves as you configured it. Automount is expired when you told it and mounted again on access. So I am not sure what is your question. If you do not want to see the filesystem being constantly remounted, do not configure such tiny timeouts.
And your logs are truncated. Do not you read what you post? In this case truncated lines do not have anything interesting, but it is not always the case.
Hi and many thanks. AFAIK the timeout I set for the .mounts set the wait time for completing the mount after booting. I had set it to 10 seconds which would ensure that NFS server would be up.
I had misunderstood the .automounts timeout setting and how it works. My intention was that if I was working on Dolphin that once the NFS directories were accessed they would be automounted and remain automounted while in “use.” Not so it appears. To avoid further problems I have set the automounts to:-
TimeoutIdleSec=0
Sorry if logs were truncated and I failed to check. Mea culpa!