yashsingh1/xdaforums huggingface dataset:
[Magisk] Hooin Kyoma:
Hi guys, I made new "fix3" version if anyone interested:

- magisk 20.4 support (magisk 20.0+ is requied starting from this version)

And some fixes for those who using partitions and/or images:

- loop and part now support both EXT2/3/4 and FAT/exFAT file systems, and loop accepts mount options (loop -o ...) like part does

- better detection file system of partitions and loop images (using blkid if fstype fails)

- fixed problems with permissions when mounting (ex)FAT and EXTfs partitions/images (using better mount options, sdcardfs and more of android storage "views" black magic)

You can part/loop directly to target folder (part /dev/block/mmcblk1p2 $intsd/Viber) or mount it aside (part /dev/block/mmcblk1p2 /mnt/flash), declare as $extsd (exstsd_path=/mnt/flash) and then bind/target folders (target Viber, from_to Viber .Viber, etc)

Tested with Carbon 8.0 (Android 10, AOSP-based) on my ancient Xperia Z3 Compact

zip-file attached to my original post

JUST FOR INFO (UPDATED after "fix4" released in my next post below):

Hardcoded mount options for initial mounting of partitions and loop images:

for all FS: nosuid,nodev,noexec,context=u:object_r:sdcardfs:s0

+ for (ex)FAT: uid=0,gid=1023gid=9997,umask=0007

+ for EXT2/3/4: changing owner:group of root directory to 0:1023 0:9997 and perms to rwxrwxr-x - you should know this if you use mounted EXTfs-devices somewere else. This will allow you to create and delete newly created or empty folders in the root of mounted EXFfs storage, but for existed folders you need to do chown -R 0:9997 <mountpoint> and chmod -R 775 <mountpoint> by hand at least once.

These changes should help with access to mounted storages in recent androids.

And additional options when binding devices and folders: gid=9997,mask=6

Also, here is another interesting tool for binding folders: https://bindfs.org (but see "known issues" at bottom). May be I'll try switch to it if encounter problems with permissions in next android updates. If I don't buy new phone with 128+ gigs of internal memory soon :)
[Magisk] 0LDST4R:
Confirmed, works on my Z3C with CarbonRom Q fine.

Thanks bro... :svetius:
[Magisk] Hooin Kyoma:
Version "fix4" with small changes for part/loop users (upgrade from "fix3" is not mandatory if you have no problems):

- added some extra checks in loop() and part() functions

- loop now support encrypted images ("encrypted.img--L,...", same as part)

