Fusermount on android (rclone mount)

Search This thread

pmj_pedro

Member
Dec 20, 2014
37
14
Disclaymer: I am not responsible by what this binary can cause to your phone.

In the past month I have been struggling with getting "rclone mount" working on my phone, and after not finding anyway to have fuse working on my phone I decided to compile the fusermount.
Yoy should copy the binary to /system/bin or add to your path "export PATH=$PATH:/path_to_fusermount"

I use the source code from: https://github.com/LineageOS/android_external_fuse/tree/cm-14.1
and https://github.com/kirbyfan64/zdata/blob/master/fs/jni/fusermount.mk to compile the binary

In my case I can now use rclone in the following way (you still need to have root access), on a terminal (termux) for android:
Code:
su
rclone mount Box:/ /storage/cloud --vfs-cache-mode minimal --allow-other --gid 1015

Tested on:
  • Mi4c cm14.1 (android 7.1)
  • Huawei Mediapad M5 (android 8)
 

Attachments

  • fusermount_arm64-v8a.zip
    14.6 KB · Views: 2,091
  • fusermount_armeabi-v7a.zip
    15.6 KB · Views: 1,092

Hzz17

Member
Apr 28, 2014
40
0
Thank you very much. It's so nice that ican mount gdrive on my old phone. Helped me a lot.
 

GMMAnonymus

Member
May 23, 2016
12
1
25
Ajka
I'm also using magisk module on android 6.0, but I get
Code:
cannot locate symbol "__aeabi_memcpy"
, because of this I can't use this module at all as intended.
Mount folders are created, but are empty. I am able to manually send files to cloud strorage, but they don't show up locally. Also, I can see the mounted folders in bot ES file explorer and Termux.

Edit: Tried it on my other phone running CarbonRom 6.1 (android 8.1.0), and I face the same issue described before me. Termux can list files when cloud storage is mounted, but file explorers show empty folders.

Edit2: Google drive seems to be working on 8.1.0 with Solid Explorer File Manager, mega folder still shows up empty :/
 
Last edited:

darfri

Senior Member
Nov 13, 2008
931
61
OnePlus 6T
Has anyone got afwall? What to unblock? I'd hate to unblock multicomponent system apps.
Maybe a custom iptables script?
 
  • Like
Reactions: MtnX2

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
For people who are getting empty folders outside termux, is most likely because mount namespace seperation is enabled in their supersu or magisk. I don't use magisk so don't know the exact option but for supersu, just uncheck "Mount namespace seperation" in its settings and reboot and try after that.

I have successfully done a 64-bit on-device build inside termux for fusermount with the relevant patches. Its working fine for now and most likely will work better for people. I plan to release the binaries, the source code and tasker projects related to it hopefully in the next few days, but if someone needs the binaries earlier, let me know.
 
  • Like
Reactions: Geofferey

Geofferey

Senior Member
Jan 1, 2011
200
217
Long Beach, CA
@pmj_pedro Would it be possible for you to do a static compile? It might help with the missing symbols.

Code:
cannot locate symbol "__aeabi_memcpy"

@agnostic-apollo I am interested especially if the binary(s) have no depends & can work with Android M-P outside of Termux. Would it be possible to include arm as well?
 
Last edited:

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
@pmj_pedro Would it be possible for you to do a static compile? It might help with the missing symbols.

Code:
cannot locate symbol "__aeabi_memcpy"

@agnostic-apollo I am interested especially if the binary(s) have no depends & can work with Android M-P outside of Termux's. Would it be possible to include arm as well?


I initially was attempting a static compile within a ubuntu chroot in my phone but the static flags wouldn't work and it still linked to the "lib/arm-linux-gnueabihf/libc.so" and "/lib/ld-linux-armhf.so.3", which are glibc libs... i then decided to compile within termux itself since people would be using rclone with that anyways and dynamic linkage would hopefully not be a problem. For a 32bit compilation, i would have to look more into it cause that would require 32 libs/compiler dependencies. I tried in the morning but it failed as expected.

