yashsingh1/xdaforums huggingface dataset:
[Magisk] nl3142:
First, is your SD card formatted as fat32/exfat or ext4/f2fs? Because if it is ext4/f2fs you will need to fix the permissions in recovery (reboot into TWRP, cd /external_sd and then after checking with pwd to make sure you are in /external_sd using the following two commands : chown -R media_rw.media_rw * and chmod -R 755 *

If that doesn't work I can only suggest installing Resurrection Remix if it exists for your phone or Lineage if it does not. Though you might try converting your card to ext2/3/4 or f2fs first as that may help.
[Magisk] nl3142:
While I have managed to get almost everything working on my phone, I am unable to successfully bind app folders (/data/app/com.app.foo). While it appears to work at first after a reboot the bound app is no longer installed.

bind_mnt /mnt/media_rw/1a29fc18-6fd2-412c-8b0e-2e2faa4b3ee3/.0appfbind/com.opera.mini.native.beta-1 /data/app/com.opera.mini.native.beta-1 -mv [code]
[Magisk] VR25:
[MENTION=4130318]nl3142[/MENTION], the module had ExSDCard Write Access Enabler v2.1's feature, but it didn't seem to solve the problem -- so I removed it.

This shouldn't be necessary, since fbind uses "cp -a" -- which includes ownership, permissions and timestamps altogether.

Well, fbind was never intended to do that. The issue with this is -- installed apps must be present in /data/app before the sdcard is mounted.

- That could work otherwise, but considering how Android has changed in this regard, I thought major issues would eventually surface.
[Magisk] nl3142:
Well ExSDCard Write Access Enabler v2.1 was the only thing that made fbind work at all for me though I am on Resurrection Remix which is Lineage based (and even with that permissive mode is required for /data/data/ binding to work properly but moving /sdcard/Android just needed the write access enabler). I think the issue is that there are so many different versions of Nougat that it is hard to tell what if anything will solve the problem. In some cases you need ExSDCard Write Access Enabler v2.1, in other cases you need the selinux version of ExSDCard Write Access Enabler v2.1 (which uses init.d to enable permissive mode), in other cases you need ExSDCard Write Access Enabler v2.1 plus Magisk SELinux Permissive Script (if you need permissive mode but don't have init.d support), in some cases (like mine) you need ExSDCard Write Access Enabler v2.1 plus SELinuxModeChanger (as some roms, like mine, will switch selinux back to enforcing shortly after boot even if you use something like Magisk SELinux Permissive Script) while other cases may require ExSDCard Write Access Enabler v2.1 plus Magisk SELinux Permissive Script plus SELinuxModeChanger.

Finally, in some cases none of the above will do and the only solution is to change roms if possible. Though in some cases switching from fat32/exfat to f2fs/extX may help as well.

In other words there is no general Nougat fix, just ones that may or may not work depending on the rom you have.
[Magisk] VR25:
You're right. Unfortunately, that's the price we pay for too much security. Even init.d itself is essentially dead due to crazy SELinux policies.
[Magisk] nl3142:
More like vendor fragmentation as each has their own policies and may add additional stuff to the standard AOSP selinux policies or even additional code to the kernel/rom so even if selinux is disabled it still might not work. That being said, the sd card read/write fix functionality is often useful (especially with Resurrection Remix and presumably Lineage as well), perhaps it could be made a config option such as media_rw or media_rw_selinux depending on if permissive mode is desired.
[Magisk] goose2600:
Thank you [MENTION=4130318]nl3142[/MENTION] and [MENTION=5228676]VR25[/MENTION]!

I tried all the suggested tips, anyway I still can't get fbind to work.

I think it's related to something in Emui rom, I will try another rom.
[Magisk] fhLan:
i can't bind obb by typing from_to in config file. what should I do?
[Magisk] JudgeDread11:
You should read the op and then the config samples.
[Magisk] theredbaron1834:
Hope someone here can help. Been trying to find a way to do bind mounts, for near a week now. No luck. I tried other mount options, to no avail too.

So, I am trying to mount /sdcard/Wagic to my internal card (wagic uses 4+gb's), and I have an 8gb rom :(.

So, my config is just

"intsd_path /sdcard

from_to. Wagic Wagic"

Debug log is

"

Sat Nov 11 00:07:23 GMT 2017

<Config Update>

- Done.

<SD Card Information>

/dev/block/vold/public:179_65 /mnt/media_rw/7A74-1200 vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,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/7A74-1200 fuse rw,nosuid,nodev,noexec,noatime,nodiratime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/fuse /storage/7A74-1200 fuse rw,nosuid,nodev,noexec,noatime,nodiratime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/fuse /mnt/runtime/read/7A74-1200 fuse rw,nosuid,nodev,noexec,noatime,nodiratime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/fuse /mnt/runtime/write/7A74-1200 fuse rw,nosuid,nodev,noexec,noatime,nodiratime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

<Bind Folders>

- Done.

<Cleanup>

- Done.

"

Anybody have any ideas? Or does it just not work with LineageOS.
[Magisk] VR25:
I can help you, but only after you've read all the documentation thoroughly. ;)

Start with /data/_fbind/info/config_samples.txt or /data/media/fbind/info/config_samples.txt (if you're on the latest version). That file alone has your answers.
[Magisk] theredbaron1834:
I have no info folder for some reason. I know I did before the last update (when it was in data/_fbind), not sure why it is not there now. I will try reinstalling and looking through it again.
[Magisk] walent:
>it made my dcim folder hidden, i don't even know how i fixed it
[Magisk] Arn0ldx:
:D
[Magisk] VR25:
It's been a while without any updates. I didn't forget about you, though. Still reading the docs? ;)

You don't need to specify intsd_path. By default, fbind uses /data/media/0 which is analogous to /sdcard. Now, for Wagic, you use the line "target Wagic" if that folder has no media files. Otherwise, use "from_to Wagic .fbind/Wagic".

Been reading the instructions?:)

I like that expression! ?
[Magisk] Arn0ldx:
This is an awesome module,:good: is a shame that I don't know how to use it very well :eek: but I hope I can catch it
[Magisk] gsser:
I got this inatalled now but need help. I have gtasa, ihave an empty obb folder at internal storage and 2.5gb at sd card obb. Folder names are same. How can i connect those 2 folders? I didnt understand anything from that list...

Internal android/obb/com.rockstargames.gtasa empty

Sd android/obb/com.rockstargames.gtasa 2.5gb (want to use this folder to free up space)

Should i move all files from sd to internal and type the last command?

Now i have obb folder in internal, what should i do? I dont understand any single thing from that terminal, i just wanna have that big obb folder at sd card and play the game...
[Magisk] VR25:
Paste the following code onto your terminal and hit ENTER:

su -c rm /data/media/fbind/config.txt && echo "obb com.rockstargames.gtasa" > /data/media/fbind/config.txt

Once you're done with that, manually move gtasa folder to the external storage, then run "fbind -b".
[Magisk] gsser:
Didnt work...
[Magisk] Captain_Throwback:
[MENTION=5228676]VR25[/MENTION]

Is the config.txt in $extsd/.find_bkp set to automatically overwrite the config.txt found in /data/media/fbind? Because I'm using MultiROM, and that has messed up my fbind setup on my secondary ROMs. Since my secondary ROMs are different Android versions, they classify the SD card path differently, so if it keeps getting overwritten, I have a big problem. Can you confirm, and if true, make that optional, somehow? Now I have to search my previous posts in the thread and try to remember how I had my config.txt set up :/. And hopefully that doesn't break my other secondary when I boot into it.

P.S. I'm retiring from posting on the forum after this post, so if I have any other questions, I'll have to send them to you via PM. Sorry!
[Magisk] DR64XDA:
extsd variable containing more lines

Hi VR25, am a newby XDA user (my first message at all :)) and recently installed Magisk Folder Bind.

The module works smoothly after I had to explicitate the sd card path by adding the line:

extsd_path /mnt/media_rw/3839-3133

in /data/media/fbind/config.txt as from your config sample

While this worked quickly, I was curiuous to understand the underlying hence:

1 - Uninstalled the module and listed the folders of /mnt/media_rw/ in a terminal shell

root@:/data/media/fbind # ls -1d /mnt/media_rw/*

/mnt/media_rw/3839-3133

/mnt/media_rw/usbotg

2 - Reinstalled the module without forcing the sd path and listed again the folders of /mnt/media_rw/

root@:/data/media/fbind # ls -1d /mnt/media_rw/*

/mnt/media_rw/3839-3133

/mnt/media_rw/3839-3133\nusbotg

/mnt/media_rw/usbotg

Please note the second one as Android was able to create a folder with a multi-line name :)

