OneDrive Mount root vs User

What is the problem you are having with rclone?

Mounting as root (i.e. an /etc/fstab entry using x-systemd.automount) takes considerably longer than mounting as a user. See section after the template for more details.

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

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

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

Microsoft OneDrive

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

mount -av

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

[OneDrive1]
type = onedrive
client_id = XXX
client_secret = XXX
auth_url = https://login.microsoftonline.com/XXX/oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/XXX/oauth2/v2.0/token
token = XXX
drive_id = XXX
drive_type = business

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

coanghel@wyse-server-01:/bin$ mount -av
/                        : ignored
/boot                    : already mounted
/boot/efi                : already mounted
none                     : ignored
/mnt/nvram               : already mounted
/external/drive1         : already mounted
2024/01/22 11:20:46 DEBUG : rclone: Version "v1.65.1" starting with parameters ["/sbin/mount.rclone" "mount" "OneDrive1:Data" "/onedrive/onedrive_1" "--vfs-cache-mode=full" "--allow-other" "--uid=1000" "--gid=1000" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--daemon-wait=180" "--verbose=3" "--daemon"]
2024/01/22 11:20:46 DEBUG : Creating backend with remote "OneDrive1:Data"
2024/01/22 11:20:46 DEBUG : Using config file from "/etc/rclone/rclone.conf"
2024/01/22 11:20:47 DEBUG : rclone: Version "v1.65.1" finishing with parameters ["/usr/bin/rclone" "mount" "OneDrive1:Data" "/onedrive/onedrive_1" "--vfs-cache-mode=full" "--allow-other" "--uid=1000" "--gid=1000" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--daemon-wait=180" "--verbose=3" "--daemon"]
/onedrive/onedrive_1     : successfully mounted
coanghel@wyse-server-01:/bin$ umount /onedrive/onedrive_1 
coanghel@wyse-server-01:/bin$ sudo mount -av
/                        : ignored
/boot                    : already mounted
/boot/efi                : already mounted
none                     : ignored
/mnt/nvram               : already mounted
/external/drive1         : already mounted
2024/01/22 11:21:09 DEBUG : rclone: Version "v1.65.1" starting with parameters ["/sbin/mount.rclone" "mount" "OneDrive1:Data" "/onedrive/onedrive_1" "--vfs-cache-mode=full" "--allow-other" "--uid=1000" "--gid=1000" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--daemon-wait=180" "--verbose=3" "--daemon"]
2024/01/22 11:21:09 DEBUG : Using fallback PATH to run fusermount
2024/01/22 11:21:09 DEBUG : Creating backend with remote "OneDrive1:Data"
2024/01/22 11:21:09 DEBUG : Using config file from "/etc/rclone/rclone.conf"
2024/01/22 11:22:37 DEBUG : rclone: Version "v1.65.1" finishing with parameters ["/usr/bin/rclone" "mount" "OneDrive1:Data" "/onedrive/onedrive_1" "--vfs-cache-mode=full" "--allow-other" "--uid=1000" "--gid=1000" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--daemon-wait=180" "--verbose=3" "--daemon"]
/onedrive/onedrive_1     : successfully mounted

Additional Details

Almost lost my mind troubleshooting this one. What happened is that I initially mounted rclone using mount -av and everything was working well so said awesome and rebooted the system to confirm... but the mount failed. This is the relevant line in my /etc/fstab

# rClone Mounts
OneDrive1:/Data /onedrive/onedrive_1 rclone rw,nofail,_netdev,x-systemd.automount,args2env,vfs_cache_mode=full,allow-other,uid=1000,gid=1000,config=/etc/rclone/rclone.conf,cache_dir=/var/cache/rclone 0 0

Eventually I found what was happening was that I was getting a daemon timeout... which I could work around by setting --dameon-wait to either 0 or a larger than default number like 180... but this then begs the question: why does the rclone command take 1 second to complete when run as a user, but almost 2 minutes when run by root?

In both case please generate debug logs and post here. It should indicate what exactly is causing this behaviour.

It sure did:

2024/01/22 15:06:50 ERROR : Failed to create vfs cache - disabling: failed to create data cache directory: mkdir /var/cache/rclone/vfs: permission denied

I mistakenly thought that setting --vv would give me the same level of debug.

After correcting the permission issue it looks like it takes the same amount of time when I run as user vs root.

1 Like

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