i have attached the termux patched source and 64bit fusermount. Instructions for termux compilation are inside the source zip... the source is the same as the OP... If someone could attempt compilation on a 32 bit phone, that would be quicker.

Edit: made some patches and improvements, use new binary.
 

Attachments

  • android_external_fuse_termux_patched_v2.zip
    258.6 KB · Views: 467
  • fusermount.zip
    20.8 KB · Views: 350
Last edited:
  • Like
Reactions: Geofferey

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
@pmj_pedro Would it be possible for you to do a static compile? It might help with the missing symbols.

Code:
cannot locate symbol "__aeabi_memcpy"

@agnostic-apollo I am interested especially if the binary(s) have no depends & can work with Android M-P outside of Termux. Would it be possible to include arm as well?

btw why do u need it outside termux, just curious... if u have root, u could call termux binaries from outside anyways, depending on selinux of course...
 
  • Like
Reactions: Geofferey

Geofferey

Senior Member
Jan 1, 2011
200
217
Long Beach, CA
@agnostic-apollo I'm a major contributor to the rclone mount for Android Magisk module which includes the fusermount binaries posted by the OP. :) Nobody has complained about the missing symbols in our module yet so I was hoping to nip the issue before any reports arrive.

In any event if your source / build uses Termux's libc etc I could just grab those libs and create a wrapper script with LD_LIBRARY_PATH specified. I will attempt to compile 32 bit on my S4 using your source when I get a chance.
 
Last edited:

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
@agnostic-apollo I'm a major contributor to the rclone mount for Android Magisk module which includes the fusermount binaries posted by the OP. :) Nobody has complained about the missing symbols in our module yet so I was hoping to nip the issue before any reports arrive.

In any event if your source / build uses Termux's libc etc I could just grab those libs and create a wrapper script with LD_LIBRARY_PATH specified. I will attempt to compile 32 bit on my S4 using your source when I get a chance.

Ah, check it out, looks pretty cool. yeah fixing bugs before bug reports arrive is always appreciated, but if there a no bugs reports that you are fixing with time, then it may look like you are not doing any work ;)

yeah exporting LD_LIBRARY_PATH would work and other than during compilation for makeconf.sh, termux $PREFIX patches are not needed in the source code. The hardcoded binaries are never called if mtab is disabled or platform is not BSD. Also configure.ac does need the $PREFIX patch for setting paths which are read by util/Makefile.am for installing mount.fuse, udev and init.d scripts but those are only needed when "make install" is run and we don't need to run it just to get fusermount. So basically a static compile is possible which does not have hardcoded dependencies on termux binary path, provided that a static compile actually works. You could probabky copy the libs from termux too like you said. I'll have to first have to revert the prefix patches again though.

Few questions, do u sometimes get "transport end point not connected" error while unmounting?
and any reason why the world readable /sdcard/.rclone dir is used as default for storing non encrypted rclone config files? could be a security issue for some ;)

In your rclone-mount script, CACHE and CACHE_BACKEND dirs are created but different ones passed to rclone mount command, is that wrong or am i missing something?
 
Last edited:

Geofferey

Senior Member
Jan 1, 2011
200
217
Long Beach, CA
@agnostic-apollo

do u sometimes get "transport end point not connected" error while unmounting?

Sorry for the late response I've been very busy...

I think I used to get that but not anymore since compiling using ncw's instructs for Termux, That and I unmount by killing rclone first...

any reason why the world readable /sdcard/.rclone dir is used as default for storing non encrypted rclone config files? could be a security issue for some ;)

There are several reasons... Please correct me if I am wrong on any of these points.

1. Simplicity. It's easier for users to place .conf in /sdcard/.rclone/rclone.conf as opposed to /data/adb/modules/com.piyushgarg.rclone/.config/rclone/rclone.conf etc.

2. Security. While it is true the folders/files in SDcard have world read/write perms there are plenty of other security mechanisms in place to help prevent access to files on SDcard.