Could not directy past here the special name but checked by redirecting the output to a file and hexdumping it.

And the folder bindings where not showing up as they referred to this new folder.

3 - Had a look (not a deep one) to /magisk/fbind/core.sh and found the default setting for the extsd variable in function default_extsd()

extsd="/mnt/media_rw/$(ls /mnt/media_rw)"

where the $(ls /mnt/media_rw) is actually returning two lines to the extsd var.

Unless your module has other needs - I didn't inspexted everything - could extsd contain just one item/line?

I mean something as one of belows, of course there are more and better ones:

# This ones assumes sd card as the first folder entry in the form NNNN-NNNN with N=hex-digit

extsd="$(ls -1d /mnt/media_rw/* | grep -E '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}' | head -n 1)"

echo $extsd

# This ones assumes sd card as the first folder entry

extsd="$(ls -1d /mnt/media_rw/* | head -n 1)"

Note the command option is 1 (one, for one column), not l (long format) :)

I won't go with $(getprop vold.path.external_sd) as this ones could require too many assumptions for being reliable ...

Both commands also worked by replacing /mnt/media_rw/ with /mnt/runtime/default/ as my 3839-3133 folder showed up there as well.

Understanding this is not a huge priority, I'll appreciate a lot your feedback.

Thanks
[Magisk] VR25:
1. Manually remove the file /data/media/fbind/config.txt