- simplified mounting routine in the code (since sdcardfs doesn't help with access anyway, only using right mount perms does)

Added to original post.

Remember, in case if you got infinite bootloop you always can disable this magisk module by creating empty file named "disable" in /data/adb/modules/fbind folder using File manager or ADB from your TWRP.
[Magisk] wilsonhlacerda:
Hi [MENTION=4703148]Hooin Kyoma[/MENTION] thanks for your fix! I'll try it later with Magisk 20.4 after a long time not using fbind.

By the way, how about you and [MENTION=5228676]VR25[/MENTION] work together, I mean, help each other (and maybe other devs too) to maintain this fantastic tool up to date officially?

Maybe even improve it with new features.

And thus have your + [MENTION=5228676]VR25[/MENTION] work released, recognized by lots of users and upto date on official Magisk repository? Lot of Magisk users do not read XDA modules' threads.

Thanks!
[Magisk] 0LDST4R:
Totally agree. I can't live without this module. Maybe [MENTION=5228676]VR25[/MENTION] is busy with real live in these terrible corona times. A coop between [MENTION=4703148]Hooin Kyoma[/MENTION] and VR25 is a big benefit for us users.
[Magisk] Hooin Kyoma:
Well, I'm not really intended to be a coder or something. Same as [MENTION=5228676]VR25[/MENTION] I usually busy with real life things. I have to dive into fbind time to time because I really need this tool, at least until I buy new phone. I heard VR25 work on some complete new framework which is will be used in fbind as well along with his other projects, so my "fixes" most likely will not be merged in future fbind releases. But if this will not happen in near future, I'll try to contact VR25 and/or cooperate/fork this tool to make it available officially in magisk repo. Thanks for idea.
[Magisk] samhhmobil:
Just a question, how to install your fix'ed version.

Do I need to install original fbind-zip via TWRP first, and after that your fix?

Or

do I have to install your fix-zip directly in TWRP without the original fbind-zip?

Or... some other way?

Thanks a lot,

samhhmobil
[Magisk] The_Walking_Playground:
Hi,

Why not just install in Magisk Manager?

TWP
[Magisk] Hooin Kyoma:
Just install from Magisk Manager. No need to pre-install anything.

I did not test installing from TWRP, so MM is recommended.
[Magisk] theredbaron1834:
I thank you very much for tthe work you have done however. It is very much appreciated, and a much better solution then my hackame script and an app to launch it after boot.
[Magisk] fcoaaron89:
Hi! I'm using fix4 in Android 9 (EMUI 9.1 in Huawei Mate 10) with Magisk 20.4 and I'm having a little problem, it mounts well the WhatsApp folder from external SD to internal, but WhatsApp cant write anything to the folder (downloads of media fails). When I check permissions of mounted folder in a terminal emulator, I see rwxr-xr-x and root:everybody permissions, when other folders have root:sdcard_rw. But comparing with other phone running Android 8, the main problem I see is that the folder should mount with rwxrwx--x permissions, so the group "everybody" can write to the folder, I suppose that the current user is included in that group.

Can this be fixed in config so it mounts with correct permissions at boot time?
[Magisk] Hooin Kyoma:
Hi. fbind actaully calling `mount -o rbind ...` when binding external folders to internals. So permissions of binded folder are same as permissions of external folder. Is your external storage is default Android's fat/exfat auto-mounted SD card? Or a mounted partition/image of yours? What intial permissions of external WhatsApp folder before binding?

I have Huawei Nova 2, will try your scenario with EMUI (9 or 8, not sure) tonight or tomorrow when I get spare time.
[Magisk] fcoaaron89:
Hi. I didn't think about looking at the permissions of the source folder, I'll check it.

However, in Android 8 I have seen that the permissions of the source folder are rwxr-xr-x and the destination rwxrwxr-x, but there I am using the original fbind of this post, without the fixes. Also, the Android 8 device is a LG G6, not EMUI, but fbind was working properly in EMUI 8 on the Huawei Mate 10.
[Magisk] fcoaaron89:
I checked the source folder permissions and are correct: rwxrwxr-x, but for some reason after mounting, the destination have rwxr-xr-x. The source folder is in a FAT partition of microSD card, if I remember well.

I attach screenshots of the source folder permissions before mounting, of what happens when mounting with "fbind -m" and the destination folder permissions after mounting.
[Magisk] fcoaaron89:
Remaining screenshots...
[Magisk] zdoe:
how to install your fixed version from magisk manager

only tried twrp so far and that doesn't work.
[Magisk] RootedLee:
Magisk Manager 7.5.1 -> Downloads -> Search -> fbind: No modules found!

Also: https://github.com/Magisk-Modules-Repo/fbind (link from this thread's first posting): 404/ dead

This project has decayed and officially dropped out of Magisk?
[Magisk] 0LDST4R:
Read the last few pages please. ;)
[Magisk] RootedLee:
What is this - Punch and Judy show? I sure won't. Either the thread starter or a mod can update the entry posting with current information. I figured out what I needed anyway. Over 'n out.
[Magisk] 0LDST4R:
Glad to help lazyLee, no problem... ;)
[Magisk] RootedLee:
lazy is the one who didn't even bother to post the solution in his answer .. ;)
[Magisk] xdaprogramm:
Bindfs works for me when done from ADB - then when I use the file explorer I see the Download folder that I want to bind with external, is instead the external.

But if ADB debugging is disabled, phone turns off, cable is disconnected or just time passes and the bind is lost.

I wanted to make it work away from PC within the phone. I tried Terminal Emulator - works but only in the terminal. I can see the original Download folder, it is not bound to the external SD even though in the terminal if I ls Download it will list the external SD desired folder, Thus apps like Exagear will also not see the bind, unlike when done bindfs from ADB, which as I said can get lost and if you are away from PC won;t have the bind for long.

