I want to use rclone with autofs to allow on demand mounting and unmounting.
Setting up sshfs mounts with autofs was easy. There are many discussions and guides on the internet. I cannot however find any guide, tutorial or reference for how to use rclone with autofs in the rclone documentation, forum or elsewhere on the web.
Run the command 'rclone version' and share the full output of the command.
rclone v1.68.1
os/version: ubuntu 24.04 (64 bit)
os/kernel: 6.8.0-47-generic (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.23.1
go/linking: static
go/tags: none
Which cloud storage system are you using? (eg Google Drive)
Multiple, all of the remotes with when mounting directly from the command line.
The command you were trying to run (eg rclone copy /tmp remote:tmp)
When trying to setup my /etc/auto.rclone file I don't even know where to start with the -fstype option. Here are three example I found 3 options from searching this forum:
-fstype=fuse.rclonefs
-fstype=fuse.rclonefsdev
-fstype=rclone
it is not at all clear which one is correct? I have also tried different AIs and I get different answers on how to set this up however, none of them work so I guess this is not clearly documented anywhere?
Also, this post mentions a mount helper script: Automount with rclone but it seems it is not needed anymore with recent version. Is it still required with using autofs?
I also searched the documentation but I did not find any mention of autofs.
None of the forum posting I found actually indicated that the users seeking help were actually successful with using rclone and autfo but there are many posts going back several years so I assume it is possible?
If any users who have successfully setup autofs with rclone options could you please advise of the basic syntax to get it running and or link to a reference where I can find the different rclone options that are supported by autofs? It would be much appreciated.
Good question, I tried systemd first for an entire day however I have a mix sshfs and rclone remotes. The premise of using systemd to manage sshfs mounts is fundamentally flawed. Fuse is a userspace utility and systemd does not allow --user units to automount on demand, root is required. systemd offers very basic options when mounting remote drives.
This has several implications such as you cannot use your .ssh/config file, you can also not use encrypted keys with passwords as the root user has no access to any user environment such as any ssh agent running which can supply the password.
autofs also mounts in root however it is much more flexible and scriptable and has the possible to access config, userenv and ssh agents. autofs also handles the mounts much better when the system needs to suspend whereas systemd often hangs.
It works great for sshfs and apparently it also works for rclone but I can't find any documentation on the basic syntax. I think according to this post: Example for rclone 1.57 together with autofs (without rclone-mount-helper-script) that -fstype=rclone is correct once your create the ln however my basic example still doesn't work:
When I systemctl start autofs autofs created the rclone mount point but doesn't mount anything. I don't see any errors in the journal either it just silently fails.
This is the problem I am having, I don't know which rclone options work with autofs, I assume not all of them but I also can't find a reference or guide either. I am hoping a user who has successfully manged to get these two working together can provide a basic working example. Then once it is here other users can find this thread and use it as a place to start.