2. Run

su -c echo "extsd_path /mnt/media_rw/C0FA-8794" > /data/media/fbind/config.txt && su -c echo "obb com.rockstargames.gtasa" > /data/media/fbind/config.txt && su -c fbind -b

The config is only overwritten if its empty. To disable that, simply comment lines 193-196 in core.sh.

#if ! grep -q '[a-z]' $config_file; then
#[ -f $bkp_file ] && cp $bkp_file $config_file
#chmod 777 $config_file
#fi

I'll add a config switch for this feature.

Regarding the retirement -- not going to ask why, but you're free to PM me whenever you need to.

In the past, I took an approach very similar to

extsd="$(ls -1d /mnt/media_rw/* | grep -E '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}' | head -n 1)"

However, that proved to be an issue when multiple folders are listed in /mnt/media_rw. Besides, non-FAT formatted SD cards don't have the XXXX-XXXX name/serial. I personally use f2fs for my SD card; some people have two SD card EXT/f2fs partitions... you can already see where this is going. ;)
[Magisk] DR64XDA:
Sure, I see. Thanks for your quick response.
[Magisk] gsser:
i will try later
[Magisk] VR25:
# 2017.11.23 (201711230)

- Ability to disable config auto-backup and/or restore (config switches: no_bkp, no_restore)

- General optimizations

- Isolated cryptsetup binary

- Renamed "cryptsetup=true" to "luks"

- Updated reference
[Magisk] ainurrofiq:
When I typed fbind on terminal emulator, it doesn't showed the interactive command.

Just stuck on fbind

