yashsingh1/xdaforums huggingface dataset:
[Magisk] 白い熊:
Yep, it's in both of them. I'm gonna start looking—any recommendation on what to quote out, what could be it most likely?

So I've seen :@) That's why I'd like to mess with it again…

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

It's the damned SElinux, setting in to permissive results in an immediate reboot, ugh… How to get past this?
[Magisk] VR25:
Try replacing all instances of "setenforce ." with ":" or "true".

for file in $(find /sbin/.core/img/fbind -type f 2>/dev/null | grep -v cryptsetup); do
sed -i 's/setenforce ./:/g' $file
done
chmod -R 755 /sbin/.core/img/fbind
[Magisk] 白い熊:
Yeah,-that's-understood—that's-easy-:@)-

It was more a philosophical question of how to be able to set this phone's kernel on permissive mode, sorry…

I've already replaced everything, will see…
[Magisk] niksan29:
you are a developer and therefore you are not at all difficult)))

and I will have to use an application with a graphical interface, for example: App2SD: All in One Tool:rolleyes:
[Magisk] HollowHead100:
finally i'm able to use this module on my device, thank you so much for your hardwork on this module VR25 :D

if you don't mind me asking, there are several questions in mind :

1. will it work on any android version? especially on oreo.

2. what happen to obb files/folder for apps that installed after implementing the fbind obb syntax? will it automatically move and binded to sd card, or do i have to manually move it?

3. for future reference, how do i uninstall this module? i assume when i want to uninstall it, i do it on magisk manager.
[Magisk] VR25:
Well, fair enough. I known this module as well as I known my thing down there. However, that would be far from a great achievement if I couldn't write a comprehensive reference and easily readable code to help others be on the same page. Bonus: I'm always willing to help -- going as far as writing lengthy step by step guides.

If taking in all the text I wrote for reference is overwhelming, just tell me exactly what you would like to achieve and I'll go straight to the point as to what you need to do in order to get there. I'm sure you can befriend this stuff in no time and forget about the "absolute" need for a graphical user interface. ;)

1. All I can say is it works for me from Marshmallow all the way up to Oreo 8.1. Plus, you don't have to set things up again after switching ROM's. Settings are persistent across standard TWRP factory resets and fbind automatically backs up its config to the external SD card & automatically restores it when needed.

2. You set things up once and forget. New apps obb contents don't need to be moved. Since the main obb folder itself is already bound to extsd/Android/obb, everything goes there by default.

3. That's right. You can also uninstall it from recovery -- using a module/tool named "Magisk Manager for Recovery Mode".
[Magisk] HollowHead100:
thanks for answering :good: hearing that it works on oreo makes my plan to upgrade to oreo much more appealing :laugh:
[Magisk] Yom:
Hi VR25,

Hope you are well. Thank you for this awesome piece of software.

I have been using fbind successfully for months, until last night... I updated fbind to the 31st version, and this morning none of my bound folders were working at all. There are no errors in the Magisk log, and the debug.log in the /data/media/fbind folder is not created.

Is there anything I can gather to assist in troubleshooting this issue?

Thanks!

F.
[Magisk] VR25:
I'm fine, thanks.

Which version were you using prior to installing the latest?

If it's too old, you may need to move config.txt to /data/media/fbind.
[Magisk] Yom:
Hi,

I've been regularly updating fbind as soon as a new version comes out. I'm running BatMan ROM 1.5.0 with Magisk 15.3 and Notorious kernel on a Galaxy S7 edge. My config file has been living in /data/media/fbind for a long time.

Today I have tried dirty-flashing my ROM and Kernel with Magisk 15.3, clearing Dalvik, rebooting after making changes to my config file... and still no bindings or debug.log in /data/media/fbind. I have also tried older versions I know worked, from december and earlier in january. None work now :crying:

If I run fbind -b form an elevated shell, it outputs like it bound the folders, but nada. No bindings or debug.log.

The Magisk log has only one error, unrelated to fbind.

Anything I can get to facilitate troubleshooting?
[Magisk] pat357:
About the bootloop : I've the same problem with my Samsung S8+ : the problem is that with the default install, the later modules will create fbind in /system/bin/.

Apparently our phones don't like this and go in a bootloop after installing.

The working alternative is to install fbind in /system/xbin/ if you have that folder already.

VR25 created a trick to accomplish this : run touch /data/.xfbind & reinstall the module from TWRP.

