You are not logged in.

#1 2025-01-01 18:08:20

obelisk
Member
Registered: 2021-01-10
Posts: 67

auto unmounting (NFS or SSHFS) with thunar does re-mounting loop

Hello, I have a issue, which I don't get solved.

I created  an auto-mounting to my NAS (NFS) and Rpi (SSHFS).
And I want use it with automatic umount after specific time, when I'm not using it.

It doesn't matter if I create my automount via /etc/fstab or systemd unit files. Both have the same behaviour.

OK behaviour:
When I open a terminal, navigate to the automount folder, the network mountpoint is mounted normal. When I leave the folder, the automatic umount is performed after the configured time. Works as expected.

Misbehaviour
When I open thunar, navigate to the automount folder, the network mointpoint is mounted normal. When I leave the folder, the automatic umount is performed after the configured time. Till here it works as expected. Bit a few seconds later the folder is re mounted again.

Here output of journalctl -f, with some #comments from me

    #navigating with terminal to folder, which get mounted automatic > OK
Jan 01 18:06:58 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 2671 (ls)
Jan 01 18:06:58 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:06:58 john kernel: netfs: FS-Cache loaded
Jan 01 18:06:58 john kernel: Key type dns_resolver registered
Jan 01 18:06:58 john kernel: NFS: Registering the id_resolver key type
Jan 01 18:06:58 john kernel: Key type id_resolver registered
Jan 01 18:06:58 john kernel: Key type id_legacy registered
Jan 01 18:06:58 john nfsrahead[2692]: setting /mnt/nas/media readahead to 128
Jan 01 18:06:58 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
#leaving the folder, umout is perfomed > OK
Jan 01 18:07:03 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:03 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:07:03 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
    #Now navigating with thunar to the folder, which get mounted automatic > OK
Jan 01 18:07:31 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1284 (Thunar)
Jan 01 18:07:31 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:32 john nfsrahead[2724]: setting /mnt/nas/media readahead to 128
Jan 01 18:07:32 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
    #closing thunar window, umounting get performed, but some seconds later "gmain" is triggering mounting again > Not OK
Jan 01 18:07:37 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:37 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:07:37 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
Jan 01 18:07:41 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1286 (gmain)
Jan 01 18:07:41 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:42 john nfsrahead[2749]: setting /mnt/nas/media readahead to 128
Jan 01 18:07:42 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
Jan 01 18:07:47 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:47 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:07:47 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
Jan 01 18:07:51 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1286 (gmain)
Jan 01 18:07:51 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:52 john nfsrahead[2781]: setting /mnt/nas/media readahead to 128
Jan 01 18:07:52 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
Jan 01 18:07:57 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:07:57 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:07:57 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:01 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1286 (gmain)
Jan 01 18:08:01 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:02 john nfsrahead[2805]: setting /mnt/nas/media readahead to 128
Jan 01 18:08:02 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:07 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:07 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:08:07 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:11 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1286 (gmain)
Jan 01 18:08:11 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:12 john nfsrahead[2834]: setting /mnt/nas/media readahead to 128
Jan 01 18:08:12 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:17 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:17 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:08:17 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:21 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1286 (gmain)
Jan 01 18:08:21 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:22 john nfsrahead[2862]: setting /mnt/nas/media readahead to 128
Jan 01 18:08:22 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:27 john systemd[1]: Unmounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:27 john systemd[1]: mnt-nas-media.mount: Deactivated successfully.
Jan 01 18:08:27 john systemd[1]: Unmounted Shared NFS on /mnt/nas/media/.
Jan 01 18:08:31 john systemd[1]: mnt-nas-media.automount: Got automount request for /mnt/nas/media, triggered by 1286 (gmain)
Jan 01 18:08:31 john systemd[1]: Mounting Shared NFS on /mnt/nas/media/...
Jan 01 18:08:32 john nfsrahead[2889]: setting /mnt/nas/media readahead to 128
Jan 01 18:08:32 john systemd[1]: Mounted Shared NFS on /mnt/nas/media/.
    #remounting loop with trigger "gmain" (???) never stops

I can stop the remounting by stopping my systemd unit file (systemctl stop mnt-nas-media.automount) or if I killing thunar daemon. Thunar daemon can be started with thunar --daemon &, with the same reslut when I navigate again to the automount folder.