Latest version of this modules
[Magisk] FHC1998:
Same problem here, reverted to 9.11.17 version.
[Magisk] ainurrofiq:
Can you PM me with 9.11.17 version?
[Magisk] FHC1998:
Of course
[Magisk] serdotlinecho:
I need this too. The latest version didn't work here.
[Magisk] FHC1998:
Since it appears to be a spread problem I'll post the link of 2017 11 9 version here:

https://drive.google.com/file/d/1D1bAGxxyGU-jHe8NROpU0tOyDnCTcC8G/view?usp=drivesdk

If by any means, [MENTION=5228676]VR25[/MENTION] think this is ot or want it removed I'll remove ASAP.
[Magisk] VR25:
No, that's fine.

While I look for the cause, I wonder how/why is everything working flawlessly for me... :eek:
[Magisk] FHC1998:
The weird part I noticed is that the logs are empty, I was gonna upload the logs when I noticed that the last log I had was from August when I last configured fbind.

Even though I tried uninstalling and reinstalling and reconfiguring, I could not produce logs with the new version.
[Magisk] zelleb:
Hope this helps [MENTION=5228676]VR25[/MENTION]
[Magisk] VR25:
No wonder why it's been working for me, regardless. My setup is completely different from yours.

Build 2017.11.24 is up to address this issue.
[Magisk] FHC1998:
2017.11.24 working fine here. No problems to report. :good:
[Magisk] aseferfan:
i am getting "sh: fbind: not found" in terminal emulator,

i have typed 'su' and granted root access to terminal emulator but it doesn't seem to find the fbind command?

I am doing something wrong aren't I?

using magisk 14.5 with magisk manager 5.4.3

attached screenshot and magisk_log of last boot
[Magisk] DR64XDA:
Hi VR25,

Ann bothering you again with another small question :)

I tried to temporarily disable the module by typing

find -x

at command prompt (as root) then reeboting.

The module was still up (of course I could do through Magisk Manager app but I was using adb) so I tried again but same result.

Then by chance I tried while staying in / path (I previously issued the command from /data/local/tmp) and it worked.

Not sure about as I could have missed something else but maybe some relative path involved ? I saw in the script a couple of touch and rm commands over "magisk/find/disable" while the most of the other commands are using $module_path.

If so, by info, I have also read on official Magisk page that now magisk stuff moved under /sbin/.core (/magisk still exists as symlink for backward compatibility). And also saw on my device that /dev/magisk disappeared at all and its contents now are under /sbin/.core/img

Using with Magisk v14.5, Magisk Manager 5.4.3

Thanks in advance!

---------- Post added at 02:19 AM ---------- Previous post was at 02:16 AM ----------

I mean, I typed

fbind -x

My spell-checker gets me mad!!!!
[Magisk] VR25:
This seems to be related to Magisk 14.5. Quite a lot has changed since 14.3.

The next fbind build will address that. It'll be up sometime this week.

[MENTION=8735497]DR64XDA[/MENTION], not bothering me at all! :D

In fact, you pointed out something I missed.

Take the answer to the previous post as a continuation to this.
[Magisk] drzoom10:
Hi, working great so far, but it is kinda annoying not knowing the "real" free space in the internalsd. Is there a way to guess it?. Thanks
[Magisk] fnf:
This module seems to fail during early initialisation on Oreo (at least on my Xperia XZ). As soon as it is installed the phone is stuck on the boot screen (before the boot animation so I have no way of debugging it). [MENTION=5228676]VR25[/MENTION] Could you please let me know if you're aware of this?.
[Magisk] VR25:
# 2017.12.3 (201712030)

- Better & wider compatibility -- from Magisk 12 all the way to 14.5, possibly previous and future versions too

- Fixed wrong "luks" config switch

- Improved "hot fsck" switch mechanism

- General optimizations

The only two ways I'm currently aware of are:

1. reboot into recovery & run "df -h /data" on terminal

2. temporarily unmount all folders with "fbind -u"

Try the latest (2017.12.3) build.