You only have to do this once, after this fbind will always be installed in /system/xbin instead of /system/bin.

That's also the reason I keep forgetting the right command, because it has been so long since I used it :D

About the other errors : maybe they are already addressed in the current version (by VR25), just test with the latest version.

If you still have problems : post the log and your config.txt.
[Magisk] pat357:
Is Magisk properly installed ? Do you have root ?

Have you checked that your name-space for root is set to "Global namespace" ? (Magisk Manager -> settings -> namespace)

Is the fbind-module shown as installed in Magisk Manager ?

Sometimes the to complete the bindings, a reboot might be needed ... did you reboot after everything was installed ?

Have you tried to reinstall the module, while keeping the config.txt in /data/media/fbind/ ?

fbind -l should show all the configured bindings, does it ?

Are the rest of your apps working like before or did they lose their settings ?
[Magisk] Yom:
The culprit is Magisk Charging Switch! The latest version kills fbind!

I disabled cs, rebooted, and fbind worked like a charm! The 31st version, even.
[Magisk] VR25:
OK, that's really... odd! :D

Everytime such an issue is reported, I wonder why -- what the cause could be. This two modules group has always been working for me -- even the latest versions.

The problem could be that I'm using background subshells in the boot scripts of both modules for parallel processing.

... But again, I never thought multiple background subshells could be an issue for some. Everything works just fine on my side. The question I ask myself is -- is that a Magisk or built-in shell limitation?

It would be great if you could have both modules installed again and test whether they work correctly after running the commands below as root -- paste on terminal, one at a time.

1) sed -i '/(BackgroundActions)/s/(//s/)//' /sbin/.core/img/fbind/service.sh

2) sed -i 's/(//s/)//' /sbin/.core/img/cs/service.sh

3) chmod 755 /sbin/.core/img/fbind/service.sh /sbin/.core/img/cs/service.sh
[Magisk] VR25:
**Dev Update**

- It turns out ESDFS (Emulated SD Card Filesystem) works only partially. This leave us with a single option now -- FUSE (Filesystem in User Space). The good news is FUSE interface seems to be present in most [if not all] Android flavors/versions.

- The next fbind update will disable ESDFS in addition to SDCARDFS. This will allow FUSE to work by default. In turn, this procedure outputs a major boost in compatibility. So, folks who can't bind-mount with fbind may be shed some light on. :)

- I'm still diving deeper into SDCARDFS territory and permissions-related stuff for the sake of future-proofiness. By the way, is that really a term? :p.

Edit

I managed to successfully unmount all FUSE-related stuff. This means it may be possible to replace FUSE with standard mounting method (using mount and mount --bind) and say goodbye to the overhead issue & enable extra features, such as symbolic/hard linking.
[Magisk] wonkxin:
interesting module.

Error report:

It says all is done, but the folders are not mounted.

Samsung Galaxy Note 4 SM-N910F

Marshmallow 6.0.1

debug.log

Fri Feb 2 09:14:10 CET 2018

<SD Card Information>

<Bind Folders>

[/storage/emulated/0/test] <--> [/storage/7B61-3E76/.fbind/testt]

- Done.

(i) Nothing to clean
[Magisk] 白い熊:
Wow—things have really advanced, since I've been gone—I've done some testing already…

FUSE is a safe fallback generally. I've tested yesterday: an exfat SD I FUSE mounted by the phone automatically—some of the apps can't write to it due to permission restrictions, I mounted a dir from it via fbind and the app that couldn't now could write to the mounted location—surprising… Might need to test some more…

Anyhow, now with LUKS, due to bindmounting, it seems there are mounting GNU permission issues: I mounted a LUKS ext4 partition via fbind, and bindmounted a dir from it to int.

Now, the dir on the LUKS mounted partition has proper permissions: drwxrwxrwx, owner root root, so that everything should be able to write there. The bindmounted directory is drwxrwx--x, owner root sdcard_rw, the apps can't write to it.

I'm not at the computer now, so can't check the bindmount syntax, but maybe it needs to be bindmounted differently, so the GNU permissions would be elevated, then this might enable access.
[Magisk] 白い熊:
Hmmm, I changed “mount -o bind” in core.sh to “mount -o user,bind”, but it has no effect — the bindmounted dir is still drwxrwxrwx--x which is strange, since if I mount the same dir by hand with the same options through mount, not through fbind, the mounted dir is 777. How can this be?
[Magisk] Yom:
This morning, after getting to the office, I re-enabled cs and rebooted. My folder bindings went the way of the dodo. I ran the sed commands you suggested, as root, from a terminal via ADB, and rebooted.