A. App permission can stop apps without storage permissions from accessing the SDcard & even stops some with perms from reading contents.

B. SElinux stops processes that are not in proper context from accessing SDcard.

C. Encyrption helps protect contents on SD card from physical acquisition in the event of device theft or seizure.

3. /sdcard/ is a great place to determine if device has successfully decrypted before attempting to mount remotes which can be a dangerous operation, especially if binding to internal storage is enabled.

4. Rooting completely compromises security & most users do not take any steps to properly re-secure their devices afterwards. Leaving things like persistent adb enabled, TWRP, selinux disabled, encyrption etc.

5. I actually plan on keeping the .conf entirely out of module directory in future.


If users keep security features such as selinux / encryption enabled, adb disabled & work with them instead of disabling it's a pretty safe place. Otherwise security should already be considered compromised and then it doesn't really matter where you place it at that point. If the goal is keeping a forensic analyst from obtaining data you probably shouldn't root at all. They LOVE rooted phones.

Sorry I might've started rambling. You got me started on security :cyclops:

In your rclone-mount script, CACHE and CACHE_BACKEND dirs are created but different ones passed to rclone mount command, is that wrong or am i missing something?

I'm not sure. Maybe it is. Caching has been one of my biggest problems due to lack of understanding. I think I may have corrected this upcoming version tho.

BTW caching is something you should probably use very sparingly. It's extremely hard on internal storage and it will eat up unecessary amounts of data.


Now my question for you... Would you be willing to help contribute the necessary static fusermount bins to our project? It's one of the last things I need to make it damn near universally compatible. At the least I would need an arm build, but prefer arm, arm64. I'm not much on building anything C from source unless it's ready to go and I don't have to touch anything. I only do those things in times of great despair ;). To be honest I only understood half the readme & I'm scared of it lol. If you're down for the cause let me know and we can get you onboard as contributor. Do you have GitHub?

EDIT: I decided to quit being lazy and tried a static compile with your source. Using "./configure --enable-static=yes". I first tried using your binary that you uploaded and it complained about libs. Tried the one I compiled with flag and it seems to have just worked. No modification to your src. Doesn't mean it fixes the problem tho. :/

EDIT 2:

Turns out it isn't possible to compile static using Termux? The binary must've built against local libc because I didn't need libandroid-support.so until I tried it on a different device. Anyways I'm still gonna use your bins in update with LD_LIBRARY_PATH and libandroid-support.so FROM Termux. I will definitely credit you as well & I probably still need your help.
 
Last edited:

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
@agnostic-apollo I'm a major contributor to the rclone mount for Android Magisk module which includes the fusermount binaries posted by the OP. :) Nobody has complained about the missing symbols in our module yet so I was hoping to nip the issue before any reports arrive.

In any event if your source / build uses Termux's libc etc I could just grab those libs and create a wrapper script with LD_LIBRARY_PATH specified. I will attempt to compile 32 bit on my S4 using your source when I get a chance.

@agnostic-apollo



Sorry for the late response I've been very busy...

I think I used to get that but not anymore since compiling using ncw's instructs for Termux, That and I unmount by killing rclone first...



There are several reasons... Please correct me if I am wrong on any of these points.

1. Simplicity. It's easier for users to place .conf in /sdcard/.rclone/rclone.conf as opposed to /data/adb/modules/com.piyushgarg.rclone/.config/rclone/rclone.conf etc.

2. Security. While it is true the folders/files in SDcard have world read/write perms there are plenty of other security mechanisms in place to help prevent access to files on SDcard.

A. App permission can stop apps without storage permissions from accessing the SDcard & even stops some with perms from reading contents.

B. SElinux stops processes that are not in proper context from accessing SDcard.

C. Encyrption helps protect contents on SD card from physical acquisition in the event of device theft or seizure.

3. /sdcard/ is a great place to determine if device has successfully decrypted before attempting to mount remotes which can be a dangerous operation, especially if binding to internal storage is enabled.