If the issue persists, please specify which Magisk version you're using -- and the contents of your /data/media/fbind/config.txt file (if any).
[Magisk] fnf:
Thanks for the update. It still fails to boot for me. Removing the module allows it to boot again.

I will see at what stage did it get stuck. My config file is pretty standard:

F8331:/ # cat /data/media/fbind/config.txt
#intsd_path /storage/emulated/0
#extsd_path /storage/2C3C-C3E9

#target Download
target DJI

It stopped working as soon as I upgraded to Oreo. Before upgrading I used Magisk 14.0, now I'm using 14.5 as 14.0 would make it stuck on boot (as far as I remember, I tried quite a few things to get it to work with Oreo as the problem was compounded by the presence fbind).

---------- Post added at 06:44 PM ---------- Previous post was at 06:31 PM ----------

I added a lot of debugging messages to core.sh. Each would append a string to /magisk/fbind.log. I rebooted the phone, let it hang for 30 seconds, rebooted to TWRP to check the log file.

The log file isn't there unfortunately, so either magisk has failed to execute the module at all i.e., failed during an earlier step or writing to the log didn't take effect due to the forced reboot.

Any help would be much appreciated.
[Magisk] DR64XDA:
Hi VR25,

Just updated to your latest sysconfig-patcher and fbind, and saw the new paths let the modules work fine now.

I only add to fix these two (non-consecutive) left-overs in fbind script

rm -f magisk/fbind/auto_mount

touch magisk/fbind/disable

to

rm -f $ModPath/auto_mount

touch $ModPath/disable

by using this command

sed -i "s/ magisk\/fbind/\ $ModPath\//g" /magisk/fbind/system/xbin/fbind

Now -x and -f options work no matter the directory I am in.

Thanks for your work.
[Magisk] VR25:
[MENTION=613502]fnf[/MENTION], run "touch /data/_x" as root on terminal prior to installing and see if that helps. This excludes "xbin/fbind" from installation. It used to trigger bootloops before on some systems.

[MENTION=8735497]DR64XDA[/MENTION], fixed -- thanks!
[Magisk] khnoizer:
Is terminal syntaxes supposed to work after reboot? I thought of unbinding my folders without rebooting by typing "fbind -u", but it doesn't unbinding.
[Magisk] fnf:
That was it, thanks!. The lack of fbind is not a problem for me as I'll need to change the config and reboot for new mounts to take effects anyway.

If this is a common problem I think it'd be useful to put it in the doc somewhere :) .
[Magisk] VR25:
This may be related to "mount namespace". Play with it in Magisk Manager settings and see if that helps. You might need to reboot after each change.

Actually, you can use "fbind -b" to mount new folders without rebooting.

It's there already -- last line of the debugging section. ;)

Anyway, back to the issue...

I'll soon release a test version with fbind included for you to see if the bootloop goes away.

[MENTION=5263982]aseferfan[/MENTION], did you run as root? If so, wait for the test build.

Edit: there's the build. Run "touch /data/_b" as root before installing.
[Magisk] fnf:
Thanks for the update, I have not tested installing without "touch /data/_b" but installing the module with "touch /data/_b" helped make the issue go away :) .

It is indeed already in the README, I wasn't aware that is a known issue :) thanks. A bit strange that whatever problem that caused the bootloop seem to come back in Oreo/Magisk 14.5.
[Magisk] windflower:
Hi, I am a newb here. I would like to know which command line terminal and text editor you are using in carry out magic folder binder? Please give me some suggestions. Thanks
[Magisk] Erario:
First i want to say thanks to [MENTION=5228676]VR25[/MENTION] for this awesome module!

I've a strange issue with WhatsApp, when i try to record a video in a chat the app at the moment I press REC, and before I press it I see the image of the camera, the app tells me that the camera doesn't work with "please restart the phone".

If I try to restore the WhatsApp backup (4.7 Gb) sometime the procedure stops and is restarted by changing the size of the restore, sometimes I found "downloaded 5.1Gb of 10 GB", and shortly after the external MicroSD disappears from the system.