Trying to use your fbind fix4 , looking for ways to keep folders bound even if phone is locked, no adb debugging etc.
[Magisk] aceediq:
Can you please give the exact commands for the mount commands you used...I am trying to make scripts too
[Magisk] theredbaron1834:
The latest fbind works great for me, so I switched to it. However, my old script:

su -c "mount --rbind /mnt/media_rw/4A09-17FB/Android/ /mnt/runtime/default/emulated/0/Android/"
su -c "mount --rbind /mnt/media_rw/4A09-17FB/DCIM/ /mnt/runtime/default/emulated/0/DCIM/"
su -c "mount --rbind /mnt/media_rw/4A09-17FB/Download/ /mnt/runtime/default/emulated/0/Download/"
su -c "mount --rbind /mnt/media_rw/4A09-17FB/DraStic/ /mnt/runtime/default/emulated/0/DraStic/"
su -c "mount --rbind /mnt/media_rw/4A09-17FB/Games/ /mnt/runtime/default/emulated/0/Games/"
su -c "mount --rbind /mnt/media_rw/4A09-17FB/Pictures/ /mnt/runtime/default/emulated/0/Pictures/ "
su -c "mount --rbind /mnt/media_rw/4A09-17FB/PSP/ /mnt/runtime/default/emulated/0/PSP/ "
su -c "mount --rbind /mnt/media_rw/4A09-17FB/Videos/Youtube/ /mnt/runtime/default/emulated/0/YTD/ "

Also if anyone else wants help via scripts, please pm me, as fbind is still usable now, and I don't want to hide the info behind support for scripts. Glad to help, just please pm.
[Magisk] aceediq:
The latest fbind??? Is it fix4? Can i see the script/config used?

Thanks so much for the script...i just need to put in a file, edit to my needs and add the script extension, right?

Another thing, have you succesfully, either with fbind or your scripts, mounted whatsapp to extSD?
[Magisk] theredbaron1834:
1. Yes, fix4 works perfect for me on the latest lineageos 17.1 on an XA2, and Magisk fully ipdated.

target Android
target Download
target Games
target PSP
target DraStic
target Pictures
target Wagic
target DCIM
target ADM
from_to YTD Videos/Youtube

2. That, and run it. I used Init.d lite, from the fDroid app store, to run it on boot.

3. I don't use whatsapp, but I don't see why it wouldn't work, at least with fbind, as it should change before the app can run, whereas a sceipt might not.
[Magisk] aceediq:
Thanks....uhmmm...i have an issue, when i move the script to init.d

partition it automatically disappears after reboot, any solution?

App used: universal init.d enabler

When i tried init.d lite, nothing mounts

MagiskSU 19.3, Redmi Go

---------- Post added at 10:47 PM ---------- Previous post was at 09:57 PM ----------

Tried fbind....flawless but i have a problem...a folder wouldn't bind because

the folder name is spaced e.g "flm user files"

How do i resolve this?
[Magisk] theredbaron1834:
For fbind, try adding quotes. Ie,:

target "flm user files"

Or

target 'flm user files'

Linux uses quotes this way at least, so hopefully that is all that is needed.

For a script, you need to change the mount namespace in magisk to global mamespace too. I can't use universal initd enabler on my system, no init partition, thus my lite use, so no help there. Lite should work with global namespaces, as long as you move the sh to the right folder, and have it usable.
[Magisk] aceediq:
Thanks a bunch....i didn't enable global namespaces :)
[Magisk] VR25:
Great Job!

Most of your changes sync with what I had in mind.

Plus, you followed my scripting style, making it seem I made the changes myself.

This simplifies maintenance, as I don't have to deal with someone else's scripting habits.

I've been building upon these changes.

As announced, fbind will use ACC's framework, which will make it more portable and capable, easier to maintain and debug.

P.S., everyone should buy Hooin Kyoma a beer or two!
[Magisk] freeman_108:
Fbind can mount folder but can't write file