4. Rooting completely compromises security & most users do not take any steps to properly re-secure their devices afterwards. Leaving things like persistent adb enabled, TWRP, selinux disabled, encyrption etc.

5. I actually plan on keeping the .conf entirely out of module directory in future.


If users keep security features such as selinux / encryption enabled, adb disabled & work with them instead of disabling it's a pretty safe place. Otherwise security should already be considered compromised and then it doesn't really matter where you place it at that point. If the goal is keeping a forensic analyst from obtaining data you probably shouldn't root at all. They LOVE rooted phones.

Sorry I might've started rambling. You got me started on security :cyclops:



I'm not sure. Maybe it is. Caching has been one of my biggest problems due to lack of understanding. I think I may have corrected this upcoming version tho.

BTW caching is something you should probably use very sparingly. It's extremely hard on internal storage and it will eat up unecessary amounts of data.


Now my question for you... Would you be willing to help contribute the necessary static fusermount bins to our project? It's one of the last things I need to make it damn near universally compatible. At the least I would need an arm build, but prefer arm, arm64. I'm not much on building anything C from source unless it's ready to go and I don't have to touch anything. I only do those things in times of great despair ;). To be honest I only understood half the readme & I'm scared of it lol. If you're down for the cause let me know and we can get you onboard as contributor. Do you have GitHub?

EDIT: I decided to quit being lazy and tried a static compile with your source. Using "./configure --enable-static=yes". I first tried using your binary that you uploaded and it complained about libs. Tried the one I compiled with flag and it seems to have just worked. No modification to your src. Doesn't mean it fixes the problem tho. :/

EDIT 2:

Turns out it isn't possible to compile static using Termux? The binary must've built against local libc because I didn't need libandroid-support.so until I tried it on a different device. Anyways I'm still gonna use your bins in update with LD_LIBRARY_PATH and libandroid-support.so FROM Termux. I will definitely credit you as well & I probably still need your help.

I'll leave a detailed reply later, its 9 in the morning, i have to sleep now ;)

fyi you can use "ldd util/fusermount" to find the libraries its linking against... and can run "export LD_LIBRARY_PATH=/system/lib64:/system/lib" before running a binary in termux...if it fails with library errors, it requires termux libraries... restart termux or restore LD_LIBRARY_PATH afterwards or other termux stuff wont work...

anyways i did an on-device build of fusermount binary that does not depend on termux/libandroid-support... reverted most of the previous patches and added a few more with new build instructions.... the fusermount binary still depends on /system/lib* libc.so and libdl.so but those are provided by every phone and would run fine on most phones, its basically like the OP one but symbol errors could be there in some devices... truly static might be possible but on device build might not be possible and will probably require cross-compile if even possible... will look into it later

check out the new binary on both devices and let me know...
 

Attachments

  • android_external_fuse_termux_patched_v4.zip
    259 KB · Views: 147
  • fusermount.zip
    20.7 KB · Views: 142

darfri

Senior Member
Nov 13, 2008
931
61
OnePlus 6T
I am using rclone mount magisk module
It cannot reach the host (its written in the log) when I have "apps running as root" blocked in Afwall
I really hate to allow all root apps to access inet. I would like to allow only rclone access only single local ip


What custom script would help?
It is ordinary iptables script
 
Last edited:

tehrzky

Senior Member
Oct 24, 2010
161
22
noob here. but i can follow. how to mount my google drive to my phone alongside to my sdcard i just want to use this as a failsafe to my files, so far i followed the step from rclone using google drive. since some apps has auto backup on phone only and thinking this is the best way to sync my phone and app settings without manually checking and uploading those files. but the problem is im stuck on this error. (screenshot) hope someone can help me. ty

im using magisk rclone module
 

Attachments

  • Screenshot_2019-08-01-15-03-57-044_yarolegovich.materialterminal.png
    Screenshot_2019-08-01-15-03-57-044_yarolegovich.materialterminal.png
    226.6 KB · Views: 348