Aaaaaaaaaaaaaaand..... (drumroll, please)

Phuc. :(

Same shazzbatt.

Disabling cs until bugfix notice :crying:
[Magisk] aseferfan:
can someone help with binding the internel obb folder to externel obb folder so that games can read obb folders from externel sd instead of internel sd?

i have tried almost all the commands, "obb" , "from_to Android/obb Android/obb" ,

I even changed the intsd_path to "storage/emulated/0" and extsd_path to "storage/9014-E421"

by changing the intsd and extsd folders i got samsung file manager to think that intsd-obb folder is indeed extsd-obb folder but when i launched a game it still could not detect the the obb data and started downloading again

I am doing something fundamentally wrong, aren't I?

Also my titanium backup cannot seem to write in mnt/media_rw/9014-E421 for some reason, isn't that partition make extsd writeable by normal apps? did VR25 merge this module with ExSDCard Write Access Enabler?

which makes mnt/media_rw partition writeable
[Magisk] zerdnelem:
[MENTION=5228676]VR25[/MENTION]

thank you and great work with this module.

i just have this problem that i now i think the extsd has been duplicated, how to fix this? please see screenshot below
[Magisk] pat357:
What phone do you have ? (model and type please)

Does your system have both the directories /system/bin and /system/xbin ?

If both are there, check also in recovery (TWRP->advanced->file-manager) if both are there.

Which one do you have in the Magisk log ? (something like the first code piece or like the second one ?)

https://xdaforums.com/showpost.php?p=75470187&postcount=389

Or maybe just post your magisk.log if you do not know what I mean.

There were similar issues reported here about cs-module disabling the systemize-terminal module (Pixel devices) :

https://xdaforums.com/apps/magisk/module-terminal-app-systemizer-ui-t3585851/page39

---------- Post added at 11:24 PM ---------- Previous post was at 10:55 PM ----------

What screenshot ?

Post your config.txt and the log from /data/media/fbind/.

---------- Post added 7th February 2018 at 12:04 AM ---------- Previous post was 6th February 2018 at 11:24 PM ----------

About apps not able to access obb files after binding them to extSD card :

This is still a major problem for Nougat (SDK 24) and newer, and AFAIK, there is no universal solution ATM.

If you're running something Pre-Nougat (SDK < 24), you can use the "ExSDCard Write Access Enable module" to get full extSD access,

but this module doesn't work on Nougat or newer.

However, all apps & games that use SAF (DocumentProvider) should be able to access the SD card. These apps & games ask something along

about access "documents and media.....". SAF has to be implemented in the app to get extSD access.

For more info about SAF/DocumentProvider, google is your best friend ;)

The good news about Titanium Backup is that it uses SAF : if you try to access the extSD card, IIRC you get the chance to select a way to access

the extSD somewhere (it has been 8 months since I used and my memory is fading a bit :o) : then choose "Android 5.0 and higher (documentprovider)".

After this the Samsung file-manager should open, and this is important, select the root from the extSD.

It should become clear once you through these steps, it's not really hidden.
[Magisk] zerdnelem:
[MENTION=5228676]VR25[/MENTION]

You're the best! :good: Tnx for this module. :)

please tell me that I've got it correctly, and things are it should be.

mido:/ $ su

mido:/ # fbind -l

Your fbind config:

from_to "viber" ".fbind/viber"

from_to "DCIM/.thumbnails" ".fbind/DCIM/.thumbnails"

obb

from_to "MIUI" ".fbind/MIUI"

from_to "Android/data" ".fbind/Android/data"

mido:/ # fbind -log

Wed Apr 22 10:46:30 GMT 1970

<SD Card Information>

/dev/block/vold/public:179,65 /mnt/media_rw/9099-07FC vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

/dev/fuse /mnt/runtime/default/9099-07FC fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/fuse /storage/9099-07FC fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/fuse /mnt/runtime/read/9099-07FC fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/fuse /mnt/runtime/write/9099-07FC fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

<Bind Folders>

[/data/media/0/viber] <--> [/mnt/media_rw/9099-07FC/.fbind/viber]

[/data/media/0/DCIM/.thumbnails] <--> [/mnt/media_rw/9099-07FC/.fbind/DCIM/.thumbnails]