I have tried fix4 and the latest fbind_v2020.8.4 on my Samsung s9 with Android 10. I can mount ext SD card to internal but can't write or delete any files. I am using from_to WhatsApp .WhatsApp command to mount folders is there any mount method work with Android 10?

Thanks.
[Magisk] E_Ben:
fbind_v2020.8.4? Did I miss something, I cannot find that version?
[Magisk] freeman_108:
You can find it in his telegram
[Magisk] VR25:
[v2020.8.4] See whether running "rm /data/adb/fbind-data/.noWriteRemount; fbind -u; fbind -m" helps.
[Magisk] samhhmobil:
Thank you very much.

I did install on Xperia-XA2 (H4113) and it runs from scratch without any issue.

My Configuration:

Latest Sony Firmware 50.2.A.3.55

LineageOS 17.1 (Android 10)

OpenGapps Nano

Magisk 20.4 stable

Module busybox 1.31.1 by osm0sis

Module fbind-2019.1.23-fix4

It works great. Thanks again.

samhhmobil
[Magisk] Solace50:
Could someone please show an example of how the config should look for multiple binds? I cant see to get any binds past the first to execute according to the log output.

---------- Post added at 03:38 AM ---------- Previous post was at 03:13 AM ----------

I did manage to get both binds to work however the desired intent is a little off, if i do

bind_mount $extsd/Android/data/dp.ws.popcorntime/files/time4popcorn/downloads $intsd/Download/popcorntime

bind_mount $extsd/Android/data/hu.tagsoft.ttorrent.lite/files $intsd/Download/torrent

I get two folders mounted properly showing the contents, however if I use

bind_mount $extsd/Android/data/dp.ws.popcorntime/files/time4popcorn/downloads $intsd/Download/popcorntime

bind_mount $extsd/Android/data/hu.tagsoft.ttorrent.lite/files $intsd/Download/

The second mount point does not mount correctly without any errors. Is this due to the behavior by design? The intent is to bind /files to Download in the second bind
[Magisk] theredbaron1834:
With a root txt editor, open up /data/adp/config.txt. This is your actual config. My is :

#fbind config at data/adp/config.txt

target Android

target Download

target Games

target PSP

target DraStic

target Pictures

target Wagic

target DCIM

target ADM

from_to YTD Videos/Youtube

Target is a straight one to one. Ie: the folder Android from the ext sd is mounted as Android in the internal sd.

from_to is, really "to from". So the folder Videos/Youtube in the ext sd is mounted as YTD in the internal sd.

#ext sd means the physical card. Internal sd the emu sd card that is your actual phones memory
[Magisk] samhhmobil:
I expect you just wanna say:

==> /data/adb/fbind/config.txt

Right?

samhhmobil
[Magisk] theredbaron1834:
Yeap :).

I just copied the path from the top of the config, cause it seemed right at a glance. Guess it wasn't. No idea why.
[Magisk] ruslanjobm:
Thank you for the new version. It seems that it not mount folders automatically after reboot (i use it with Magisk 20.3 on Android 7.1, Samsung J510FN).

