• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
Search This thread

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
Could
Hello, tested latest version on an AICP 11 rom with scoped storage and it seems to work, with some path adjustement for app like WhatsApp, but the read/write on the sd card exfat formatted is very slow (faster than fat32, btw...). Could it depends from fuse?
This could be related to the kernel itself, fuse or the bindfs binary I'm using.
The latter is not on the latest version and I don't have the resources to compile it myself yet.
 
  • Like
Reactions: b927539

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
**v2021.11.17-beta (202111170)**
- Enhanced storage paths fallbacks logic
- `fbind -v|--version` prints version code (integer)
- Fixed auto-mount
- Full Android 11 support (XDA Recognized Contributor, @jimbo77 tirelessly tested fbind on Android 11, kernel 5.4. Worship this man and get him drunk!)
- General fixes & optimizations
- Increased loop timeout to 5 minutes to accommodate long boot times
- Updated documentation
 

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
Those who are still facing folder access permissions issues on Android 11 may want to try the attached script.
It must be executed WITHOUT root and the terminal must have storage permissions granted.
The script tests emulated storage prefixes or views (e.g., /mnt/runtime/write) and sets the first that provides read and write access.
Code:
sh /sdcard/Download/prefix-test.sh; su -c fbind --remount

/mnt/runtime/write and /mnt/pass_through/0 are what fbind uses (first found, first used).
To get the full list of possible candidates, run:
Code:
mount | grep '/emulated type' awk '{print $3}' | sed 's/\/emulated.*//' | grep -Ev '/mnt/androidwritable/0|/mnt/runtime/default'
Edit: the script is supposed to run only for a few seconds.
If it seems stuck, stop the process, add prefix=/mnt/user/0 to your config, reboot and see if the issues persist.
 

Attachments

  • prefix-test.sh
    989 bytes · Views: 8
Last edited:
  • Like
Reactions: b927539

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
**v2021.11.22-beta (202111220)**
- `-t|--test-prefixes`: test internal storage prefixes (views) and automatically update the config.
- Changed the priorities of emulated storage views to better accommodate Android 11+.
- General optimizations

Those who have prefix=/mnt/user/0 in config no longer need it.
Fbind now prioritizes that prefix.
 
Last edited:

stratonz

Senior Member
Jan 26, 2013
178
189
Pieris
v2021.12.7 (202112070)
- Added prefix troubleshooting info to the readme;
- Bind-mounts will force media store updates;
- Reverted automatic prefix workaround (it breaks bind-mounts on some systems).
Very good job! You'll make android 11 an usable OS. This is the version that works better for my configuration. I need to use prefix=/mnt/runtime/write and (I don't know if it's related to fbind...) sometimes all apps with file permission stop working... is there a periodical remount or some similar?
 
  • Like
Reactions: nick491 and VR25

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
Very good job! You'll make android 11 an usable OS. This is the version that works better for my configuration. I need to use prefix=/mnt/runtime/write and (I don't know if it's related to fbind...) sometimes all apps with file permission stop working... is there a periodical remount or some similar?
Could you elaborate on the "stop working" part? This has to do with Android itself. It may be breaking fbind bind-mounts. Do you think fbind should auto-remount periodically?
 

stratonz

Senior Member
Jan 26, 2013
178
189
Pieris
Could you elaborate on the "stop working" part? This has to do with Android itself. It may be breaking fbind bind-mounts. Do you think fbind should auto-remount periodically?
Honestly, I don't know... Neither what logs could be useful to send to you. I thought about remounts cause everything works well and suddenly a lot of apps remains "paralized" after starting.
 

K0rgar

Member
Aug 27, 2013
45
23
Honestly, I don't know... Neither what logs could be useful to send to you. I thought about remounts cause everything works well and suddenly a lot of apps remains "paralized" after starting.
The same for me.
I have Xiaomi MI10T lite with the latest xiaomi.eu 12.5 rom, fbind with int_extf config.
Android/data (external data) is not mounted nor media and obb.
After some time phone seems to be stuck or paralyzed like stratonz said.

Reverted back to good old Android 10 and everything is working like charm.
 

AnonVendetta

Senior Member
Apr 29, 2016
979
366
Portland, OR
@VR25: For some reason Magisk isn't showing an update for fbind, I'm still on the November version. It's also not showing updates for acc/djs either, but strangely enough it found updates for riru/LSPosed/others. I found them on your GitHub though. Did you stop syncing with the module repo?

