Magisk-Modules-Repo / com.piyushgarg.rclone

251 stars 38 forks source link

Requesting help to troubleshoot where my install is going wrong. No automatic fuse mounts #107

Open MountainX opened 3 years ago

MountainX commented 3 years ago

After installing, rclone can list all the files at my remote server. But I am not getting the fuse mounts at any of the locations listed in the readme. I have run into a few issues during the install, so I will list my complete steps:

When I install the normal way using Magisk, I do not get the rclone binary. I opened this other issue:

rclone is zero bytes · Issue #106 · Magisk-Modules-Repo/com.piyushgarg.rclone

RESULT: rclone download fails with error:

curl: (60) SSL certificate problem: certificate has expired

My work-around is to download it from my computer and transfer it to my phone. This gets me past that issue and I can continue with the install and setup.

$ curl https://beta.rclone.org/version.txt
rclone v1.57.0-beta.5711.1e7db7193

After downloaded:

$ sftp -i ~/.ssh/mykey shell@192.168.1.1
sftp> put rclone_2021-10-12

Next, SSH into my phone as root:

cat /proc/cpuinfo
Processor       : AArch64 Processor rev 4 (aarch64)
processor       : 0
model name      : ARMv8 Processor rev 4 (v8l)
...
processor       : 7
model name      : ARMv8 Processor rev 1 (v8l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x800
CPU revision    : 1

Revision        : 0000
Hardware        : Qualcomm Technologies, Inc MSM8998

NOTE: it is ARM64 and I'm running LineageOS Android 9

Everything that follows is done on phone as root:

MODPATH="/data/adb/modules/com.piyushgarg.rclone"

mv /data/ssh/shell/rclone_2021-10-12 "$MODPATH"/rclone

chown root:root $MODPATH/rclone
chmod 755 $MODPATH
chmod -R 644 $MODPATH/*
chmod 755 $MODPATH/{fusermount,fusermount-wrapper.sh,service.sh,rclonew,rclone,syncd.sh,inotifywait}
ln -sf $MODPATH/rclone /sbin/rclone
ln -sf $MODPATH/rclonew /sbin/rclonew
ln -sf $MODPATH/fusermount /sbin/fusermount

ls -la /sbin/fusermount
lrwxrwxrwx 1 root root 50 2021-10-12 12:36 /sbin/fusermount -> /data/adb/modules/com.piyushgarg.rclone/fusermount

ls -la /sbin/rclonew
lrwxrwxrwx 1 root root 47 2021-10-12 12:36 /sbin/rclonew -> /data/adb/modules/com.piyushgarg.rclone/rclonew

ls -la /sbin/rclone
lrwxrwxrwx 1 root root 46 2021-10-12 12:36 /sbin/rclone -> /data/adb/modules/com.piyushgarg.rclone/rclone

:/data/ssh/root # ls -la /data/ssh/root/.config/rclone/mykey.p*
-rw------- 1 root root 411 2021-10-11 01:10 /data/ssh/root/.config/rclone/mykey.pem
-rw-r----- 1 root root 102 2021-10-11 01:10 /data/ssh/root/.config/rclone/mykey.pub

# ls -la $MODPATH
total 61064
drwxr-xr-x 3 root root     4096 2021-10-12 12:28 .
drwxr-xr-x 8 root root     4096 2019-04-18 12:04 ..
drwxrwxrwx 3 root root     4096 2021-10-12 12:21 .config
-rwxr-xr-x 1 root root    55256 2021-10-12 12:20 fusermount
-rwxr-xr-x 1 root root      306 2021-10-12 12:20 fusermount-wrapper.sh
-rwxr-xr-x 1 root root    67608 2021-10-12 12:20 inotifywait
-rw-r--r-- 1 root root    70696 2021-10-12 12:20 libandroid-support.so
-rw-r--r-- 1 root root      444 2021-10-12 12:20 module.prop
-rwxr-xr-x 1 root root 62271688 2021-10-12 12:28 rclone
-rwxr-xr-x 1 root root     4813 2021-10-12 12:20 rclonew
-rwxr-xr-x 1 root root    14543 2021-10-12 12:20 service.sh
-rw-r--r-- 1 root root        0 2021-10-12 12:20 skip_mount
-rwxr-xr-x 1 root root     2028 2021-10-12 12:20 syncd.sh

# file $MODPATH/fusermount
/data/adb/modules/com.piyushgarg.rclone/fusermount: ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), for Android 21, built by NDK r20 (5594570), not stripped

# file $MODPATH/rclone
/data/adb/modules/com.piyushgarg.rclone/rclone: ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), for Android 21, built by NDK r22b (7171670), stripped

/sbin/rclone config
(NOTE: config is completed and checked)

# cat /data/ssh/root/.config/rclone/rclone.conf
[pcloud]
type = pcloud
hostname = api.pcloud.com
token = {"access_token":"<REDACTED>","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}

[mysftpsrv]
type = sftp
host = myserver.com
user = myuser
key_file = /data/ssh/root/.config/rclone/mykey.pem

/sbin/rclone ls mysftpsrv:
(correctly lists all files)

# /sbin/rclone ls pcloud:
 16371465 Getting started with pCloud.pdf
   666846 images/friends.jpg
   189628 images/happy-family.jpg
    32905 images/in-the-sky.jpg
   500130 images/lovers.jpg
   238222 images/romance.jpg
   162388 images/sweet.jpg
  6319438 videos/pCloud.mp4
(correctly lists all files)

# echo $PATH
/system/bin:/system/xbin:/system/sbin:/data/adb/modules/ssh/usr/bin

mount -o rw,remount /

ln -sf $MODPATH/rclone /system/xbin/rclone
ln -sf $MODPATH/rclonew /system/xbin/rclonew
ln -sf $MODPATH/fusermount /system/xbin/fusermount

reboot phone

rclone ls pcloud:

Correctly lists all files. However, there is no mountpoint:

Check all possible mount points listed in the READE.me:

ls -la /sdcard/cloud/
ls -la /storage/cloud/
ls -la /mnt/cloud/

All give error: No such file or directory

Make the required mountpoint and set permissions:

mkdir -p /mnt/cloud/pcloud
chmod 775 -R /mnt/cloud/
chgrp -R sdcard_rw /mnt/cloud/

ls -la /mnt/cloud/
total 0
drwxrwxr-x  3 root sdcard_rw  60 2021-10-12 13:09 .
drwxr-xr-x 13 root system    280 2021-10-12 13:09 ..
drwxrwxr-x  2 root sdcard_rw  40 2021-10-12 13:09 pcloud

Do a manual mount:

rclone mount pcloud: /mnt/cloud/pcloud
2021/10/12 17:14:26 NOTICE: pcloud root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream

I am now able to access files from the remote server at /mnt/cloud/pcloud

However, the command above (rclone mount pcloud: /mnt/cloud/pcloud) does not return to the prompt, and mounting this way is not the correct solution, right?

Next, reboot phone and check again:

rclone ls pcloud:

(correctly lists all files)

ls -la /sdcard/cloud/
ls -la /storage/cloud/
ls -la /mnt/cloud/

For all: No such file or directory (again)

The fuse mounts are not being created. Any idea why?

Is there something I'm doing wrong?

From what I understand, the mounts should be done automatically. Is that correct? Or I am missing some steps?

MountainX commented 3 years ago

Is this the better approach?

google drive - How to mount rclone on Android? - Android Enthusiasts Stack Exchange

dezza1958 commented 2 years ago

Same issue, been through the troubleshooting and seems as if rclone (or dependent) is not mounting the cloud directory link at boot. There are others here far better skilled to work this out and the reason I started using the module was to avoid having to use termux to get this facility with my cloud drives

I have had this excellent module running till about 4 days ago, now no mountpoints.

I don't know whether it is relevant but i did dabble with RCX recently, wonder whether it replaced fusermount or component that may have interfered. Also noted on the rclone site that mounting on the mac binary is not supported anymore:-

"NOTE: This version of rclone will not support mount any more (see #5373). - " Doesn't make much sense for this utility!

MountainX commented 2 years ago

Imo rcx haven't caused it, RCx has nothing to do with mounting things. Maybe the rclone/fusermount binary need to be updated?

No, the rclone and fusermount binaries are working just fine. I have rclone mounts working with a Termux script. But the Magisk module is broken.

svdeepak99 commented 2 years ago

Imo rcx haven't caused it, RCx has nothing to do with mounting things. Maybe the rclone/fusermount binary need to be updated?

No, the rclone and fusermount binaries are working just fine. I have rclone mounts working with a Termux script. But the Magisk module is broken.

I installed latest stable rclone + libfuse2 from termux package but even if rclone isn't showing any error the mountpoint is empty. Seems like many people are having issie with this old module, can we continue this discussion in a telegram group?

Hey sure. I have created a telegram group for the exact same purpose. Please join here (@rihaq @MountainX @dezza1958): https://t.me/rclonemounterror

And I have mentioned the purpose of the group here: https://forum.rclone.org/t/no-mount-points-with-rclone-mount-magisk-module-on-android/26924/6?u=svdeepak99