Last edited:

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
@Geofferey
Well i managed to cross compile for all archs using NDK targeting API 21. Cannot target an API older than that due to missing function implementation in Android bionic older than that. But binaries will need to be tested on different archs and android versions/devices. You can download the binaries from my github release here. You or others can compile them yourself if they want, instructions are here.

Moreover I still couldn't manage to do a static compile. I doubt it is gonna be possible, atleast easily since Android bionic is probably not meant for that. mucl is the best hope i think, since it fully supports static linking.
However the binaries compiled by me have less library dependencies than the ones OP posted so it could be better for some, even though in OP's case, the binaries are linking to android system libraries so shouldn't be a problem in most cases. FYI I found that "ldd" command is not reliable for finding dynamic linking. Use "readelf -d "fusermount" | grep NEEDED"
The OP binary dynamic linking:
Code:
ARCH=arm64-v8a
 0x0000000000000001 (NEEDED)             Shared library: [libc.so]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so]

ARCH=armeabi-v7a
 0x00000001 (NEEDED)                     Shared library: [libc.so]
 0x00000001 (NEEDED)                     Shared library: [libm.so]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so]
 0x00000001 (NEEDED)                     Shared library: [libdl.so]

The binary dynamic linking compiled by me:
Code:
Build Info:
NDK_FULL_VERSION=20.0.5594570
C_COMPILER=clang
HOST_TAG=linux-x86_64
BUILD_TIMESTAMP=2019-07-31 08.20.46

ARCH_SRC=arm64-v8a
API_LEVEL=21
FUSERMOUNT=fusermount-arm64-v8a
Binary Info:
fusermount: setuid ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, not stripped
Shared Libraries:
 0x0000000000000001 (NEEDED)             Shared library: [libc.so]

ARCH_SRC=armeabi
API_LEVEL=21
FUSERMOUNT=fusermount-armeabi
Binary Info:
fusermount: setuid ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
Shared Libraries:
 0x00000001 (NEEDED)                     Shared library: [libdl.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so]

ARCH_SRC=armeabi-v7a
API_LEVEL=21
FUSERMOUNT=fusermount-armeabi-v7a
Binary Info:
fusermount: setuid ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
Shared Libraries:
 0x00000001 (NEEDED)                     Shared library: [libdl.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so]

ARCH_SRC=x86
API_LEVEL=21
FUSERMOUNT=fusermount-x86
Binary Info:
fusermount: setuid ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
Shared Libraries:
 0x00000001 (NEEDED)                     Shared library: [libc.so]

ARCH_SRC=x86-64
API_LEVEL=21
FUSERMOUNT=fusermount-x86-64
Binary Info:
fusermount: setuid ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, not stripped
Shared Libraries:
 0x0000000000000001 (NEEDED)             Shared library: [libc.so]

Alas, the things that need to be done just get binaries to run on our phones properly. If it were only me that had to use fusermount, it wouldn't be a problem at all, i would have just run one my scripts to merge my chroot ubuntu distro's rootfs with my android's rootfs and just run the ubuntu's fusermount and it would have worked fine for me. The ubuntu's libraries would have been dynamically linked to the binary since the ubuntu libraries would be linked to /lib and I wouldn't have to do any compilation at all. Now if it were only this simple for everybody...

Btw i read your previous comments, will try replying to them once i wake up, been too busy with this stuff.
 

agnostic-apollo

Senior Member
Jun 2, 2015
236
88
I think I used to get that but not anymore since compiling using ncw's instructs for Termux, That and I unmount by killing rclone first...

Interesting, I use rclone supplied by termux apt repository. I get the errors if the mount point is busy like root explorer has opened up a directory inside the mount point and I stop the rclone mount command. The rclone mount command exits with resource is busy errors as expected and if i try to unmount the mount point manually i get "transport endpoint" errors, i have run a lazy unmount to get the mount point to unmount.

There are several reasons... Please correct me if I am wrong on any of these points.

