Can't mount rclone in /etc/fstab (mount on boot)

Hello!

What is the problem you are having with rclone?

I am trying to mount an rclone mount on /etc/fstab and it is not working.
But if I run the command manually, it mounts correctly.

Run the command 'rclone version' and share the full output of the command.

$ rclone version
rclone v1.67.0
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-117-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.22.4
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

It is not cloud.
My iMac is running Filezilla Server.
So it is a FTP Share.
Using the same user and password, I have full read access to the shares/data/folders via FTP Client.

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Running this command in the CLI works as expected, and as soon as I press CTRL+C, it unmounts (as expected behaviour)

rclone mount iMac19_Volumes:/ /mnt/iMac19_Volumes

Off course the previous one only works while running, I want something to mount in the background on boot.
That is why I want to put it in the /etc/fstab according to documentation.

But this one in /etc/fstab doesn't work

iMac19_Volumes:/iMac19_Volumes/ /mnt/iMac19_Volumes rclone rw,noauto,nofail,_netdev,x-systemd.automount,args2env,vfs_cache_mode=writes,config=/etc/rclone.conf,cache_dir=/var/cache/rclone 0 0

I went further googling and found other comments and found other options in the documentation

In this page rclone mount in the "Now you can run classic mounts like this:"

Using this command:

mount iMac19_Volumes:/iMac19_Volumes/ /mnt/iMac19_Volumes -t rclone -o vfs_cache_mode=writes

Also WORKS

So it is something related either to fstab or to the command I inserted.

I also tried this version of the command in /etc/fstab and also doesn't work (added allow_other option)

iMac19_Volumes:/iMac19_Volumes/ /mnt/iMac19_Volumes rclone rw,allow_other,noauto,nofail,_netdev,x-systemd.automount,args2env,vfs_cache_mode=writes,config=/etc/rclone.conf,cache_dir=/var/cache/rclone 0 0

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

$ rclone config redacted
[iMac19_Volumes]
type = ftp
host = XXX
user = XXX
port = 21
pass = XXX
explicit_tls = true
no_check_certificate = true
### Double check the config for sensitive info before posting publicly

This part shoudln't be the problem because as I said before, I can access my data both in FTP client and when mounting manually using this config unchanged.

A log from the command that you were trying to run with the -vv flag