I've another folder in the config.txt, "Download", and when I download something with Chrome all work fine, i can see the file inside "Download" on external SD.

If I copy files with the file manager in the WhatsApp folder everything works regularly.

PS: with Xposed and XInternalSD everything works regularly, using the same two folders, also the backup restore procedure it doesn't have any kind of problem.

Too bad, I wanted to stay in systemless mode... :(

Does anyone else have the same problem with this module? Caching issue or other?
[Magisk] khangcobra:
Can i use this to save photo to sdcard which is taken by GG camera ?
[Magisk] chandr1000:
"part" config syntax didn't work with "<filename>.img"

I typed "fbind" with su on terminal & it blank.

Then, I mounted the "<filename>.img" using

mount -t ext4 [sd-card path]/<filename>.img [output path]

then typed "fbind" again on terminal. It said: "/system/xbin/fbind[16]: toolkit: not found"
[Magisk] s.otto:
Thank you so much for a great module!!! :good:

---------- Post added at 12:52 PM ---------- Previous post was at 12:35 PM ----------

Yes, you can. But when you want to transfer to your PC, you need to transfer it via FTP only. Transfer via USB may not see the folder.
[Magisk] HellStorm666:
I can't get it to work.

What I did/tried.

in config.txt

extsd_path /storage/7C8B-47D8
intsd_path /storage/emulated/0
intobb_path /storage/emulated/obb
/storage/emulated/0/DCIM/Camera ./storage/7C8B-47D8/DCIM/Camera

reboot, run fbind -mb as root (this gives an ok)

Take a picture...

And picture is still ate internal storage (/storage/emulated/0/DCIM/Camera)

Tried different config

extsd_path /storage/7C8B-47D8
intsd_path /storage/emulated/0
intobb_path /storage/emulated/obb
DCIM .DCIM

Same result.

What did I do wrong?

Log says all is ok.

info:

Xiaomi Redmi Note 3 Pro (kate)

Nitrogen OS with android 8.1

Magisk v14.5 root

EDIT:

Found the solution.

reboot, reboot and reboot ;)

working config

[/code]

extsd_path /storage/7C8B-47D8

intsd_path /storage/emulated/0

intobb_path /storage/emulated/obb

from_to DCIM/Camera DCIM/Camera

[/code]
[Magisk] aseferfan:
same result 'sh:fbind not found' in terminal emulator, i did run touch /data/_b as root, rebooted to recovery, installed folder binder and rebooted and run 'fbind -mb' and it says sh:fbind not found

BTW, i am suing a custom rom which has systemless devbase, which means any modification needed for /system needs to be done in /data/devbase/system, I don't know much about magisk but it doesn't really touch system partition so it shouldn't conflict right? a bit more infor of the systemless devbase here
[Magisk] VR25:
That's a "mount -o bind" classic issue. If you search through the thread, you'll find that it is a permission-related issue. Xposed Marshmallow SD fix module solves the problem by granting full storage permissions to target apps. However, as the name suggests, it works on Marshmallow only. You could try "SD write access enabler Magisk module". While some claim it works, I'm not sure. fbind had that module's feature a while back but it did nothing for the issue in question. Last thing you could try is adding "perms" to your config, rebooting and waiting a few minutes. Check the README for details.

Termux (my favorite) or any of these two -- Material Terminal or Terminal Emulator for Android

Same as plerohero's issue above.

fbind was never intended to mount loopback devices. This gave me the idea to add the feature. Wait for next build.

Permissions issue again ;)

I'm seeing this a bit too often now and it's starting to trigger some OCD behavior... does it mean I'll die if I don't find a fix? :D

If you have other modules that need terminal and those work fine, then systemless devbase may not be conflicting with Magisk. I'll dive deeper into that. A new build will be pushed in a few days.
[Magisk] chandr1000:
Okay :good: