Mountpoints get corrupt when stopping AutoFS

Hello

What is the problem you are having with rclone?

I am using rclone for mounting networkshares on a RaspberryPi 4 with Raspain Buster.
I use rclone mount together with AutoFS. I use the helper script from here

I am using rclone to mount different accounts from googleDrive, googlePhoto and some other Cloudspace-provider like Box, Dropbox, Mega, Microsoft OneDrive, OpenDrive, premiumize.me, put.io and Yandex Disk

AutoFS is starting when booting the system via system service.
Everything works so far.
But when I stop AutoFS with "systemctl stop autofs", some Mountpoints got corrupt.

In a Filemanager, it looks like this:

If I try to access the Mountpoints from console, the system is saying "socket is not connected"
At the moment, I can only fix this by rebooting the whole system.

my auto.master file for AutoFS:

/mnt/googleDrives /etc/auto.gdrive -_netdev,--timeout=1000 --ghost
/mnt/CloudSpeicher /etc/auto.cloudspeicher -_netdev,--timeout=1000 --ghost

my auto.gdrive file:

mtusa21Gdrive	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,umask=000	:mtusa21Gdrive:

mtusa21sicherung1Gdrive	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,umask=000	:mtusa21sicherung1Gdrive:
mtusa21jdGdrive	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,umask=000	:mtusa21jdGdrive:
mtusa21Gphoto	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,umask=000	:mtusa21Gphoto:
mtusa21sicherung1Gphoto	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,umask=000	:mtusa21sicherung1Gphoto:
mtusa21jdGphoto	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,umask=000	:mtusa21jdGphoto:

my auto.cloudspeicher file:

box-com -fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,allow-other,umask=000,checksum	:box-com:
dropbox-com -fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,allow-other,umask=000,checksum	:dropbox-com:
hotmail-com -fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,allow-other,umask=000,checksum	:hotmail-com:
skypeAccount -fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,allow-other,umask=000,checksum	:skypeAccount:
opendrive-com -fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,allow-other,umask=000	:opendrive-com:
Yandex -fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,allow-other,umask=000	:Yandex:


I tested with the latest beta-version and the latest stable version of rclone.

How can I avoid that the Mountpoints get corrupt in the filesystem?

Looks like you are missing allow-nonempty.

but what about this:

Buster should use 2:

https://packages.debian.org/buster/fuse

Are you running version 3?

that's a good question:

what do you think, 2 or 3?
How can I check this?

Easy way is:

felix@gemini:~$ fusermount -V
fusermount version: 2.9.9

My case I have libfuse2 installed:

felix@gemini:~$ apt search libfuse2
Sorting... Done
Full Text Search... Done
libfuse2/focal,now 2.9.9-3 amd64 [installed,automatic]
Filesystem in Userspace (library)

and in my case:

root@blackPI:~# fusermount -V
fusermount3 version: 3.10.3
root@blackPI:~# apt search libfuse2
Sortierung… Fertig
Volltextsuche… Fertig
libfuse2/testing,now 2.9.9-5 armhf  [Installiert,automatisch]
  Filesystem in Userspace (library)

root@blackPI:~# 

does AutoFS use "fusermount" or "libfuse2"?

I'd guess you have libfuse3 installed and you can remove it.

felix@gemini:~$ apt search libfuse3
Sorting... Done
Full Text Search... Done
libfuse3-3/focal 3.9.0-2 amd64
  Filesystem in Userspace (library) (3.x version)

libfuse3-dev/focal 3.9.0-2 amd64
  Filesystem in Userspace (development) (3.x version)

so now, only the packages fuse 2.9.9-5 and libfuse2 2.9.9-5 are installed.
But still the same problem with corrupt Folders when stopping autofs

any idea?

You updated the command to use allow non empty?
Can you post what you changed?

What do you mean by corrupt? Do you have a log file or something in rclone that shows something not working?

yes, I only added allow-non-empty to all lines in my config-files auto.gdrives and auto.cloudspeicher
here is one line (i added it to all lines of course)

mtusa21Gdrive	-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,allow-non-empty,umask=000	:mtusa21Gdrive:

I am using this example to explain what I mean with corrupt:
have a look an my 3 config files from autofs in the first post.
the line

/mnt/googleDrives /etc/auto.gdrive -_netdev,--timeout=1000 --ghost

in my auto.master says that "the root" for all rclone remotes defined in auto.gdrives config is /mnt/googleDrives
this path exists all the time
when autofs service starts on booting the system, in the example, autofs starts rclone mount for rclone-remote "mtusa21Gdrive" and mount it to /mnt/googleDrives/mtusa21Gdrive using the parameters

-_netdev,--timeout=1000 --ghost
and
-fstype=fuse.rclonefs,config=/root/.config/rclone/rclone.conf,uid=1000,gid=1003,dir-perms=0770,file-perms=0770,fast-list,allow-other,allow-non-empty,umask=000

everything works this at this point.

now, then stopping autofs with systemctl stop autofs, autofs together with rclone should unmount all remotes
then, there happens an error while unmounting.
normaly, the mountpoint "mtusa21Gdrive" under /mnt/gdrives should disappear. the result of the error you can see on the screen in the first post.

This not happens for all remotes defined in my autofs config files auto.gdrives and auto.cloudspeicher, but this happens for 2 remotes minimum
the remotes which have the problem change from try to try.

regarding logs
I dont know if and where rclone mount and autofs are writting logs.
Could you explain how to enable logs?

I don't use autofs so I don't know how / where logs are for that as most folks use systemd.

Rclone would need --log-file /tmp/rclone and -vv added to it's command line to start.

i tested with one Remote at GoogleDrive. only this one Remote is now configured in AutoFS.
I have a good case (=unmounting correct) an a bad case (=corrupt folder)

goodCase.log (181.9 KB)
badCase.log (16.0 KB)

Do you see the problem?

in goodCase, I can find "Google drive root '': Checking for changes on remote
This does not appear in badCase

I don't use AutoFS as my rclone mounts are not as needed as I keep them mounted with systemd.

From your bad log, rclone looks to get killed so not sure what that will do if something is accessing it.

I'd imagine something with AutoFS but I have zero experience with it and don't use it.

What's the use case for you using AutoFS over just a mount with systemd?

reasons for AutoFS

  • no mounting while booting
  • try to mount only when a network connection is available
  • only mounting when access is necessary
  • unmount when no access is needed
  • I plan to configure 70-100 mountpoints

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.