1. Simplicity. It's easier for users to place .conf in /sdcard/.rclone/rclone.conf as opposed to /data/adb/modules/com.piyushgarg.rclone/.config/rclone/rclone.conf etc.

2. Security. While it is true the folders/files in SDcard have world read/write perms there are plenty of other security mechanisms in place to help prevent access to files on SDcard.

A. App permission can stop apps without storage permissions from accessing the SDcard & even stops some with perms from reading contents.

B. SElinux stops processes that are not in proper context from accessing SDcard.

C. Encyrption helps protect contents on SD card from physical acquisition in the event of device theft or seizure.

3. /sdcard/ is a great place to determine if device has successfully decrypted before attempting to mount remotes which can be a dangerous operation, especially if binding to internal storage is enabled.

4. Rooting completely compromises security & most users do not take any steps to properly re-secure their devices afterwards. Leaving things like persistent adb enabled, TWRP, selinux disabled, encyrption etc.

5. I actually plan on keeping the .conf entirely out of module directory in future.


If users keep security features such as selinux / encryption enabled, adb disabled & work with them instead of disabling it's a pretty safe place. Otherwise security should already be considered compromised and then it doesn't really matter where you place it at that point. If the goal is keeping a forensic analyst from obtaining data you probably shouldn't root at all. They LOVE rooted phones.

Sorry I might've started rambling. You got me started on security :cyclops:

lolz no apologies needed, I ramble a lot too, not that anybody listens or understands :p

1. People in most cases are going to put the rclone file once, so going to the magisk module directory should not be a problem.

2. Most apps are granted storage permissions by users in recent android versions, and they are granted without explicit grants in old versions.... /sdcard is basically fuse/sdcardfs mounted to /storage/emulated/0, so all apps having storage permissions would have access to /storage/emulated/0/.rclone and any other directory except the /storage/emulated/0/Android of course... These popular apps are the main security risk tbh, who most likely monitor everything on the sdcard... and selinux wouldn't do anything for sdcard if storage permissions are granted.
And if a person has physical access the then it probably doesn't matter where its stored, but storing it in a root accessible would most likely still be better...

3. You could use the mount command or /proc/mounts to see active mounts to detect what has been mounted till now...

4. Yeah if your threat is a physical access than just keep your bootloader locked and encryption enabled and live a miserable life without all the benefits of rooting. I don't want to live that life, at all... I would be more worried about apps than physical access. And mostly encryption is not supported by twrp so if your device is lost, consider all the data gone if u r using a decrypted device flr using update/backup. Leaving adb enabled normally shouldn't be a problem unless you lose your authorized PC as well, then u probably have much bigger things to worry about ;)

5. I am not familiar with magisk module access but /data/.rclone should be fine to use instead... Only root apps would have access. I'm not sure what selinux contexts magisk module directory has, it might be safer against root apps who have not been granted root access through magisk.


I'm not sure. Maybe it is. Caching has been one of my biggest problems due to lack of understanding. I think I may have corrected this upcoming version tho.

BTW caching is something you should probably use very sparingly. It's extremely hard on internal storage and it will eat up unecessary amounts of data.

yeah caching could be hard for the device and will need to be looked over more. Wakelocks would be an issue too. I tried using minimal mode but i need to do more testing. I was getting some lags, might be related. Mobile data issues could be there too, my tasker based projects can most likely handle those by remounting. rclone remote control commands can only drop caches currently, not change their modes. Will need to ask the dev to add it if needed.


Now my question for you... Would you be willing to help contribute the necessary static fusermount bins to our project? It's one of the last things I need to make it damn near universally compatible. At the least I would need an arm build, but prefer arm, arm64. I'm not much on building anything C from source unless it's ready to go and I don't have to touch anything. I only do those things in times of great despair ;). To be honest I only understood half the readme & I'm scared of it lol. If you're down for the cause let me know and we can get you onboard as contributor. Do you have GitHub?

yeah I'm up for contributing to the project but only after I have completed and released my projects, gonna take a few days atleast. And yeah i have got github as u already know by now...