I haven't had much time to screw around on Android, due to a massive influx of customers for my online business after over a year of running in the red.
 
  • Like
Reactions: VR25

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
The same for me.
I have Xiaomi MI10T lite with the latest xiaomi.eu 12.5 rom, fbind with int_extf config.
Android/data (external data) is not mounted nor media and obb.
After some time phone seems to be stuck or paralyzed like stratonz said.

Reverted back to good old Android 10 and everything is working like charm.
Have you tested with prefix=/mnt/runtime/write in config?
If this does not help, try the fbind -t (--test-prefixes) command.
Fbind does not run in the background. Thus, anything that happens after the bind-mounts is caused by something else.
 

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
@VR25: For some reason Magisk isn't showing an update for fbind, I'm still on the November version. It's also not showing updates for acc/djs either, but strangely enough it found updates for riru/LSPosed/others. I found them on your GitHub though. Did you stop syncing with the module repo?

I haven't had much time to screw around on Android, due to a massive influx of customers for my online business after over a year of running in the red.
Fbind is not in the Magisk repo, and it cannot be added back at this point (reason).
I forgot to push djs v2021.12.14 to the Magisk repo (did it just now). ACC is in there.
Will keep an eye on the update issue.
 

K0rgar

Member
Aug 27, 2013
45
23
Have you tested with prefix=/mnt/runtime/write in config?
If this does not help, try the fbind -t (--test-prefixes) command.
Fbind does not run in the background. Thus, anything that happens after the bind-mounts is caused by something else.
Not anymore, I needed a working phone so I had a spare afternoon to try A11.
Sorry for not helping at all...
 
  • Like
Reactions: VR25

Chamelleon

Senior Member
May 16, 2010
774
363
Kraków, Poland
LG G6
LG G7 ThinQ
Hi, I see that WhatsApp issue is pain in the *** for some users. Unfortunatelly I suffer from the same issue. I recewntl;y installed fbind and there is no way to download any image on WhatsApp when WhatsApp/Media folder is mounted. I tried adding permissive to config but it didn't help. I also tried fbind -f but it gives me reboot after fbind -m. Is there any way to use fbind with folders which have spaces in name?
 

VR25

Senior Member
Apr 20, 2013
1,863
4,570
github.com
Hi, I see that WhatsApp issue is pain in the *** for some users. Unfortunatelly I suffer from the same issue. I recewntl;y installed fbind and there is no way to download any image on WhatsApp when WhatsApp/Media folder is mounted. I tried adding permissive to config but it didn't help. I also tried fbind -f but it gives me reboot after fbind -m. Is there any way to use fbind with folders which have spaces in name?
Have you tried the latest version with and without prefix=/mnt/runtime/write in config?
fbind -f is not meant for recent Android versions. It should be off.
To use folder names containing spaces, quote them: from_to "my folder" "goes here".
 

samhhmobil

Senior Member
May 25, 2017
361
191
Hamburg
v2021.12.7 (202112070)
- Added prefix troubleshooting info to the readme;
- Bind-mounts will force media store updates;
- Reverted automatic prefix workaround (it breaks bind-mounts on some systems).
Now I found free time for testing it again.

Yes, now it mounts correctly via "from_to".

Yes, the files written there are correct and usable.

But... the StorageAccessFramework cannot access the files in the mounted folders. For example the standard LOS-Gallery App shows no media files, even if many files are there, in the mounted DCIM and Pictures folders (mounted via "from_to DCIM .FBI's/DCIM" etc.).

My system:
Xperia XA2 (H3113)
LineageOS 18.1/Android11 (latest build)
OoenGapps nano
Magisk 23.0
fbind 2021/12/07

What's to do that SAF in Android11 can even access the mounted folders? (Of course with LOS17.1/Android10 everything works as it should.)

Thanks a lot,
samhhmobil
 