I have observed this on NFS and on also SSHFS automounts I have created. Doesn't matter it they created in /etc/fstab or in /etc/systemd/sytem
I'm not sure if it worked in the past before xfce 4.20 was realised. I noticed it that my NAS never did a hdd-spindown again after I left the folder with thunar.

I don't know what gmain is in the log. The first trigger was thunar for the automount. No idea how to analyse it deeper or solve it. For me it looks like a thunar issue. With Nautilus I have no re-mounting loop.
Has anybody some idea?

Here my unit files:

cat  /etc/systemd/system/mnt-nas-media.mount 
[Unit]
Description=Shared NFS on /mnt/nas/media/
After=network.target

[Mount]
What=192.168.2.20:/volume1/media
Where=/mnt/nas/media/
Options=vers=4,noauto,user,rw
Type=nfs
TimeoutSec=10
ForceUnmount=true

[Install]
WantedBy=multi-user.target
cat  /etc/systemd/system/mnt-nas-media.automount 
[Unit]
Description=Automount /mnt/nas/media/

[Automount]
Where=/mnt/nas/media/
TimeoutIdleSec=10s

[Install]
WantedBy=multi-user.target

or with fstab:

cat /etc/fstab  | grep media
192.168.2.20:/volume1/media		/mnt/nas/media		nfs	_netdev,x-systemd.automount,vers=4,x-systemd.mount-timeout=3s,x-systemd.idle-timeout=10s    0    0

Last edited by obelisk (2025-01-01 18:10:02)

Offline

#2 2025-01-10 19:58:04

elbc56
Member
Registered: 2025-01-10
Posts: 1

Re: auto unmounting (NFS or SSHFS) with thunar does re-mounting loop

Could it be related to what I've been observing with xfce 4.20 (mx linux repo with Debian stable) ? This was going well before with xfce 4.18.
In clear, with an mnt automount service I see this :
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
...
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
mnt-share.automount: Got automount request for /mnt/share, triggered by 980 (gmain)
...

mnt-share.automount: Failed with result 'mount-start-limit-hit'

And after that, mount will stop working.

I've found that if I disable "TimeoutIdleSec" in automount service, there is no problem anymore.

Last edited by elbc56 (2025-01-10 19:58:31)

Offline

#3 2025-01-11 11:39:53

obelisk
Member
Registered: 2021-01-10
Posts: 67

Re: auto unmounting (NFS or SSHFS) with thunar does re-mounting loop

Hello elbc56,

For me its something which is now with thunar in xfce 4.20. I'm not sure if this is a bug, if somedody could confirm this behaviour...I don't know.
The TimeoutIdleSec is in my understanding the time till an auto umount is performing; see https://man.archlinux.org/man/systemd.automount.5
And yes...without the TimeoutIdleSec, there I have also no problem with the unwanted re-mounting. But also no automatic umounting an more.

The mount-start-limit-hit is new for me. I got never this result... Or I haven't wait not long enough.

For me I wanted just an easy way to access my another PC network drive, without need of Samba. The NFS with automatic mounting by navigating to the mountpoint was fine for me. The automatic umounting also, in case O restarted my NAS, my PC doesn't hang, if I have still mounted the NFS folder.

I use now direct mounting with sshfs over thunar, which works also very fine: sftp://192.168.2.xx@USERNAME/home/
...which I enter direkt in thunar address line, then placing a link on the location area on the side in thunar for future access.
But here I have to be careful that I umount the mountpoint, before I want restart my NAS (in case of maintenance, for example).
And an copying files to a mounted folder via terminal takes some getting used to. Because the mountpoint is not more /mnt/... or /media/..., it is then /run/user/1000/gvfs/sftp:host=192.168.2.xx,user=USERNAME/home

Offline

#4 2025-01-26 17:42:43

seth
Member
Registered: 2012-09-03
Posts: 60,807

Re: auto unmounting (NFS or SSHFS) with thunar does re-mounting loop

gmain is the gtk main loop, it's some thread, not a process.
=> https://unix.stackexchange.com/question … d-from-tid to get the offending process, but it's kinda likely the thunar daemon for reasons™ - and it's most likely a bug where it probably wants to do some clean-up or so after the window is closed and looks at the path. https://gitlab.xfce.org/xfce/thunar/-/issues/
Might be a gvfs but (but apparently doesn't happen w/ nautilus?)

Offline

Board footer

Powered by FluxBB