[/data/media/obb] <--> [/mnt/media_rw/9099-07FC/Android/obb][/data/media/0/MIUI] <--> [/mnt/media_rw/9099-07FC/.fbind/MIUI]

[/data/media/0/Android/data] <--> [/mnt/media_rw/9099-07FC/.fbind/Android/data]

- Done.

(i) Nothing to clean

mido:/ #
[Magisk] aseferfan:
Okay but if apps could not access the extsd(means they cannot even write in it) then when i launched a game (eg : Xenowerk) it could not find the bound 'obb' folder thus started downloading again, but if apps couldn't write in extsd how was it downloading the obb data file?

whats more weird is that i went to data/media/obb and i saw my EXTSD obb folders there (which should happen if obbs are bound) but when i went inside obb of data/media/0/Android/obb there was no obb folder but it was obb file only(no folder icon, just a file with unkown extension)

I tried binding the data/media/0/Android/obb with ext$sd/Android/obb but if i do that the obb inside the intsd is empty.

I have been wanting to bind this godforsaken obb folder of intsd to extsd since the time i couldn't use XinternelSD anymore as magisk don't support Xposed but so far no luck even after a year T_T
[Magisk] jjakajonas:
Okay.

This is maybe a stupid post.. But yeah.. I'll give it a try.

I have a HTC one A9 international whit lineage 14.1 and magisk with fbind.

The reson is for make more space on the device and make more use of the external SD card.

The thing is I dont know how to use this :eek:

Do I just make the folders on the external SD or do I need to script some where?

I don't get it. Even after reading on the info in magisk and reading a bit her.
[Magisk] pat357:
All the folders should be created automatic, no need to create any folders by hand.

First you have to create a file called config.txt and put it in /data/media/fbind/

Look in the example file how the config.txt should look.

The most important commands are from_to and target

For example, to put your download folder on extSD :

content of config.txt

from_to Download .fbind/Download

After saving this config.txt to /data/media/fbind/ , do the following in a terminal :

su -mm
fbind -mb

Now the content of your Download folder should moved be on extSD in the hidden folder .find/Download.

The Download on intSD will still show your the same files as .find/Download on extSD.

You can do this with almost all directories in your intSD, by adding the directories to your config.txt.

Example :

content of config.txt

from_to Download .fbind/Download
from_to WhatsApp .fbind/WhatsApp
from_to MagiskManager .find/MagiskManager
from_to MEGA .fbind/MEGA

This should put you on your way.

For more commands to use in config.txt, you still need to re-read the files in the info dir !
[Magisk] jjakajonas:
Okay I did not know there was a info folder.

So basically now I know I have to find that and read more before I do any thing.

Thanks for the pointers
[Magisk] aseferfan:
I would like to Save my OGYoutube Videos to externel SD card WITHOUT using document provider storage system, so i i put in this line in config.txt

from_to OGMods OGMods

after that i run fbind -b as root in terminal

but after that i restarted the device to complete binding, but after going into file manager i see the OGMods folder became a file and i cannot save anything to $intsd/OGMods folder and OGYoutube cannot access it anymore