After manual mounting everything works perfectly.
[Magisk] jbradshw:
I'm having the same issue. Folders mount but can't write or delete using them. I tried the above commands (said that the rm file doesn't exist, but it did unmound and remount the folders) but it didn't change anything.

Moto 5G Plus

Magisk 20.4

Lineage 16 (Android v9)
[Magisk] simonchen.android:
Fix to run fbind on boot and unmount fix

Special for Android 10+, I've built a new flash zip to fix the issue boot, the original -a (auto-mount) option is not available again, instead, it will auto-start fbind to mount folders from /data/adb/fbind/config.txt Also I've fixed an issue to unmount the extra branch on /runtime/full, therefore, the folders you defined in config.txt can be fully unmounted successfully (that need to execute command /system/bin/fbind -u)
[Magisk] freeman_108:
Sorry for the very late reply. I removed noWriteRemount still doesn't work only able to modify files from the source. Anyway I got a bit tired with it so I brought myself a Galaxy S20 and fbind works like charm. I think the problem is cause by s9 android 10 rom itself. Anyway thanks for all the hard work not just on fbind Acc it is very useful just need to fix up the djs installation issue.
[Magisk] simonchen.android:
This new flash zip has fixed service issue and unmount issue , I just tested on my android 10 phone, it works fine.

https://github.com/simonchen/RedMi4-Havoc-Android10/raw/master/fbind-2020.9.18-fix-service.zip
[Magisk] 白い熊:
I'm on Android 10 on Samsung Note 20 Ultra 5G.

The latest version I can use is 2019.1.23-fix4. Your version above and [MENTION=5228676]VR25[/MENTION] 's 2020.8.4 both mess up the system dramatically on install — whereby the /data partition becomes unmountable, I didn't inspect deeply but from what I saw, it seemed the fbind dir was empty and fbind-config was a zero length file upon flashing or vice versa.

The problem with further testing was that I had to fully reflash the stock ROM and setup the system since TWPR can't fully backup and restore Android 10 logical partitions.

Anyhow something is not so with the changes to the module you've made and it messes up the partitions somehow — at least on the Note 20 Ultra 5G — it might be device specific.

The 2019.1.23-fix4 works for me on this device though.
[Magisk] simonchen.android:
Android 10+ uses the new service method instead of init.d/ , please make sure that you use magisk 20+ to flash the zip.

Basically, the new flash zip does customized installation only, I can share the main command lines on install (see below),

after remounting root / , it will delete old version of all files at /system, and moving the key bash file - fbind* to /system from the extracted directory that Magisk managed.

I don't think that it will mess up your system partition..

mount -o rw,remount /
# install/uninstall
ui_print "(i) Uninstalling old version if had one"
rm -rf /system/etc/init.d/$MODID \
/system/etc/init/$MODID.rc \
/system/etc/$MODID \
/system/addon.d/$MODID.sh \
/system/bin/$MODID* \
/system/xbin/$MODID* 2>/dev/null || :
ui_print " "

ui_print "(i) Installing"

# place files
mv $MODPATH/common/sample* /data/adb/$MODID/
mv $MODPATH/bin/cryptsetup_$binArch $MODPATH/bin/cryptsetup
mv $MODPATH/bin/fstype_$binArch $MODPATH/bin/fstype
mv -f $MODPATH/common/$MODID* /system/bin/
mv -f $MODPATH/init/$MODID.rc /system/etc/init/$MODID.rc
mv -f $MODPATH/common/core.sh $MODPATH/
set_perm_custom /system/*bin/$MODID* $MODPATH/bin/cryptsetup $MODPATH/bin/fstype
[Magisk] 白い熊:
Yeah, it seems OK — I'm kinda reluctant to test again though, as it happened three times in a row — every time I didn't know what was causing it, as was installing a bunch of stuff, so last time I was going step by step, rebooting after every Magisk and EdXposed module, till I pinpointed fbind.

The problem is with the inability now to backup and restore the system fully in TWRP on Android 10 every fail like this necessitates a full ROM reflash, setup etc. It's painful.

Anyhow, the symptoms after the flash were that /data I think wouldn't mount even in TWRP, so something was wrong…

Might be busybox related, based on that an improper mount binary is used, or something I'd guess. But like I said I'm kinda unwilling to test it now again.

Maybe if I need to reflash the phone again, could do it — test right in the beginning.
[Magisk] stratonz:
I can't make fbind work on a Mi2a lite android 10. I've this log with all last fbind versions (fix4, August, September)... I've tried to install busybox module too.

Some suggestions?

Thanks.

:/ $ su

:/ # fbind -m

Bind-mounting...

> </mnt/runtime/default/emulated/0/DCIM>CIM

': Invalid argumente/default/5918-3B70/.fbind/DCIM

'->'/mnt/runtime/default/emulated/0/DCIM': No such file or directory

> </mnt/runtime/read/emulated/0/DCIM>CIM

'->'/mnt/runtime/read/emulated/0/DCIM': No such file or directory

> </mnt/runtime/default/emulated/0/Aurora>ora

': Invalid argumente/default/5918-3B70/.fbind/Aurora

'->'/mnt/runtime/default/emulated/0/Aurora': No such file or directory

> </mnt/runtime/read/emulated/0/Aurora>ora

'->'/mnt/runtime/read/emulated/0/Aurora': No such file or directory

> </mnt/runtime/default/emulated/0/Download>oad

': Invalid argumente/default/5918-3B70/.fbind/Download

'->'/mnt/runtime/default/emulated/0/Download': No such file or directory

> </mnt/runtime/read/emulated/0/Download>oad

'->'/mnt/runtime/read/emulated/0/Download': No such file or directory

> </mnt/runtime/default/emulated/0/WhatsApp>App

': Invalid argumente/default/5918-3B70/.fbind/WhatsApp

'->'/mnt/runtime/default/emulated/0/WhatsApp': No such file or directory

> </mnt/runtime/read/emulated/0/WhatsApp>App

'->'/mnt/runtime/read/emulated/0/WhatsApp': No such file or directory

> </mnt/runtime/default/emulated/0/Migrate>ate

': Invalid argumente/default/5918-3B70/.fbind/Migrate

'->'/mnt/runtime/default/emulated/0/Migrate': No such file or directory

> </mnt/runtime/read/emulated/0/Migrate>ate

'->'/mnt/runtime/read/emulated/0/Migrate': No such file or directory

rm: /dev/fbind/tmpf: No such file or directory

- End

:/ #

Inviato dal mio Mi A2 Lite utilizzando Tapatalk
[Magisk] fedosis:
[MENTION=4703148]Hooin Kyoma[/MENTION] and everyone.

I just replaced one string in patched version of fbind for normal functioning fbind from shell. I.e. eliminate "modPath not found" error.

Just change modPath definition in fbind executable.
[Magisk] alximiktik:
File are not available
[Magisk] samhhmobil:
[MENTION=4703148]Hooin Kyoma[/MENTION]

Hi, it's a very strange thing here. I'm running your fix4 version with Magisk 20.4 on an Xperia XA2(H4113) running LinegaOS17.1/nanoGapps since some months without any trouble. It works.

Today I did install a second H4113 in exact the same way (LineageOS17.1/nanoGapps/Magisk20.4), I even did install your fix4 Version, it boots up, but it doesn't mount any folder. Instead, I find an empty file named ".fuse" in /data/adb/fbind which is not existent in the running older phone. I'm nearly sure, I did install in exactly the same way, but do you have any idea, what I may do wrong? Even deleting the .fuse file does not help, after next reboot without mounting folders it's there again.

Thanks for your assistance,

samhhmobil

PS

I cannot find something I made wrong. The workaround yet is to use Magisk20.1, to install original fbind-2019.1.23, and after that to update to Magisk20.3. With that it works as known before...
[Magisk] sid8840:
Update

Updated version
[Magisk] ArcherTanu:
Android 11 support

latest version(fbind_v2020.8.4) is not works with a11 because google new storage policy ??
[Magisk] dohanin:
I've been trying to get it work on my old device (Sony Xperia X Compact, stock rom Oreo, Magisk 20.4) with different versions of fbind and all the suggestion here in config.txt but never got it work correctly.

I simply tried to link a folder (e.g. "Fonts") from /storage/emulated/0/Fonts to /storage/XXXX-XXXX/.fbind/Fonts,

but weirdly /storage/emulated/0/Fonts is always linked to the root of the external SD, i.e. /storage/XXXX-XXXX

So to get to my files, the path would be /storage/emulated/0/Fonts/.fbind/Fonts

Seems nobody had my problem, but no idea what could be wrong with my config:

"from_to Fonts .fbind/Fonts"
[Magisk] samhhmobil:
Take the old, but stable version 2019.1.23 of fbind.

First: Install Magisk in a version <=20.1,

then install fbind 2019.1.23,

then(!) upgrade Magisk to version 20.3(!). Stay with that, it works cleanly with older devices.

I used this on Xperia-Z (running LineageOS 16.0) without any trouble.

samhhmobil
[Magisk] dohanin:
Thanks. I followed your suggestion and it does work!
[Magisk] ArcherTanu:
Anyone tried fbind with android 11? Its not working for me.