lolz C is not for everybody, but thats how I started programming with so I can understand it at most times, understanding the purpose of the code is another issue ;)
 
  • Like
Reactions: Shihabus Sakib Rad

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Disclaymer: I am not responsible by what this binary can cause to your phone.

    In the past month I have been struggling with getting "rclone mount" working on my phone, and after not finding anyway to have fuse working on my phone I decided to compile the fusermount.
    Yoy should copy the binary to /system/bin or add to your path "export PATH=$PATH:/path_to_fusermount"

    I use the source code from: https://github.com/LineageOS/android_external_fuse/tree/cm-14.1
    and https://github.com/kirbyfan64/zdata/blob/master/fs/jni/fusermount.mk to compile the binary

    In my case I can now use rclone in the following way (you still need to have root access), on a terminal (termux) for android:
    Code:
    su
    rclone mount Box:/ /storage/cloud --vfs-cache-mode minimal --allow-other --gid 1015

    Tested on:
    • Mi4c cm14.1 (android 7.1)
    • Huawei Mediapad M5 (android 8)
    2
    Still withought succes.
    I use command
    Code:
    rclone mount gcache: /mnt/runtime/write/emulated/0/gdrive --uid=0 --gid=9997 --umask=022 --allow-other --cache-db-purge --allow-non-empty --buffer-size 64M --dir-cache-time 72h --drive-chunk-size 16M  --timeout 1h  --vfs-cache-mode minimal --vfs-read-chunk-size 128M --vfs-read-chunk-size-limit 1G &
    So I set permissions like another visible folder. But then my cloud files are visible only for root user.
    What command should be correct and where I must mount ?
    Please help.

    alas...

    you are supposed to run rclone mount command to some dir outside the .../runtime/.../emulated/* directory like inside /mnt/grdrive and then run "mount -o bind" commands from /mnt/gdrive to all 3 runtime dirs

    I have written a few bash scripts and tasker projects that handles all this safely... the bash scripts can be uploaded in a day or two, have to do some testing and write documentation... let me know if anybody needs them... testers would be helpful actually...

    For now, try following the following...
    hopefully it should help and work for you, working for me. I haven't tested the android version <6 code but it should work...


    Code:
    ###rclone mount commands must be run from global mount namespace, otherwise mounts will not be seen outside the terminal/shell and you will get empty directories in other apps
    #check if you are in global namespace
    [[ "$(readlink /proc/1/ns/mnt)" == "$(readlink /proc/self/ns/mnt)" ]] && echo "using global mount namespace" || "not using global mount namespace"
    
    #If not, then in your superuser app, disable mount namespace separation or enable global mount namespace and reboot device
    #SuperSu Settings -> Uncheck "Mount namespace separation"
    #Magisk  Settings -> Set "Mount Namespace Mode" to "Global"
    
    
    
    ####mount
    #remount android rootfs as rw
    mount -o rw,remount /
    
    #create main mount point
    mkdir -p "/mnt/rclone_gdrive"
    
    #run rclone mount command
    rclone mount --daemon --allow-other "gdrive:" "/mnt/rclone_gdrive"
    
    #create bind mount points so that all apps can see remote
    #create bind mount point directory and set permissions
    mkdir -p "/data/media/0/rclone_gdrive"
    chown media_rw:media_rw "/data/media/0/rclone_gdrive"
    chmod 0700 "/data/media/0/rclone_gdrive"
    
    #run bind mount commands for android version >=6
    mount -o bind "/mnt/rclone_gdrive" "/mnt/runtime/default/emulated/0/rclone_gdrive"
    mount -o bind "/mnt/rclone_gdrive" "/mnt/runtime/read/emulated/0/rclone_gdrive"
    mount -o bind "/mnt/rclone_gdrive" "/mnt/runtime/write/emulated/0/rclone_gdrive"
    
    #run bind mount commands for android version <6
    mount -o bind "/mnt/rclone_gdrive" "/data/media/0/rclone_gdrive"
    mount -o bind "/mnt/rclone_gdrive" "/storage/emulated/0/rclone_gdrive"
    
    #remount android rootfs back as ro
    mount -o ro,remount /
    
    #note that 
    #android version >=6 uses runtime permissions model and hence there are runtime mounts
    "/data/media/0" is the main ext4 filesystem which is emulated/mounted on "/mnt/runtime/{default,read,write}/emulated/0" and "/storage/emulated/0" using sdcardfs filesystem
    #apps can only see the "/storage/emulated/0" depending on the permissions the app has
    #bind mounting on all 3 runtime directories may be necessary depending on the device
    #in my LG G5 7.0, it is necessary, and bind mounting on "/mnt/runtime/default/emulated/0" automatically creates the mount on "/storage/emulated/0"
    #if that isn't being created then manually create it
    #for versions below use install-time permissions model and there are no runtime mounts
    #instead "/data/media/0" is just mounted at "/storage/emulated/0" using fuse filesystem
    #the "0" indicated the user "0"
    
    
    
    ###unmount
    #kill rclone mount command
    pgrep -f "rclone mount .* /mnt/rclone_gdrive.*" | xargs kill
    
    #run mount command to check all active mounts
    mount
    
    #if "gdrive: /mnt/rclone_gdrive" is still listed, it means rclone mount command quit with unmounting it
    #this could be because some process like your file browser was using the mount point when rclone mount command was killed
    #try unmounting main mount point manually
    umount "/mnt/rclone_gdrive"
    #you may get target or resource is busy errors
    #run fuser to kill all processes using mount point
    fuser -mks "/mnt/rclone_gdrive"
    #then unmount
    umount "/mnt/rclone_gdrive"
    #if instead you got transport endpoint not connected errors
    #then lazy unmount
    umount -l "/mnt/rclone_gdrive"
    #invalid arguments errors would mean that mount point is not mounted
    
    #unmount all bind mount points for android version >=6
    umount "/mnt/runtime/default/emulated/0/rclone_gdrive"
    umount "/mnt/runtime/read/emulated/0/rclone_gdrive"
    umount "/mnt/runtime/write/emulated/0/rclone_gdrive"
    
    #run bind mount commands for android version <6
    umount "/data/media/0/rclone_gdrive"
    umount "/storage/emulated/0/rclone_gdrive"
    
    
    ###refresh rclone mount point so that any changes in remote can be seen
    #sending SIGHUP to rclone mount command makes it drop all caches
    #otherwise changes appear after cache timeout is over
    pgrep -f "rclone mount .* /mnt/rclone_gdrive.*" | xargs kill -s SIGHUP
    1
    Has anyone got afwall? What to unblock? I'd hate to unblock multicomponent system apps.
    Maybe a custom iptables script?
    1
    For people who are getting empty folders outside termux, is most likely because mount namespace seperation is enabled in their supersu or magisk. I don't use magisk so don't know the exact option but for supersu, just uncheck "Mount namespace seperation" in its settings and reboot and try after that.

    I have successfully done a 64-bit on-device build inside termux for fusermount with the relevant patches. Its working fine for now and most likely will work better for people. I plan to release the binaries, the source code and tasker projects related to it hopefully in the next few days, but if someone needs the binaries earlier, let me know.
    1
    I get an error
    Using rclone installed by magisk 20.4 on xperia xz2 compact Android 9
    type = dropbox
    token = {"access_token" deleted this ,"token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
    --------------------
    y) Yes this is OK (default)
    e) Edit this remote
    d) Delete this remote
    y/e/d> y
    2020/07/19 11:51:11 Failed to save config after 10 tries: Failed to create temp file for new config: open /.rclone.conf683676049: read-only file system
    1|:/storage/emulated/0/Android/data/com.sonelli.juicessh/files #

    What can i do?
    Wait for it to be updated with a fix for config file location. The root location "/.rclone" can't be created because of permissions. It should be saved to sdcard/.rclone