yashsingh1/xdaforums huggingface dataset:
[Magisk] pat357:
I still can't make this work :

If I add the line ro.config.tima=0 to /magisk/fbind/system.prop and set perm. to 755, find fails to work : the mounted directories on the int_SD show up as files (instead of directories).

It seems the the other line already in system.prop (for sdcardfs-=force_off) is ignored too, hence the failing binds.

Do I need a space between the 2 lines or maybe a space at the end of the system.prop ?

getprop ro.config.tima shows still 1.

If I add a file called system.prop to /magisk/.core/props/ containing the line ro.config.tima=0 (chmod 755) , this file seems to be ignored.

getprop ro.config.tima shows still 1.

I hope ro.config.tima=0 is correct, but what about ro.config.tima=force_off, should this be valid too ?

I must be doing something wrong, but I have no clue where to look.

I'd really appreciate it if you could have a look at this.
[Magisk] VR25:
You could try appending resetprop persist.sys.sdcardfs force_off to /magisk/fbind/post-fs-data.sh, below the line export PATH=....

For the other issue, try /magisk/.core/post-fs-data.d/ScriptFile containing the line resetprop ro.config.tima 0

If resetprop doesn't work, try setprop.

ro.config.tima: "0" vs "force_off" -- since "1" is the original value, the opposite must be "0".
[Magisk] pat357:
OK,

resetprop ro.config.tima 0

seems to work from the terminal.

What are the permissions for this ScriptFile ?

Does it need the classical #!/system/bin/sh in the header ?

The exact difference in use-terms between resetprop and setprop is still confusing to me. :o
[Magisk] VR25:
Yeah, you need that in the header.

Permissions are the usual 755 for executables.

resetprop and setprop have the same syntax for setting props. The advantage of the first is that it's a Magisk built-in tool specifically designed and optimized for managing properties like no one's business.

EDIT: and yes -- setprop comes built-in into system itself, but obviously you need root to actually use it, [MENTION=4970217]pat357[/MENTION].
[Magisk] zdoe:
[MENTION=5228676]VR25[/MENTION], what might i try next to get this to work?
[Magisk] pat357:
Got it working now using the ScriptFile containing "resetprop config.tima 0"

Thank you so much !

PS" you said resetprop is a Magisk built-in tool, I thought both resetprop and setprop were Magisk only ....

Is setprop installed without installing Magisk ?
[Magisk] hc192:
Hi,

I've been trying to understand how to do, so far, I've managed to install magisk, and fbind module, I've tried to put several text to bindfolderlist.txt, since it's text heavy which I am not familiar with, I am now stuck, is there anyone kind to help me work this out. MTIA
[Magisk] fuzun:
I have an issue.

I have successfully binded folders by running with -mb parameter and files moved to extsd hidden folder ".fbird" . The problem is after this these files can not be accessed from int storage any more. So for me this app only works like moving files.

from_to WhatsApp .fbind/WhatsApp

After this command files gets moved to ext sd card hidden .fbird folder/whatsapp. And Whatsapp app can not access files any more. When I check with a file manager, I can confirm that the files are gone from int storage but also not accessible from int storage.

Debug log says everything is ok.

Sd card is exFAT.
[Magisk] fuzun:
I have tested more.

Mounts can be seen by MiX and Samsung file explorer but can not be seen by apps like X-plore or Whatsapp.

Is it related to permissions?
[Magisk] hc192:
I've been searching from the pages how to use fbind, I have still several questions:

1. what is the exact syntax to put (firstly, trying to move Whatsup; /storage/emulated/0/WhatsApp (int), /storage/5456-E397/Whatsapp) ?

2. to Which file need to be added? (I've install fbind (2018,1,13-1) and Magisk Manager 5.5.5, so far, I've added the lines to ts-binds-folderlist.txt and fbind_setup.txt), did not work,

3. which command to run in order to bind folders ?

using LG G4 (H-ROM V30 PORT V2.2) nougat

thanks
[Magisk] VR25:
To Everyone Facing Bind Issues

- If some apps can access the contents of bound folders while others cannot, that's due to missing/revoked storage permissions and it's a classic issue. If you use Marshmallow, try the Xposed module "Marshmallow SD Fix". If you're on Nougat or above, try the Magisk module "SD Card Write Access Enabler" by [MENTION=1377088]Rom.[/MENTION] Once I have the time, I'll test a different method of getting these permissions granted to all apps at once.

- If none of the apps have access to bound folders contents, then that may have to do with FUSE/SDCARDFS. In this case, run getprop | grep sdcardfs and post the output.

First off, you can easily add lines to /data/media/fbind/config.txt using terminal. There are three commands for that:

1) fbind -a

2) fbind -as

3) fbind -ad

The first lets you type any line(s) you want.

2nd asks for source (internal storage folder) and creates a from_to "source" ".fbind/source" line.

3rd displays a package list of installed apps, asks for user input and creates out of it, the line "app_data PKG_NAME".

These commands are interactive. The default mode allows you to add multiple lines with ease.

Now, If you run, say, fbind -as WhatsApp, then the line "from_to WhatsApp .fbind/WhatsApp" is added to config.txt and the program exits afterwards.

Once you have the desired lines in place, run fbind -mb to move data from source to destination (-m) and bind corresponding folders (-b) all at once. Read /data/media/fbind/info/config_samples.txt for a comprehensive syntax explanation.

Pro tip: use fbind -r to easily remove lines from config.txt.
[Magisk] luboz:
First, thank you for your sw.

I want to use it, but I have some problem.

If I run fbind with or without any option, after 4-5 seconds only message

(!) No settings found

appears on console.

I also tried to create empty /data/media/fbind/config.txt as root, but nothing changed.

I use magisk v15.3 and fbind2018-1-13-1 with lineageos 14.1-20180118-NIGHTLY-mido (android 7.1.2).

What can I do to fix my problem ? Thank you in advance.

Edit: After I manually added one line "target Books" to config.txt, all started to work properly. Strange...
[Magisk] hc192:
Thanks [MENTION=5228676]VR25[/MENTION]

Since I am not familiar with coding and similar applications, I am still not further away from where I started.

My intention is to move and bind all WhatsApp content in intsd to extsd

PFA my source from intsd and extsd. In this case, what should I type exactly to terminal emulator?

MTIA
[Magisk] pat357:
You need to put the commando's in a file called "config.txt" (without quotes).

This file should be in /data/media/fbind/config.txt

Use your file manager and go to /data/media/fbind/ . Here is an example file to see how the config.txt should look like.

There are also some very interesting to read files in IIRC /data/media/fbind/info/
[Magisk] hc192:
Thanks for reply

There is no such file under /data/media/fbind

What should I do?
[Magisk] sdz2:
I want to "mount --rbind /mnt/media_rw/2F73-1505/DCIM /sdcard/DCIM" and have it accessible to all apps.

I have found the documentation somewhat confusing. I tried some fbind configurations, but nothing has worked thus far.

My USB OTG (vfat) drive has a DCIM folder with photos in it. /mnt/media_rw/2F73-1505/DCIM

My internal storage (ext4) has a DCIM folder with photos in it. /sdcard/DCIM

When I insert the OTG drive, I want apps to see the OTG DCIM files when accessing the internal DCIM path. The photos in the internal storage would be obscured by the mounting, and fbind would not need to move any files.

How can I accomplish this with fbind?
[Magisk] VR25:
1. Create a file named config.txt and add the line "from_to WhatsApp .fbind/WhatsApp" to it.

2. Move data to destination either manually or by running "fbind -m"

3. Bind corresponding folders with "fbind -b"

For that, you need "bind_mnt /mnt/media_rw/2F73-1505/DCIM /sdcard/DCIM".

There's a major issue with that, though -- duplicates. In order to avoid that, one of the ends (folders) must have a name starting with a dot (.).

Looking again at what you want to achieve, the config line "bind_mnt /mnt/media_rw/2F73-1505/.DCIM /sdcard/DCIM" is exactly what you need.

Recall that the DCMI folder in the OTG drive must be renamed to ".DCMI" or moved into a dot folder, say ".fbind".
[Magisk] sdz2:
On the OTG, I renamed DCIM to .DCIM and used your command:

"bind_mnt /mnt/media_rw/2F73-1505/.DCIM /sdcard/DCIM"

When I insert the OTG, apps now see the OTG photos. However, (non-root) apps seem to have read-only access to the directory and files. A root shell can modify the OTG contents at /sdcard/DCIM.

I'm still running Marshmallow if that matters.

How can regular apps gain write access to the fbind mount point?
[Magisk] VR25:
Ok, try the following:

TEST 1

Run fbind -u

bind_mnt $extsd/.DCIM $intsd/DCIM

Run fbind -b

TEST 2

Run fbind -u

extsd_path /storage/2F73-1505

bind_mnt $extsd/.DCIM $intsd/DCIM

Run fbind -b

TEST 3

Run fbind -u

intsd_path /storage/emulated/0

extsd_path /storage/2F73-1505

bind_mnt $extsd/.DCIM $intsd/DCIM

Run fbind -b

TEST 4

Run fbind -u

intsd_path /data/media/0

extsd_path /storage/2F73-1505

bind_mnt $extsd/.DCIM $intsd/DCIM

Run fbind -b

Note: config.txt must contain only the given line(s) for each individual test.

----------------------

I'm currently working on several patches to address folder binding issues. Your feedback is very valuable.
[Magisk] hc192:
Thanks to [MENTION=5228676]VR25[/MENTION], I've managed to move and bind folders as it's described above. However, when I tried to open a media file (picture video etc) from WhatsApp, I got "sorry this media file doesn't exist in your internal storage" error. What am I supposed to do? Below is the debug.log

Thanks

Sat Jan 27 01:35:54 EST 2018

<SD Card Information>

/dev/block/vold/public:179,65 /mnt/media_rw/5456-E397 texfat rw,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,codepage=437,iocharset=utf8,min_prealloc_size=64k,max_prealloc_size=62378752,readahead=4M,fail_safe,discard,hidden=show,errors=continue 0 0

/mnt/media_rw/5456-E397 /mnt/runtime/default/5456-E397 sdcardfs rw,nosuid,noexec,noatime,uid=1023,gid=1023,sdfs_gid=1015,sdfs_mask6 0 0

/mnt/media_rw/5456-E397 /storage/5456-E397 sdcardfs rw,nosuid,noexec,noatime,uid=1023,gid=1023,sdfs_gid=1015,sdfs_mask6 0 0

/mnt/media_rw/5456-E397 /mnt/runtime/read/5456-E397 sdcardfs rw,nosuid,noexec,noatime,uid=1023,gid=1023,sdfs_gid=9997,sdfs_mask18 0 0

/mnt/media_rw/5456-E397 /mnt/runtime/write/5456-E397 sdcardfs rw,nosuid,noexec,noatime,uid=1023,gid=1023,sdfs_gid=9997,sdfs_mask18 0 0

<Bind Folders>

[intsd/WhatsApp] <--> [extsd/.fbind/WhatsApp]

- Done.

<Cleanup>

- Done.
[Magisk] VR25:
[MENTION=3620168]hc192[/MENTION], try the latest build (just pushed it to the repo).
[Magisk] sdz2:
I upgraded to 2018.1.27 and I am working through the tests now. I will follow-up shortly.

In the meantime, I think I have found a bug. The "fbind -r ." does not fully remove a command. On the next command, fbind starts by restoring the command from the backup file. To fully remove a command, I have to "fbind -r ." then remove .fbind_bkp/config.txt from the OTG drive.

shell@quark:/ # fbind -l

(i) Searching for config backup
- Creating dummy config.txt

Your fbind config:

shell@quark:/ # fbind -a 'bind_mnt $extsd/.DCIM $intsd/DCIM'

(i) Searching for config backup
- Creating dummy config.txt

<Add config line(s)>

Added line:
bind_mnt $extsd/.DCIM $intsd/DCIM

shell@quark:/ # fbind -r .

Removed line:
bind_mnt $extsd/.DCIM $intsd/DCIM

shell@quark:/ # fbind -r .

(i) Searching for config backup
- Restoring config.txt
Removed line:
bind_mnt $extsd/.DCIM $intsd/DCIM

shell@quark:/ # fbind -l

(i) Searching for config backup
- Restoring config.txt
Your fbind config:

bind_mnt $extsd/.DCIM $intsd/DCIM

shell@quark:/ # fbind -r .

(i) Searching for config backup
- Restoring config.txt
Removed line:
bind_mnt $extsd/.DCIM $intsd/DCIM

shell@quark:/ # rm /mnt/media_rw/2F73-1505/.fbind_bkp/config.txt
shell@quark:/ # fbind -l

(i) Searching for config backup
- Creating dummy config.txt

Your fbind config:

shell@quark:/ #
[Magisk] hc192:
Tried with latest build, but problem still remains, folder seems to be moved to SD card however I can't reach media via WhatsApp.
[Magisk] sdz2:
I finally got it working, kinda.

Step 1: XInternalSD

Install the Xposed module XInternalSD, activate it, and reboot

Uncheck "Custom path to internal SD card"

Check "Full access to external SD card"

Check "Include system apps"

Reboot

Step 2: fbind

Clear fbind config: fbind -r .

Remove fbind backup: rm -f /mnt/media_rw/*/.fbind_bkp/config.txt

Add bind command: fbind -a 'bind_mnt $extsd/foo /sdcard/DCIM'

Issues:

When I insert the OTG drive, fbind sees the OTG and binds sucessfully... sometimes. The DCIM directory is either the OTG or internal.

When I eject the OTG (via the notification dropdown), fbind unmounts sucessfully... sometimes. The DCIM directory is OTG, internal, or empty.

To force an un-bind, I have to open a root terminal and run the following (yes, twice): fbind -u ; fbind -u

To force a bind, I force an un-bind then also run the following (again yes, twice): fbind -b ; fbind -b

For some reason, fbind doesn't always completely bind or unbind on a single call.

Suggestion: Consider adding an app to your module for fbind status and sending fbind commands. Opening a terminal, calling su, and typing the commands can get quite tedious, even in an adb shell.
[Magisk] mimo_s16:
I use this module together with app2sd foldermount function. They work magically
[Magisk] VR25:
**2018.1.28 (201801280)**
- Don't auto-restore config from backup (until next boot) after wiping it clean with `fbind -r .` or similar command
- Minor optimizations & cosmetic changes
- `setenforce 0` config line can be used in case of bind-mounting issues
- Updated reference

NOTES

- This release is not in the repo yet.

- The SDCARDFS-TEST build is only for those who know what sdcardfs is. If you're one of the target people, test it with

setenforce 0

and intsd_path /storage/emulated/0 if default settings don't work.
[Magisk] KRiST0F:
Hmm still don't get it right :(

i'm running a samsung galaxy J5 (2017) patched with latest magisk and fbind.

I found the config.txt in (ROOT)\Data\Media\Fbind\Info

my phone's internal storage is found on (ROOT)\Storage\emulated\

my phone's external storage (SDcard) is found on (ROOT)\D71B-2336\

the folders from my internal storage that i want to be moved and used are:

\Storage\Emulated\Android\ => SDCARD\Android

\Storage\Emulated\Documents\ => SDCARD\Documents

\Storage\Emulated\Downloads\ => SDCARD\Downloads

\Storage\Emulated\MagiskManager\ => SDCARD\MagiskManager

My config.txt:

Your fbind config:

Run fbind -u

intsd_path /storage/emulated/0

extsd_path /storage/D71B-2336

bind_mnt $extsd/.DCIM $intsd/DCIM

bind_mnt $extsd/.Downloads $intsd/Downloads

bind_mnt $extsd/.Documents $intsd/Documents

Run fbind -b

Results after exec fbind -mb

j5y17lte:/data/media/fbind # fbind -mb

Moving data...

- Done.

Binding folders...

bind_mount [/storage/D71B-2336/.DCIM] [/storage/emulated/0/DCIM]

bind_mount [/storage/D71B-2336/.Downloads] [/storage/emulated/0/Downloads]

bind_mount [/storage/D71B-2336/.Documents] [/storage/emulated/0/Documents]

- Done.

However when i use solidexplorer or whatever and i go to /storage/emulated/0/Downloads i can't see the content that is stored on my sdcard (D71B-2336) in that downloads folder.

Someone any ideas?
[Magisk] VR25:
Whoa! Wait... that's not how you're supposed to set things up! ?

Did you really read the reference (especially config_samples.txt) before attempting this? ?

HERE'S WHAT TO DO

1. Run fbind -u

2. Rename all the dot folders back to default names (i.e., .DCMI --> DCMI)

3. Move those to /storage/D71B-2336/.fbind (notice the dot).

4. Remove ALL lines and add the following:

from_to DCIM .fbind/DCIM

from_to Download .fbind/Download

from_to Documents .fbind/Documents

5. Run fbind -b afterwards

6. If that doesn't work

- Run fbind -u

- Add the line setenforce 0 to your config

- Run fbind -b

7. If that still doesn't work

- Run fbind -u

- Add the line intsd_path /storage/emulated/0 to your config

- Run fbind -b

Don't risk your data unless you've got nothing to lose. Knowledge is power. Never stop seeking it.

-----------------------------

**2018.1.29 (201801290)**
- Automatically switch internal storage paths to `/storage/emulated` and SELinux mode to `permissive` if ESDFS is enabled (used in place of FUSE or SDCARDFS)
- Don't auto-restore config from backup (until next boot) after wiping it clean with `fbind -r .` or similar command
- Major optimizations & minor cosmetic changes
- Multi-thread support for `-m` `--rollback` & `--restore` operations -- faster copy speeds
- `setenforce 0` is a recognized config line
- Updated reference

**2018.1.29-1 (201801291)**
- Fixed multi-thread issues in data copying operations (`-m` `--rollback` & `--restore`)
[Magisk] KRiST0F:
I did actualy read it, and i thought i did ok. However:

config.txt now contains these lines:

from_to DCIM .fbind/DCIM

from_to Download .fbind/Download

from_to Documents .fbind/Documents

from_to MagiskManager .fbind/MagiskManager

setenforce 0

intsd_path /storage/emulated/0

When creating files/dolders in /storage/emulated/0/documents it doesn't write to the

sd storage. If i get this working, am also able to 'redirect' the folder /storage/emulated/0/android?

Where all apps are located?
[Magisk] pat357:
I suppose you have already tried with the default parameters for intsd_path and extsd_path ?

It's not that all Samsung devices need these specific path's : I've a Samsung too (S8+) and have to use the default path's

or I get the same problem as you have now.

To use the default path's, don't specify any in your config.txt.

Also, your config.txt should be in /data/media/fbind/config.txt. !!

The directory ROOT)\Data\Media\Fbind\Info contains some very important info (must read it !) and an example of how a config.txt should/could look like.

Further, use the standard command names ! It will safe you some typing.

your config.txt

from_to DCIM .DCIM
from_to Downloads .Downloads
from_to Documents .Documents

Try this and let us know if it works !
[Magisk] VR25:
**Dev Thoughts/Updates**

1. So far, I've tested three (3) SD card mounting mechanisms, presented in descending order of compatibility: FUSE, ESDFS and SDCARDFS.

- FUSE is still the default in many devices and by far, the most compatible with fbind.

- ESDFS needs "intsd_path /storage/emulated/#" (instead of /data/media/#) and "setenforce 0" to work. Though, in some devices, the latter may not be necessary. fbind now recognizes this mechanism and applies all required settings automatically. As a result, things are more likely to work out of the box. "intobb_path" line has been deprecated and "intsd_path /storage/emulated/#" is no longer necessary (unless "persist.esdfs_sdcard=true" prop doesn't exist).

- SDCARDFS -- a.k.a., the unfortunate -- this is still being studied. Up until now it has never worked with fbind.

2. It turns out missing/revoked standard storage permissions *may not* play such a big role in here as previously thought/suggested. The three mechanisms above are the actual "biggies". There might be more of those out in the wild. The focus now is on finding a way of forcibly enabling standard FUSE, ESDFS, or other found-to-be-compatible mechanism.

...
[Magisk] kirt231:
Can you mount an smb share to the SD card?

Or bind might be a better word
[Magisk] pat357:
Is this ESDFS a standard Android thing present on all android devices ?

Will it work on all android phones ?

It would be interesting if we could ever find a way to support it, even if we have a FUSE fallback, because of the better performance of SDCARDFS.

Not sure how you come to this conclusion.

Are these missing storage permissions not the reason why you can't access any saved stuff in for example WhatsApp after binding the dir to extSD or

why apps with the obb's bind to extSD are always asking to re-download the obb, because they are not able to access the obb anymore.

There are a lot of apps behaving the same : I guess in fact all apps that don't have full extSD access via SAF, ... .

Could you please clarify what you mean by this statement ?
[Magisk] VR25:
I'm unsure about that.

Yes, definitely -- I'll keep researching...

Well, that's a bit hard to put into words as the whole thing is more like a puzzle.

After several tests under FUSE, ESDFS and SDCARDFS, regarding permissions, I found that somehow, standard storage permissions don't seem to play the biggest role. The mechanism itself may be to blame. It's as if the permissions were hardcoded into each mechanism, as opposed to being linked to /system/etc/permissions/platform.xml, /data/system/packages.xml or similar file.

... Or perhaps there are two distinct permission groups in play when it comes to bind mounts -- the standard (in the aforementioned files) and mechanism built-in permissions. The latter seem to outweigh the other. :silly:

FUSE and ESDFS work for me without any of the storages permission fixes. I need to set SELinux to permissive mode for ESDFS, though.

Can't say the same in regards to SDCARDFS. With or without the fixes, it doesn't work. I can however see the contents of bond folders using a more capable file explorer such as Root Explorer. Yes, that's with fbind and SDCARDFS enabled. An issue which doesn't seem to make sense is that data in some paths is visible, while in others (supposedly linked to these) is not -- i.e., /data/media/0, /storage/emulated/0 /mnt/runtime/default and so on -- all should have the same contents and those should be visible to Root Explorer when browsing with full privileges... but things get odd with bind mounts and SDCARDFS.

Will keep studying this and posting updates.
[Magisk] s9un:
auto bind

i'm using from_to in my config.txt

everytime i eject sd card and then insert it again, i need to restart phone to bind the folder.

how to make it automaticaly bind when i insert my sd card again?
[Magisk] niksan29:
useful module, but too difficult to use for an ordinary user ...
[Magisk] KRiST0F:
I did a complete wipe of the system, incl sd card.

installed some apps, added magisk and your fbind

with the adviced config.txt content.

Hi it worked :good: :) Thank you!

Only the folder Android goes wrong, but i can live with that.
[Magisk] 白い熊:
[MENTION=5228676]VR25[/MENTION], I'm on Samsung Note 8, Magisk 15.3. The latest version, as well as all the versions since 2018.1.13 give me a bootloop on the Samsung logo—this with an empty config file. No debug.log is generated, so reboots before starting to log.

The latest version that doesn't get in the boot log that I've found is 2017.12.4, it however posts errors in the log:

/sbin/.core/img/fbind/service.sh[32]: source: /data/media/fbind/.config/uvars: No such file or directory
/sbin/.core/img/fbind/service.sh[32]: source: /data/media/fbind/.config/debug: No such file or directory

…

/sbin/.core/img/fbind/service.sh[34]: source: /data/media/fbind/.config/bind: No such file or directory

In fact the “.config” dir doesn't get created anywhere in the setup process of 2018.1.30, so maybe it's the same error, just not logged and it reboots—just a thought.

I've tried with .bfbind when setting up 2018.1.30 doesn't help.

Any idea what this could be?

Don't have any versions between 2017.12.4 and 2018.1.13 to nail closer the change that's causing the boot loop.
[Magisk] VR25:
To avoid that, you must unmount all folders before ejecting the SD card. The command for that is fbind -u. Use ScriptManager (app) widgets or similar to quickly mount/unmount fbind directories if you mind typing fbind -u on terminal every time you need to eject the SD card and fbind -b after reinserting it.

Actually, you don't want to read the reference. Come on, it's not hard at all. ;)

Try without post-fs-data.sh, then service.sh.

This may lead us to the source of the issue.

Regarding .config dir -- it's no longer used. Quite a lot has changed recently.