Top Liked Posts

  • There are no posts matching your filters.
  • 41
    ### No, I'm Not Dead! ###

    I know, I know... it's been quite a while. Well, yeah, maybe longer than that...

    Not gonna write a book on this. Lets just say it's HARD to access the internet on a regular basis from my current location. Plus, I've been busy with general life matters.
    That said, my online presence will still remain limited for a while. It won't be that much limited anymore, though. So... yay!



    ### Latest Changes ###

    F2FS Loopback Bug Workaround
    Magic GApps
    Magisk Manager for Recovery Mode
    Moto Z Play Dual SIM Mode Enabler
    Sysconfig Patcher
    Systemless Camera NX Mod
    - Fixed modPath detection & bad PATH variable issues (Magisk V16.6).
    - Updated documentation

    Magic Charging Switch (mcs)
    - Enhanced debugging function.
    - Fixed "automation config still calling `cs` instead of `mcs`."
    - Fixed modPath detection & bad PATH variable issues (Magisk V16.6).
    - Updated charging switches database (more devices supported)
    - Reliability improvements
    - Updated documentation

    Magic Folder Binder (fbind)
    - Ability to unmount loop devices and partitions on demand (i.e., fbind -u 'pattern1|pattern2|pattern...').
    - Better loop device mounting logic ("ugly bugs" fixed)
    - Bind-mount folders automatically regardless of --L (LUKS) flag's usage.
    - Dedicated logs dir -- /data/media/fbind/logs (easier & advanced debugging)
    - Deprecated `fbind -l` in favor of `fbind -i` (outputs much more information)
    - Fixed "misleading [N/A] mount status".
    - Fixed modPath detection & bad PATH variable issues (Magisk V16.6).
    - Fixed "rm -rf not affecting hidden files/folders" in data moving functions.
    - Ignore `app_data` line whose target apk is missing (to avoid app data loss).
    - Option to mount app_data in ext4 .img file (loop device)
    - Shipping with a comprehensive, noob-friendly tutorial (tutorial.txt, /data/media/fbind/info/tutorial.txt)
    - Reliability improvements (better data loss protection algorithms)
    - Updated documentation
    - Using `rsync -a` for advanced copy operations, instead of `cp -a`.



    ### Last, but Far from Least ###

    Will update each project's thread and repository & answer queries at my earliest (uh... maybe a little late) convenience.
    Meanwhile, everything you need is in the attached zip. Yes, all modules are there, along with a md5sum.

    P.S., To everyone who donated and/or contributed in other ways,
    -- Thank you very much!
    19
    Is this project discontinued? Last update almost a year ago.

    Ok, I downloaded latest version (2019.1.23) and installed it on my Lineage OS 17.1 (Android 10) with Magisk v20.2, and... spent two days for manage it to work... Meh, it'd be better to not even start.

    Fist of, it simply hasn't been installed properly on my system (no binaries, no scripts, only info/config examples), so I downloaded latest update-binary, saved it as is (without modifications), and manually converted config.sh to install.sh (using aka "legacy script" logic) (fix1-fix2) customize.sh (fix3).

    Secondly, fstype binary doesn't detect FAT (vfat/exfat/sdfat) on my system, so I added extra check to part() function in core.sh: in case if fstype has not detected FS, let mount detect it automatically (omit -t).

    Next, grep /storage/emulated /proc/mounts | grep -Eiq ' sdcardfs | fuse ' || exit 1 line in wait_until_true() function instanly exit script on boot, I guess it's because it starts too early on my system. So I replaced "exit" with waiting loop.

    After all this modifications and countless hours of tries and errors I finally got what I wanted - move (bind) some internal folders to encrypted second partiton of my external SD card.

    /data/adb/fbind/config.txt:
    Code:
    part -o umask=0 /dev/block/mmcblk1p2--L,MyLoNgPaSsWoRd /mnt/sdcrypt
    extsd_path /mnt/sdcrypt
    target DCIM
    target Audio
    target TitaniumBackup

    I found using umask=0 on FAT is a most painless way to deal with apps permissions to use binded folders. Less secure though. I logically understand that fbind should take care of access to binded folders, but it looks like something changed lately in Android's storage "magic", which is not clear to me, so... umask=0. Tried other mountpoints like /mnt/media_rw/sdcrypt or /storage/sdcrypt, tried ext4 instead of exfat, but all that caused even more problems with permissions. I'd appreciate any advice about better mountpoint and options to use.
    Got an infinite bootloop when I used to use FUSE (which is happen automatically when I add something like "intsd_path /storage/emulated/0" in config.txt), thanks god we have TWRP.

    I attached modified zip-file in case if anyone interested (not sure If I had right to do this tho, I will remove it if OP or moderators ask), magisk-only.
    DISCLAIMER: I'm very new to module coding and coding in general, I'm just an experienced Linux user, so I can't guarantee that my modifications are 100% correct and universal, test it on your own risk.

    UPD: new "fix2" version with some fixes.
    UPD2: new "fix3" version: magisk 20.4 support and others changes.
    UPD3: new "fix4" version: small bugfixes and simplified code (info).
    17
    13
    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:eek:bject_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 :)