What am I doing wrong? I have read through the readme and config.txt three times now and I cannot understand what am I supposed to do :(
[Magisk] 白い熊:
[MENTION=5228676]VR25[/MENTION] please replace the cryptsetup binary with the one from https://xdaforums.com/android/software/utils-data-recovery-tools-testdisk-t3709380

It's the new cryptsetup 2.0.1 with support for LUKS2. It's statically compiled and I've confirmed it works.
[Magisk] pat357:
The obb is then downloaded to intSD.

You should look only in /data/media/obb.

If the obb is not visible in /data/media/obb using a good file-manager (X-plore, Solid Explorer, Total Commander,..), the app won't find it either.

Xposed should run fine together with Magisk : the only thing is Magisk can not hide Xposed & SafetyNet-tests will fail. You will lose G-pay and some apps may stop working (banking apps).

But Xposed, including XinternelSD, will work.
[Magisk] 白い熊:
Actually no, hang on, this binary seems to have issues… It doesn't Open properly it seems—I'll do more testing…
[Magisk] aseferfan:
Okay I can see the obb inside data/media/obb with ES Explorer but the problem is that the app(xenowerk) still cannot find its obb folder(com.pixelbite.mutant) and also it is failing to download new obb files as well.

Note that the obb inside storage/emulated/0/Android is now a FILE with unknown extension
[Magisk] jjakajonas:
I have now looked in to the data folder in the root of my device but its empty.

I can't even find the info folder any where on my device.

I have even looked in the magisk folder in root.
[Magisk] 白い熊:
[MENTION=5228676]VR25[/MENTION] all is good—the binary works fine for LUKS volumes, it doesn't successfully open LUKS2 volumes, but that might be kernel-based. No errors or problems identified, you can upgrade.

As a user request, I'd like to ask for adding separate switches or options for “fbind -b” and “fbind -u” that would enable you to mount and unmount directories selectively, in an interactive way, in the spirit of “fbind -r”. This would be a great help for testing…
[Magisk] pat357:
Does Mix has root access enabled ?

Are you sure you are in <root>/data ?

That empty /data folder doesn't look too good, but I think you're not really looking at <root>/data !

Look at <root>/data/media/fbind

Post your config.txt you used and the log.
[Magisk] jjakajonas:
It's having root access.

I thort I should read the text file in that folder before I made the config.txt.

Okay..

Minor update.

The ES File Explorer had not got the prober root permission. Now it has and now the files are there as told.

So now I'm back to reading before I do more.

Thanks for the help so far.
[Magisk] AlienTeck:
The info folder would be in root/data/media/fbind and inside it config.txt and info folder with config.samples.txt etc.
[Magisk] zerdnelem:
Please help, my phone is Xiaomi Redmi Note 4X

mido:/ $ su

mido:/ # fbind -as

<Add config line(s)>

(i) Input a source path at a time (i.e., Download or "WhatsApp/Media/WhatsApp Video").

- Hit ENTER when done or press CTRL (Vol. Down) + C to abort.

Android/obb/com.netease.chiji

Added line(s):

from_to "Android/obb/com.netease.chiji" ".fbind/Android/obb/com.netease.chiji"

mido:/ # fbind -mb

Moving data...

- Done.

Binding folders...

mkdir: can't create directory '/data/media/0/Android/obb/com.netease.chiji': No such file or directory

[intsd/Android/obb/com.netease.chiji] <--> [extsd/.fbind/Android/obb/com.netease.chiji]

mount: mounting /mnt/media_rw/9099-07FC/.fbind/Android/obb/com.netease.chiji on /data/media/0/Android/obb/com.netease.chiji failed: No such file or directory

- Done.

mido:/ #
[Magisk] aseferfan:
Update to my previous post, regarding bound folders becoming file on internel sd

Okay so i have set my kernel to permissive mode(custom kernel),

used 'setenforce 0' as well as 'intsd_path storage/emulated/0' in config.txt.

but using 'intsd_path storage/emulated/0' seems to cancel all binding as my bound folders become empty ones orignally located in my internel sd. but if i use the default data/media/0 as intsd_path, then bound folders become files again :(

i thought SElinux was causing issues but even after setting it to permissive my bound folders are still hidden files.

and FYI, I am in a stock touchwiz 6.0.1 MM rom AND I have extsd access write enabler module on via magisk and apps like ES explorer can freely access mnt/media_rw.
[Magisk] jjakajonas:
As said in a earlier post.

I have found it.

But thanks any way.
[Magisk] pat357:
Permissive shouldn't be needed for FUSE.

When you change your intsd_path , you put intsd_path /storage/emulated/0, do you ? (mind the / as the first character)

please post your config.txt and the log

Can you also post the output from this :

mount | grep -E '[0-9A-F]{4}-[0-9A-F]{4}'

Also it seems your Sammy doesn't need a special path for intsd, so for now

do not specify any intsd path in your config.txt : it will use the default.
[Magisk] aseferfan:
After running

mount | grep -E '[0-9A-F]{4}-[0-9A-F]{4}'

I got this log in terminal emulator

and also i posted the log i get after i run 'fbind -b'.

my config.txt

setenforce 0
obb

from_to OGMods OGMods

my debug.log

Sun Feb 11 02:00:46 +06 2018

<SD Card Information>

<Bind Folders>
[/data/media/obb] <--> [/mnt/media_rw/9016-4EF8/Android/obb]
[/data/media/0/OGMods] <--> [/mnt/media_rw/9016-4EF8/OGMods]
- Done.

(i) Nothing to clean

One thing to note is that, when i connect my device VIA MTP, I can only see the contents of my externelsd OBB folder for SD card, o.O is that supposed to happen?