rclone mount iMac19_Volumes:/ /mnt/iMac19_Volumes -vv
2024/08/07 09:56:18 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "mount" "iMac19_Volumes:/" "/mnt/iMac19_Volumes" "-vv"]
2024/08/07 09:56:18 DEBUG : Creating backend with remote "iMac19_Volumes:/"
2024/08/07 09:56:18 DEBUG : Using config file from "/home/<#admin_user#>/.config/rclone/rclone.conf"
2024/08/07 09:56:18 DEBUG : ftp://192.168.10.10:21: Connecting to FTP server
2024/08/07 09:56:18 DEBUG : ftp://192.168.10.10:21: dial("tcp","192.168.10.10:21")
2024/08/07 09:56:18 DEBUG : ftp://192.168.10.10:21: > dial: conn=*fshttp.timeoutConn, err=<nil>
2024/08/07 09:56:18 INFO  : ftp://192.168.10.10:21: poll-interval is not supported by this remote
2024/08/07 09:56:18 DEBUG : ftp://192.168.10.10:21: Mounting on "/mnt/iMac19_Volumes"
2024/08/07 09:56:18 DEBUG : : Root:
2024/08/07 09:56:18 DEBUG : : >Root: node=/, err=<nil>
2024/08/07 09:56:30 DEBUG : /: Attr:
2024/08/07 09:56:30 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:32 DEBUG : /: Attr:
2024/08/07 09:56:32 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:32 DEBUG : /: ReadDirAll:
2024/08/07 09:56:32 DEBUG : ftp://192.168.10.10:21: dial("tcp","192.168.10.10:49165")
2024/08/07 09:56:32 DEBUG : ftp://192.168.10.10:21: > dial: conn=*tls.Conn, err=<nil>
2024/08/07 09:56:32 DEBUG : /: >ReadDirAll: item=3, err=<nil>
2024/08/07 09:56:32 DEBUG : /: Lookup: name="iMac19_Volumes"
2024/08/07 09:56:32 DEBUG : /: >Lookup: node=iMac19_Volumes/, err=<nil>
2024/08/07 09:56:32 DEBUG : iMac19_Volumes/: Attr:
2024/08/07 09:56:32 DEBUG : iMac19_Volumes/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:33 DEBUG : /: Attr:
2024/08/07 09:56:33 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:33 DEBUG : /: ReadDirAll:
2024/08/07 09:56:33 DEBUG : /: >ReadDirAll: item=3, err=<nil>
2024/08/07 09:56:33 DEBUG : /: Attr:
2024/08/07 09:56:33 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:33 DEBUG : /: Lookup: name="iMac19_Volumes"
2024/08/07 09:56:33 DEBUG : /: >Lookup: node=iMac19_Volumes/, err=<nil>
2024/08/07 09:56:33 DEBUG : iMac19_Volumes/: Attr:
2024/08/07 09:56:33 DEBUG : iMac19_Volumes/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: ReadDirAll:
2024/08/07 09:56:34 DEBUG : ftp://192.168.10.10:21: dial("tcp","192.168.10.10:49166")
2024/08/07 09:56:34 DEBUG : ftp://192.168.10.10:21: > dial: conn=*tls.Conn, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >ReadDirAll: item=10, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="<#volume_name#> 01"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/<#volume_name#> 01/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/<#volume_name#> 01/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/<#volume_name#> 01/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="<#volume_name#> 03"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/<#volume_name#> 03/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/<#volume_name#> 03/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/<#volume_name#> 03/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="Media HDD 01"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/Media HDD 01/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 01/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 01/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="Media HDD 02"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/Media HDD 02/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 02/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 02/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="Media HDD 03"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/Media HDD 03/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 03/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 03/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="Media HDD 04"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/Media HDD 04/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 04/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 04/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="Media HDD 05"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/Media HDD 05/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 05/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 05/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: Lookup: name="Media HDD 06"
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/: >Lookup: node=iMac19_Volumes/Media HDD 06/, err=<nil>
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 06/: Attr:
2024/08/07 09:56:34 DEBUG : iMac19_Volumes/Media HDD 06/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:35 DEBUG : /: Attr:
2024/08/07 09:56:35 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/08/07 09:56:35 DEBUG : /: Lookup: name="iMac19_Volumes"
2024/08/07 09:56:35 DEBUG : /: >Lookup: node=iMac19_Volumes/, err=<nil>
2024/08/07 09:56:35 DEBUG : iMac19_Volumes/: Attr:
2024/08/07 09:56:35 DEBUG : iMac19_Volumes/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
^C2024/08/07 09:56:46 INFO  : Signal received: interrupt
2024/08/07 09:56:46 ERROR : /mnt/iMac19_Volumes: Unmounted rclone mount
2024/08/07 09:56:46 INFO  : Exiting...
2024/08/07 09:56:46 DEBUG : rclone: Version "v1.67.0" finishing with parameters ["rclone" "mount" "iMac19_Volumes:/" "/mnt/iMac19_Volumes" "-vv"]

Any help on how to automount this on boot?

Thank you.

BSD style fstab probably behaves differently - either you investigate it and share details for others:) or as you are on macOS use simple way:

I am sorry if my post wasn't clear.

As you can see in rclone version, it is Linux Ubuntu.

My iMac19 is running Mac OS but sharing the Volumes over FTP.
It IS NOT running rclone.

My ubuntu server is running rclone and (trying to) mount over the network with rclone.
Rclone in being executed in Ubuntu.

So can you please see again you recomendation taking this into account?

Maybe I misread it… sorry

For Linux use systemd. It allows to manage dependencies like only start mount when network is fully working. Fstab probably tried to start mount before network subsystem is available after reboot.

You will find tones of examples on this forum.

OK that makes sense, it must be the problem here...

As I don't really need on boot mount, it can be manual, I opted to run the command that works in a script that I call.

It is a KISS approach :star_struck:

Thank you!

1 Like

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