yashsingh1/xdaforums huggingface dataset:
[Magisk] VR25:
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.
[Magisk] K0rgar:
Not anymore, I needed a working phone so I had a spare afternoon to try A11.

Sorry for not helping at all...
[Magisk] Chamelleon:
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?
[Magisk] VR25:
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".
[Magisk] samhhmobil:
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
[Magisk] sjevtic:
Is there a way to have fbind mount a directory using the same kind of "storage emulation" (sdcardfs?) that the OS uses to mount /storage/emulated on /data/media? Normally, when fbind is used to mount a directory on an ext4 partition somewhere in /storage/emulated, weird permission problems understandably occur. Getting a storage emulation to work in conjunction with fbind would mean I could finally stop needing 2 partitions on my SD card.

I'm running A11 on a (mostly) stock Samsung system.

Thanks.
[Magisk] yellow.cat:
How to config DCIM camera photos to SD card, is still write on data/media/DCIM

,I'm use

from_to "DCIM" ".fbind/DCIM" as usually this work from A8-A10 , but I'm so confusing on A11 and A12. is not work
[Magisk] K0rgar:
Edit: Yesterday night was fine and this morning I had to reboot because the system was stuck. Will see these coming days.

There's also one specific app, WeChat, that saves files to internal memory (data/media/0/Pictures/WeChat) even if the entire sdcard is mounted (int_extf)

I want to let you know that it's working flawlessly this time.

My issue was the sim/microSD tray (I noticed the loss of line, hence the finding)

Poco X3 NFC / xiaomi.eu 12.5.4 (A11) / fbind 20211207 (latest)
[Magisk] K0rgar:
More findings: as long as I don't delete *any* folder on /data/media/0 then the phone won't hang up.

Chrome download folder is always set to /data/media/0/Download and it can't be set to external storage (insufficient space, not true)

WeChat camera files are saved to /data/media/0/Pictures/WeChat

If you need other informations then just ask.

In my opinion, 5 min before mounting is too long and I always manually mount by using Termux (su, fbind -m)

My config file is int_extf
[Magisk] mattiadj:
Hello! Anyone can explain me how can i link some folder or use external sd as internal?

When i flash the zip from magisk, then what i have to do?

Thanks!
[Magisk] sieger007:
read fbind instructions OR add a script to post-data folder in /data/adb to manually bind mount ( long as SeLinux Permissive ) or Adopt SD card Refer to this
[Magisk] sieger007:
@VR25 & others .... Can you PL point me to some online guide of how to compile new SeLinux Policy rules ? I used fbind in Permissive Selinux. With enforcing I cant bind mount even after using bindfs . I need to change SePolicy Rules. I am trying to understand how it can be done .
[Magisk] 0LDST4R:
Using fbind from @VR25 since years with many ROMs and phones, it's more tricky meanwhile to setup the module, but of course not impossible, that's why i thougt i share my experiences with the latest release ( 071221 ) and my new toy ( Xperia XZ2 LOS 18.1, Magisk v23 ) .

I had some trouble to find the path of my intsd, without specify the internal SD in config.txt my binds were mounted, but without write rights, Chrome downloads and the DCIM folder were not accessable.

I installed Kuder Disk Info from APK Mirror, it's not in Play Store anymore, a very helpfull tool to look WHAT is WHERE mounted. Found my intsd under

/mnt/pass_through/0/emulated/0

so i was able to complete my config.txt

So, the first line in your config.txt should be WHERE the intsd is, second line WHERE the extsd is. Sometimes you simple have to try and error, it's all not magic.

Finally, maybe it's usefull for some people, my config.txt, with the device above.

intsd_path /mnt/pass_through/0/emulated/0

extsd_path /storage/xxxx-xxxx

target Android/data

from_to DCIM .fbind/DCIM

from_to Download .fbind/Download

obb

With this config the whole Android/data and Obb folder is on the extsd, DCIM and Download are on extsd too, accessable from the Cam and from Chrome. Media in linked DCIM are visible in gallery, and can be deleted via gallery. All fine.

So - specify the intsd and extsd - that's all.
[Magisk] K0rgar:
I simply use "int_extf" as the only single line config.

I set my camera folder (DCIM/Camera) and Chrome download on ext sdcard.

If Chrome doesn't let you set to ext then just create a new Download folder on ext.

For some apps that download files I also double check data/media/0 folder.
[Magisk] samhhmobil:
Thanks for the hint with the "pass_through" path. THAT'S IT!!!

Thanks again!

But... I didn't see this particular path in Kuder-diskinfo. So, your example did solve it for me.

Thanks, samhhmobil
[Magisk] 0LDST4R:
You're welcome.

That's the reason why i shared my experiences with this "tricky" Android 11, of course regarding to @VR25's post from here.

https://xdaforums.com/t/fbind.3621814/post-85980431

Happy binding. ;)
[Magisk] Broudy:
On Realme 6 Pro, none of the instructions help fbind to work. 🙁

The third day I've been mocking the phone. o_O

Android 11
[Magisk] Broudy:
Can I have a sample script?
[Magisk] samhhmobil:
Hi all,

just one a bit more complicated question...

Is it possible, even to mount a folder from inside the system (not in /storage/emulated/0) to the ext sdcard?

For me it's specially a folder in /data/data/"appname"/files, which I want to have located on the sdcard?

Any hints?

Thanks a lot,

samhhmobil

PS

Sony Xperia XA2 (pioneer)

LOS 18.1 (Android 11)

Magisk 24.3

latest fbind
[Magisk] sieger007:
that is exactly what apps like app2sd were doing long ago. Now google 's "free and fair" policy kicked them out. But they did so by creating a special partition for that purpose. That is NOT bind mounting its actually linking . Create a new partition ext4 and manually mount it early on via postdata.d script & create a link after moving all app folder contents and chown to app name.

Why cant I do it with current arrangement :

cos either u adopted or 'portablized' ur ext card and that partition is emulated so linking isnt poss and anyways it needs to be mounted v early on so your app link is recognized valid by system
[Magisk] angry_goldfish:
I take it that fbind is closed source. I don't see source for the binaries anywhere.
[Magisk] VR25:
There's too much fragmentation on Android. A config that works for me, may not work for you, and vice-versa. I've been looking for a one size fits all kind of approach.
[Magisk] VR25:
Sdcardfs is deprecated. Fbind uses a similar, yet more flexible approach: bindfs (which relies on FUSE).
[Magisk] VR25:
Investigating.
[Magisk] VR25:
It's a bit weird that you still need permissive SELinux to use fbind. Have you tried different internal and external storage paths, as suggested by other users and me? I cannot help you with SELinux policy rules, as I'm not remotely close to being a SELinux guru, due to the lack of interest in the matter.
[Magisk] VR25:
Good timing!

intsd_path /mnt/pass_through/0/emulated/0

extsd_path /mnt/pass_through/0/xxxx-xxxx

intsd_path /mnt/runtime/write/emulated/0

extsd_path /mnt/runtime/write/xxxx-xxxx

If you have time, do experiment with these as well, and share your findings.

For me, the latter pair works better than the first.

Trying to find a universal solution.
[Magisk] VR25:
It's a work in progress.
[Magisk] angry_goldfish:
fbind/bin/bindfs-v1.14.1/bindfs-arm64-v8a at master · VR-25/fbind

A versatile Android mounting utility for folders, EXT4 images, LUKS/LUKS2 encrypted volumes, regular partitions and more. - VR-25/fbind

github.com

Where's the source for that binary?

It's your project, but avoiding the answer makes it look like you are evading the question.

Am I mistaken, or is this closed source?
[Magisk] VR25:
Bindfs is also open source. I just forgot to provide the link to its repository.

GitHub - agnostic-apollo/bindfs: bindfs (for android mainly)

bindfs (for android mainly). Contribute to agnostic-apollo/bindfs development by creating an account on GitHub.

github.com
[Magisk] sieger007:
My ext4 partitions are /dev/block/mmcblk1-3 . enforced[/I] - I tried mounting em as /mnt/media_rw/<name> using bindfs ( bindfs -o nonempty,nosuid,nodev,noexec,noatime,context=u:eek:bject_r:sdcardfs:s0 -u 0 -g 9997 -o create-for-user=0 -o create-for-group=9997 -p 0777 --create-with-perms=0777 --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/wa/WhatsApp/ /mnt/runtime/write/emulated/0/WhatsApp/) . All perms & combos were tried instead of 0 and 9997 & yet it fails to get RW permissions and images will not d/l. I make it setlinux 0 - immediately d/l is poss. Discussing bindfs here cos that;s working behind covers in fbind. Once bindfs issue gets overcome then I can extend that to fbind mod and the former is related to SeLinux. So much as it sucks - we have to deal with it to get all ducks in line
[Magisk] 0LDST4R:
Ok, will do so, thanks for the hint, RL got me during week. Will report of course.

Stay all healthy. ;)

Edit right after changed my config.txt :

Your suggestion works fine too.

Changed to :

intsd_path /mnt/runtime/write/emulated/0

extsd_path /mnt/runtime/write/xxxx-xxxx

My mounts are accessible. 👍🏻

Two curious things - not problems - if you take a look into my config.txt you can see my mounts :

prefix=/mnt/runtime/write

extsd_path /mnt/runtime/write/xxxx-xxxx

intsd_path /mnt/runtime/write/emulated/0

from_to DCIM .mounz/DCIM

from_to Download .mounz/Download

target Android/data

obb

When i browse to Android/data with a root explorer from the ( linked ) intsd the size of the dir is displayed correct, the size which is available on the real extsd. So, if i browse to the DCIM or Download, the size does not change, the size of the real intsd is displayed. And second curious thing - the reboot or the shutdown takes very long in comparison without fbind installed. Maybe between 40 - 50 seconds. Both things do not affect the functionality of the module, it's just fyi.

Xperia XZ2 H8296

official LOS 18.1

Latest MindtheGApps

Meanwhile Magisk 24.3 ( 24300 )

fbind v2021.12.2.1 ( 202112021 )

......................
[Magisk] sjevtic:
Ok, but my underlying question remains: is there a way to use fbind to to mount an ext4 filesystem without permission enforcement in a manner analogous to how /data/media is available as /storage/emulated?
[Magisk] sieger007:
no not with this module that is emulating ( what you refer to ) . for that you have to mount regularly and then mount again with -sdcardfs type ootion.
[Magisk] VR25:
Storage support on Android is a mess. :poop:
[Magisk] VR25:
Does the size issue also apply to your previous setup?

intsd_path /mnt/pass_through/0/emulated/0

extsd_path /storage/xxxx-xxxx

The long reboot/shutdown times are probably due to the large number of mounts Android automates after fbind does its thing.

I'll never understand why Google does such a mess with storage.

We just have to live with these inconveniences for now.
[Magisk] VR25:
I should've clarified. Fbind does this, but only for bind-mounts. Here's how your setup would look like:

1. Mount the EXT4 partition the usual way:

2. Overlay the mount point with a bind-mount (works like sdcardfs, but better):
[Magisk] K0rgar:
For the Chrome download folder that can't be set on ext, I just created it manually in the root, thus allowing it to be selected inside options.

Generally speaking, not everything is mounted or emulated like Android 10 but it's still better than nothing.

One last thing, every three or four days the phone does hang on files or folders and I had to reboot followed immediately by termux, su, fbind -m

Config is ext_f, Android 11 Poco x3 NFC xiaomi.eu 12.5.5
[Magisk] 0LDST4R:
Yes, with my previous setup the same 2 " issues ". But as i wrote - not really a " problem ". Btw, in Chrome, when i choose the download location, the size is correct.

The storage thingy and Google - this is a really long loooooong mystery, starts with KitKat if i remember correct, this " SDfix " and so on, but probably we'll never know why they do what they do in this case. And we see - some smart guys or girls find a way to use ext SD cards as we want it. 😉

Terrible english, i know. ;)
[Magisk] angry_goldfish:
Oh wow, thanks for the clarification!
[Magisk] sieger007:
Yes but if bindfs wont work in enforced env. How can we expect fbind to work. Does it work ( after binds integration ) and grant RW access to underlying dir - if so what bindfs ops are used in fbind
[Magisk] sosimple:
How can i delete a mount folder? I created 2 folders in internal which mount to same folders in external. In external i just deleted the one i didn't want. But in internal i go to delete same folder but file explorer can't delete it.. Any help?

Thanks,
[Magisk] samhhmobil:
You should use a file explorer in root mode, or better, use a shell and "rmdir" it there as root.

samhhmobil
[Magisk] sosimple:
Thanks. I was using a root explorer but didn't erase from internal storage. Only from microsd was erasing.. Anyway i solve it the hard way. Uninstall fbind magisk plugin. Then i could erase the fold. Reinstall fbind and start again.. It worked.
[Magisk] sosimple:
If i remove microsd, and inserted it back, will the symbolic link in internal still works?

Thanks,
[Magisk] sjevtic:
How does a bind mount achieve the emulation of having no filesystem permissions? I must be missing something here.
[Magisk] Shihabus Sakib Rad:
@VR25 I installed this module today and it's working great so far on android 11.

I am not sure how to use cryptsetup. I want something like "target Pictures" BUT with encryption like EncFS or rclone-crypt. So that, if put a file in $intsd/Pictures, the file will be encrypted $extsd/Pictures.

With Rclone Remount & ExSDCard Write Access Enabler magisk modules, I could somewhat achieve this on previous android versions.

Can I do this with fbind module? if so, what line do i write in config,txt.
[Magisk] K0rgar:
@VR25 Can you please check if /data/media/0/.fbind does exist or not?

Because if it's there, then it goes into loop, can't mount, I had to reboot, manually delete such folder and finally termux, su, fbind -m
[Magisk] VR25:
nsenter -t 1 -m bindfs -o nosuid,nodev,noexec,noatime,nonempty -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore
[Magisk] VR25:
You have to unmout first, to be able to delete.
[Magisk] VR25:
Mount point != symbolic link.

You have to unmount before removing the sdcard, and remount after reinserting inserting it.
[Magisk] VR25:
Cryptsetup is used by fbind for disk encryption.

You need an encrypted partition. Once mounted, the syntax for folders is the same.

part [-o <mount option...>] <[block device[--L[,password]]]> <mount point> ["fsck <option...>"]` Auto-mount a partition.
# The `--L` flag is for LUKS/2 volume, opened manually by running any `fbind` command.
# The filesystem is automatically detected.
# The defaut mount options are `rw` and `noatime`.
# `e2fsck -fy` is always used for supported filesystems.
[Magisk] mashiro2296:
Hello! I Installed this module & it works fine on my J7 (2016) Device running on crDroid 10.

I've use the fbind wizard. done some non-media files (data folders) and it works but once I reboot my device bind doesn't work. I need to go to terminal and once I enter command 'fbind -um' the targeted folder binds again.

tried to add 'permissive' in the config and 'fbind -f' in terminal but same scenario occurs. once I reboot my device the targeted folder not binding.

Hope you may help me. Thanks in advance.
[Magisk] P650SE:
Hi everyone,

I wondered if anyone can help a total beginner? Just recently I purchased a 256GB microSD card for my phone, I would like a way to create an encrypted volume on the SD card that can be mounted onto the device's filesystem so that the files can be freely accessed from within any file manager or gallery app.

As I understand it, I should be able to achieve what I am looking for with this module, but I don't have any knowledge of using terminal so this whole thing is overwhelming to me, I'm rooted with Magisk 25.1 on Android 11, I have the Fbind module installed and Termux from F-Droid. I downloaded the provided cryptsetup binaries and extracted them to /data/adb/vr25/bin/cryptsetup/ with permissions 755 but when I run the command fbind -C it says cryptsetup: can't execute: Is a directory

I can't tell what I'm doing wrong, I wondered if someone with better knowledge could guide me in the right direction, or offer some simplified step-by-step instructions on how to set this up?

Would really appreciate any assistance.

Thanks (and sorry!)
[Magisk] Shihabus Sakib Rad:
Newb here. Could you explain in non-technical terms if it is possible to achieve what I want to do.

I want a folder, say, $extsd/Diary to be accessible on $intsd/Diary but with encryption. If I put a file firstday.txt on $intsd/Diary, A encrypted file would appear in $extsd/Diary.

Basically, it is similar to how cryptomator, EncFS or rclone-crypt work where encrypted file would be stored on Ext-SD but mounted on Int-SD. This way, I could set this $intsd/Diary path from any App as a Backup folder or Data storage location.

For this use case, could you write me the config file I need for "Diary" folder.
[Magisk] Dark_Phoenix004:
I've been using fbind for long now.

Since Android 6.

Now in my new Android 11( Redmi note 11) it seems fbind is working fine, but after some time, the WhatsApp folder bind just unlinks without any warning. And idea or suggestions about that?
[Magisk] the gladiator:
As 0LDST4R, I'm using fbind since years over many smartphones and I consider it crucial in my digital life (it goes without saying that VR25 is my unparalleled guru). I wanted to install fbind on my daughter's smartphone with Android 9, Magisk 22.1 and fbind v2021.12.7.

It was ok BUT the sd card was disregarded; that means that it binded folders on internal memory. Useless! The trick was to add the "path" in the config file as 0LDST4R was suggesting, as simple as that (once you know) !!!
[Magisk] MarkLev:
@VR25 , also to anyone if you have some answers:

What are the differences between media and non-media in term of fbind's behavior?

Why is there a need to distinguish them?

I am new to fbind, so...
[Magisk] MarkLev:
Ok, here is what I found after playing around with fbind:

** fbind wizard's behavior:

In fbind wizard, there are 3 kinds of binding: Media, Non-media and OBB

There is no difference between Media, Non-media and OBB except the way wizard generates config.txt

Example: When choosing Media, the next prompting will generate the below line in config.txt for user's input "myDir":

from_to "myDir" ".fbind/myDir"

When choosing Non-media, the next prompting will generate the below line in config.txt for user's input "myDir":

target "myDir"

It is equivalent to:

from_to "myDir" "myDir"

When choosing OBB, the next prompting will generate the below line in config.txt for user's input "myDir"

obbf "myDir"

It is equivalent to:

from_to "Android/obb/myDir" "Android/obb/myDir"

** Here is the fbind wizard's behavior in comparison with fbind -m (fbind mount command)

With config from_to "myDir" "myDir":

If there's existing "myDir" in ExternalSD, that "myDir" is renamed to "myDir.old", and then fbind will move intSD-"myDir" to extSD, and mount extSD-"myDir" to intSD-"myDir"

fbind -m (fbind mount command):

With config from_to "myDir" "myDir"

If there's existing "myDir" in InternalSD, that "myDir" is ignored, and then fbind will mount extSD-"myDir" to intSD-"myDir"
[Magisk] AnonVendetta:
Thx for the info. I've always wondered what the difference is between the 3. Apparently, there are none, except how the configuration file gets written.
[Magisk] kreatifchk:
What to do if fbind -u doesn't work? I did the binding through the terminal with the fbind -b command. Only reboot helps.
[Magisk] MarkLev:
From github page:

It must be listed in config.txt so that it can be unmount later.
[Magisk] kreatifchk:
That is, if it is mounted through the terminal, then the only way to unmount this to restart the device?
[Magisk] MarkLev:
Run: umount -f <mountpoint>
[Magisk] Teddan Fred:
Noob question here.

In termux when I run fbind (wizard) and press "a" to see all commands.

When I come to END I can no longer execute any new command.

What can I do exit this command list?

Thanks!

edit. Found it! press "q" :LOL:
[Magisk] Alonso_Quixana:
<deleted>
[Magisk] Alonso_Quixana:
I just bought an used Motorola Moto G7 play (XT1952-1 reteu channel) with Android 10 on it.

When I try to bind_mount a folder in config.txt with fbind, after the phone is rebooted it takes approx. 5 minutes until the mount actually takes place (same goes for the log creation). When I go to terminal and type fbind -m the mount happens immediately. Therefore I guess it's an Android problem / restriction?

Does anyone know what could cause this delay?
[Magisk] wuri:
The DCIM folder can be mounted normally with "bind_mount", but the pictures are not visible in the gallery, and I try "from_to", it doesn't work in andorid13, can someone help me?
[Magisk] Testing33:
I really feeling lost here.

Does steps like opening cryptsetup container and creating device and then mounting are pre requisite to fbind ?

We have below steps to mount cryptsetup container at mountpoints:

# cryptsetup open /mnt/runtime/default/3B86-9400/luks.img myluks

# mke2fs -t ext4 /dev/mapper/myluks

# mkdir luksmounted

# mount /dev/mapper/myluks/

mnt/runtime/default/3B86-9400/luksmounted

can you please translate above cryptsetup steps in terms of what has to be done exactly in fbind config ?
[Magisk] switchem:
I'm brand new to this and am fumbling through it myself, but I was trying to do the same thing, and this is the config line that works for me.

loop $extsd/container_name.img--L,123 $intsd/path_to_mount_point

"123" is the password for the LUKS container

The container should mount automatically on boot to the "path_to_mount_point" folder in internal storage. If it doesn't, you can mount it manually by running fbind -b in a Termux su shell (or ADB shell). Mounting manually will also let you know if there are any errors such as a missing cryptsetup binary. A successful mount with that command will look like below. If there's an error it will appear above the "<> <>".

# fbind -b

<> <>
mkdir: can't create directory '': No such file or directory
mkdir: can't create directory '': No such file or directory
Failed to resolve source directory `': No such file or directory
(i) Trying "mount -o bind"...
mount: ''->'': No such file or directory