yashsingh1/xdaforums huggingface dataset:
[Magisk] VR25:
[MENTION=4237286]白い熊[/MENTION], I thought so. You must be losing some muscle due to your current-almost-XDA-free life (whatever that means). ;)

Anyway...

Regarding permission issues, I have 2 new ideas to test:

1. Save the patched platform.xml to /data/adb/magisk_simple/system/etc/permissions. [Some] files in etc should be mounted much earlier. I came to this conclusion after months of fight to solve Google Play Services continuous crashes (MagicGApps module). In addition to the patched file, SELinux must be in permissive mode at all times.

2. Format sdcard with an Android-compatible Linux file system. Create an EXT4 image on it with size equal to almost the entire size of the card. chown 0:sdcard_rw * and chmod 661 * on it.

In this context, in particular, a Linux file system offers two main benefits: 1. the image file doesn't actually take the storage space it was created with, until that space is actually occupied. 2. Creating a large image file doesn't take any time at all (because, benefit #1). The only potential drawback I'm thinking of is data integrity preservation. You see, it's a single large file holding all data after all. Nonetheless, that's well worth a try.
[Magisk] orientalsniper:
Issue with mounting SD

Hello, thanks for this app, I'm having a small issue by declaring "extsd" path in config.txt, I'm using "ExSDCard Access Enabler" and it creates a new mount in /mnt/media_rw/{sd card numbers}.

If I put /mnt/media_rw/{sd card numbers} in config.txt, fbind mounts it before ExSDCard Access Enabler and the SD card doesn't get mounted.

Is there a way to delay the mount or at least run fbind startup script after EXSDCard?

Edit: Really need to know how to delay fbind startup.
[Magisk] VR25:
[MENTION=3673451]orientalsniper[/MENTION], if ExSDCard Access Enabler is another module, fbind already does what that module does.

P.S., add setenforce 0 to your config.
[Magisk] 白い熊:
So Oreo is not problematic — I've got an ext4 luks formatted SD — it mounts no problem.

Most apps read the mounts, some don't but most do.

The key is global mount space in Magisk — you mention that in the instructions, but also a permissive selinux kernel. Without it no go.

Interestingly, an exfat luks formatted SD wouldn't work, no app could read the mounts — interesting! :@)
[Magisk] VR25:
Indeed... interesting! ?

Perhaps due to the incomplete exFAT support? Or because it doesn't support most *nix file system attributes (namely permissions)...

Back to the ext4 scenario... why would some apps not have rw access permissions to the storage device? Are these legacy apps? Still, that wouldn't make any sense...

Anyway, I've been thinking on packing native exfat and ntfs-3g drivers into a module. Allegedly, these come with full-featured fsck's, which are not generally found on Android (i.e., the stock exfat fsck only "checks" for errors;

can't fix any). Source code and precompiled binaries are on GitHub (I have the repo link somewhere). This may be worth trying, as permission issues are probably caused mainly by ESDFS, FUSE, SDCARDFS and alike.

EDIT: here's the link: https://github.com/Lurker00/Android-fs
[Magisk] 白い熊:
Maybe more associated with the fact that it won't mount it with type "exfat" only with type "auto".

Then the directory where it is mounted is accessible to let's say a file manager, but all the bindmounts are empty. Shouldn't be a permission thing, since you can bindmount directories from just an exfat SD in fbind no problem...

For instance termux cannot access them, only as su, interestingly it also cannot access /sdcard/ - so it's something with app permissions. OTOH Android terminal (jackpal) reads it no problem.

Also the stock Samsung gallery crashes on reading a bindmounted directory...

Might be worth it...
[Magisk] VR25:
[MENTION=4237286]白い熊[/MENTION], try adding the following to ./core/post-fs-data.d/fbind.sh or service.sh (not sure which one would be the best option):

supolicy --live "allow sdcardd unlabeled dir { append create execute write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon rmdir audit_access remove_name add_name reparent execmod search open }"
supolicy --live "allow sdcardd unlabeled file { append create write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon audit_access open }"
supolicy --live "allow unlabeled unlabeled filesystem associate"
supolicy --live "allow sdcardd unlabeled filesystem { getattr mount remount unmount }"
supolicy --live "allow vold unlabeled filesystem { getattr mount remount unmount }"
supolicy --live "allow init unlabeled filesystem { getattr mount remount unmount }"

P.S., test also with "sdcard" instead of "sdcardd" (or both at once, on separate lines).
[Magisk] 白い熊:
What is this targeted at — the all apps can't access issue, or the exfat under LUKS not readable on mount issue?
[Magisk] VR25:
It's for the first, but possibly both.
[Magisk] MrMmmkay:
Originally Posted by bttcp12 View Post

In the lasts versions fbind it's not working at boot.

But if I run fbind -b manually it works flawlessly.

What log do I need to post?

I have the same problem, after reboot I have to run fbind-b manually, see the logs folder attached.
[Magisk] 白い熊:
[MENTION=5228676]VR25[/MENTION] there is some 2018.8.15 version in the Magisk repo that's messed up - it messes up /system/xbin mounting etc. nothing works.

I've spent literally the past 5 hours - ugh... - messing with the phone, thinking something was terribly wrong - busybox stopped working etc. until I realized what's up...

You might wanna fix that or else someone else is gonna be caught with this version.
[Magisk] ms.journie:
Question - This is probably a dumb but I'm a bit confused. Probably making this harder than it is.

What is the difference between this Mod and using your sd card as a internal storage for extra storage where as I am able to move over some apps to it.

I hope you understand my question. :)

Thanks!
[Magisk] 白い熊:
I've determined upon further testing that this is unnecessary - the gallery failing and terminal not having user-level access is a problem not associated with the mounts. Termux for some reason doesn't even have access to /sdcard so no wonder it doesn't have access to the mounts.

Like this all's good, it seems all apps can read the mounts in Oreo.
[Magisk] TheRuan:
Using it as internal has a ton of limitations, u can't move WhatsApp folder from the internal memory to the sdcard for instance, using this you can.
[Magisk] ms.journie:
Another question :D

Will this also free up some of my ram use? My phone is old and I'm not ready to get a new one just yet.

Here's a screen shot of the ram and this is just recently re doing my phone without all of my apps.

I have a Moto X Pure XT1575
[Magisk] TheRuan:
Nope, this won't change anything regarding ram usage.

To achieve that you have to mess with disabling apps boot up and background processing in settings > privacy > privacy guard > "menu at the top right" > advanced, or even removing some apps that you don't really need.

Btw, does anyone know how can I mount the second partition on my SD Card or mount a folder pointing there, i tried mounting the entire partition under sdext2 to use with Link2SD, at first it works fine, but during boot up I believe it has to force unmount the partition which ends in errors from time to time, and quite often an app needs to be uninstalled, removed manually all bugged files and reinstalled, that's annoying as hell.

At first i tried part /dev/block/mmcblk1p2 /data/sdext2 ext4 "fsck -a"

This results in a successful mouting + a system error msg asking to repair/format the partition, which i just ignored and it was fine at first as i said before.

Ended up going back to 2 partitions (not adopted).

I found out i was using wrong fsck format for my system, this time it might work better.

in my case it has to be "e2fsck -p", so i end with:

part /dev/block/mmcblk1p2 /data/sdext2 ext4 "e2fsck -p"

Let's hope no more apps are going to get corrupt, using this along with Link2SD is really great, if it stops getting corrupt.
[Magisk] 4tress:
Doubling it. But to be honest, I've just moved from Lineage to MiracleDROID ROM, and I had no such a problem on Lineage. But on mDroid it's just like you described, xbin is messed up and nothing works.
[Magisk] seijuro572:
does it work on android pie?
[Magisk] VR25:
[MENTION=4237286]白い熊[/MENTION], [MENTION=403684]MrMmmkay[/MENTION], which Magisk version is each of you using? I'm on 16.6, fbind 2018.8.15, no such issues. It has been reported that Magisk versions 16.7 to 17.1 misbehave badly with several modules. Hence, I've been sitting on 16.6 for quite a while. BTW, do your systems actually have the xbin dir under system or just bin?

白い熊, the lack of full exFAT support is to blame for the messed up external storage permissions. The platform.xml patching method I use (which works with permissive SELinux) fails with exFAT, but gets the job done with vFAT (tested) and possibly Linux file systems too (can't remember). I'm on Nougat, BTW.

Now, on how to enable Termux access to storage without root:

1. Grant storage permissions -- settings > apps > termux > permissions.

2. Run termux-setup-storage and you're done.

If you want to use the Termux environment as root, install tsu (pkg install tsu) and use it instead of su.

[MENTION=3911642]TheRuan[/MENTION], the system error pops up because fbind "hijacks" mmcblk1p2 from the system. It mounts very early. Way before system gets a chance to even check whether that partition exists. This does not cause corruption, BTW. Since the partition is already mounted, by the time system wants to mount it, mount throws an error. Hence the misleading "corrupt sdcard" message. You can't mount what's already mounted. I haven't tested any way of hiding that message automatically. I suppose it could be done with Tasker.

[MENTION=9322519]seijuro572[/MENTION], it should work.
[Magisk] MrMmmkay:
Thanks for your reply. I am on magisk 17.1, there is only a system/bin directory, no system/xbin .
[Magisk] VR25:
You're welcome. Lets wait a bit for the second response.

Meanwhile...

Have you tested with Magisk 16.6?

Which Android version are you using?
[Magisk] MrMmmkay:
I use a Xperia XZ1 Compact (running on latest firmware, its Android 8.0), rooting etc. is a little bit tricky on that device, so I try to don´t mess up with magisk, if possible I don´t want to downgrade it... :angel: .
[Magisk] 白い熊:
I'm on 17.1, can't go back to a lower version, as it misbehaves on Note 9.

There is /system/xbin — I'm on fbind 2018.08.10-1 and it works fine. The 2018.08.15 messes up the /system/xbin directory completely so that other modules are affected too - the ones that bindmount stuff there, for instance busybox.

Yeah thanks — I figured this out in the meantime as well :@)

Haven't used tsu — I'll check it out. What's the benefit as opposed to su?
[Magisk] seijuro572:
does it automatically re-enables bindings after a reboot? or is it permanent?
[Magisk] Paleskin:
So i have to type all the folders in my internal storage to bind to external in the cfg file ?
[Magisk] Canceriankc:
Did you give it a try? Is it working?
[Magisk] seijuro572:
Nope. Im scared of messing up my device
[Magisk] Canceriankc:
Okay thanks. I have 16gb storage only unfortunately so I store most of my games on the sdcard. I don't wanna move to pie in case I won't be able to store my apps on SD. Currently using xinternalsd tho.
[Magisk] seijuro572:
We have the same situation bro, as of now all we can do is to wait for xposed to become compatible with android pie since i'm also using xposed for xinternalsd, that's why i'm stuck at oreo too at the moment.
[Magisk] TrippyEngine:
It doesn't work on Pie with Magisk 17.1. The whole phone freezes at the phone's main screen and reboots, kinda like a bootloop. It did work with version 16.7, though, so you CAN technically use the module with Pie :P
[Magisk] VR25:
It lets you run Termux binaries/scripts as root.

Bind-mounts are never permanent. fbind re-binds folders automatically on boot.

That's right. Refer to tutorial.txt if you get stuck.

---

Android Pie support is uncertain. I only tested fbind on M, N and O. P is not yet available for my device.

The next version will support Magisk 17.1.
[Magisk] seijuro572:
sad. in my device android is already available but my device only has 16gb internal storage so i need some neat tricks like this. Currently I'm stuck at oreo becuase xinternalsd and xposed only supports up to oreo.
[Magisk] exelix:
Is it only me or this module breaks systemless xposed ? when the phone boots xposed is not active and the only way to enable it is to soft reboot from xposed installer. This happens only if this module is enabled
[Magisk] handers1234:
Can I fsck my exfat formatted external sd card?If can how?

Oh and is this module force enable FUSE?
[Magisk] VR25:
I use systemless Xposed along with fbind and I've never came across such an issue. Are you using latest versions of both? Which Android version/ROM are you on?

Yes, FUSE is forcibly enabled. Otherwise, bind mounts don't work correctly.

You can fsck exFAT on Android/Linux, but generally, that's relatively useless. This filesystem is not open source. You can add the line <fsck.exfat /dev/block/mmcblk1p1> to your config. However, all it will do is [poorly] check for errors on the volume.
[Magisk] exelix:
Latest resurrection remix on Xiaomi Mi A1, right now i'm switching to stock for a test, i'll try there as well
[Magisk] handers1234:
One more sir,in MiXplorer you can see "mount point"(/storage/xxxx-xxxx)and "device"(/mnt/media_rw/xxxx-xxxx(this path change when use FUSE/use your module))path so what extsd_path will be?

Oh and aside from your module isn't sdcardfs better than FUSE?
[Magisk] VR25:
The paths don't change.

SdcardFS promises to reduce overhead. I've not really tested how true this is.

Apart from that, it brings other "enhancements" which mess with bind mounts.

By using FUSE, we have more flexibility, and TBH, more actually usable features.
[Magisk] Jack001m:
When I use FUSE,I feel the read/write speed on my sdcard is much slower than sdcardFS.

Is it an illusion or a truth?Is there any workaround to use sdcardFS with the module?
[Magisk] VR25:
No, that's not an illusion, unfortunately. Currently, there's no workaround.
[Magisk] luboz:
I have very simmilar problem. When I install fbind, systemless xposed is then inactive. But same is after sw restart. I have to deactivate or uninstall fbind to make xposed active. I didn't find anything interseting in magisk or xposed logs...

Also fbind command is unavailable: (sh: fbind: not found)

What can I try/check?

Xiaomi Redmi 4X

Recovery: OrangeFox R8.0 (because current TWRP doesn't support treble - unable to install magisk)

LineageOS 15.1 lineage-15.1-20181009-nightly-santoni

Magisk 17.1 (but probably same with 17.2)

fbind 2018.8.15 (installed from magisk manager repository)

xposed framework SDK 27 90.2-beta3 (Systemless)
[Magisk] VR25:
Working on updates...
[Magisk] jungaxxx:
I have installed the latest fbind. But when i run fbind command as root on termux. It said no command "fbind" found. Can anyone help me, pls?
[Magisk] VR25:
To all users, especially those on Oreo or Pie,

I'll be pushing beta builds soon for you to test.

Why would you want to test?

- Each build will be good enough as a daily driver.

- These may work with sdcardFS!

- Optimizations

- Simplicity

- Bug fixes

- Additional features

Set the command line aside for now and edit </data/media/fbind/config.txt> manually, following instructions/tips from </data/media/fbind/info/tutorial.txt>. Reboot to apply changes.
[Magisk] neromanello:
All well but not auto-mount after boot

Hi, I have all well. It's all ok. When I config all and then su fbind -mb all goes well.

But when I restart I have to remount manually.

After typing su fbind -e it says service.disabled not found...

Any ideas? I don't want to re mount every boot my fbind -mb manually...

Thanks!

Just to clarify:

Samsung Galaxy S7 (SM-930F), I have Magisk 17.1 with encryption, Magisk Manager 6.1 (The last one, I've tested it also on the previous one).

First, Downloading the module from Magisk repository: 2018.8.15 which in this thread were telling this is wrong. So I have uninstalled it & installed the last one 2018.8.10-1 but I have the same problem regarding auto-mount at next boot. Only one another thing was: I was trying to MOVE some file from the internal storage binded folder to one SD folder, and I get a message saying: "File already in this place" (or something like that). I tried to replicate the error in this 2018.8.10-1 version but this didn't happen.

All I did when I have had my Magisk module installed was, to take Termux, get into it, type "su", and then "FBIND -mb". and all is going well. then when I reboot I don't have the auto-binder feature enabler, so I need to manually re execute the "FBIND -mb" command. Maybe there's some utility like Script Manager that I can install to execute "FBIND -mb" at startup, but I prefer to solve the FBIN startup issue...

Please check the screenshots out, I've invested a time to take them...

Even I included two logs files...

Screenshots & Logs

Thanks!!!!
[Magisk] VR25:
[MENTION=5440263]neromanello[/MENTION], thanks for the information.

The Magisk log provided suggests that Magisk is not executing the module's <service.sh> script. Without that, folders aren't bound automatically.

Could you check whether </sbin/.core/img/fbind/service.sh> actually exists? Thanks.
[Magisk] neromanello:
Hi, thanks!.

That file is there.

I remembered something from one post saying about the "sed" command regarding this file, something with chmod 777. Maybe I have to check the details about this file with Windows commander. I will take this info. to you in a couple of hours. :good:
[Magisk] neromanello:
Here's the screenshot.
[Magisk] VR25:
Interesting...

Don't you have <main.log> and <service.sh.log> under </data/media/fbind/logs/>?
[Magisk] neromanello:
Here the screenshot.

And Here the Magisk Screenshoot.

Do you have any suggestion?. Maybe trying to re-install?.
[Magisk] Captain_Throwback:
I'm thinking what's described here might be relevant to the issue we're seeing?

https://github.com/AdrianDC/multirom_core/commit/81295cd6971317d955cb0c78b41d147b891a601b

The info in the commit message seems to describe the issue we're seeing, and the "Cross-device link" error seems to suggest that sdcardfs is in fact the problem. On my device where it's working, fuse is being used.
[Magisk] VR25:
Strange... it works for me! :confused:
[Magisk] VR25:
So, on some devices, the module works fine with FUSE (my case); others may need sdcardfs... hmm

Edit: when I enable sdcardfs on my device, my bound folders turn into blank files! This suggests that sdcardfs may actually be either an issue or a solution, depending on the device. Things just got funnier...
[Magisk] VR25:
***Quick Announcement***

* Please, post your full device info below (brand, model, ROM, kernel, sdcardfs status - if known) and whether the module works on it to help build the "Known Issues" section, thanks.
[Magisk] Captain_Throwback:
Odd, my 10 isn't getting stuck at boot with the 6/20 version. It's just behaving exactly the same as the previous version for me.

Looks like we've zeroed in on sdcardfs likely being the culprit here - I'll have to see if I can disable it on my 10 without breaking anything else.
[Magisk] p50kombi:
Re Downloaded and now it doesn't get stuck... Looks like a corrupt download ;)

Sorry for the false report. Will have a play and test later tonight.
[Magisk] Captain_Throwback:
I disabled sdcardfs on my HTC 10, and now the bind mounts work :thumbsup:. So that's definitely the culprit :).

I created a post-fs-data.sh and added it to the fbind module folder with these contents (since these are the props that are setting sdcardfs on my device):

resetprop --delete ro.sys.sdcardfs
resetprop --delete persist.sys.sdcardfs

and that seems to have worked. I'm not sure what side effects disabling sdcardfs will have, but I'll see if I notice anything.
[Magisk] VR25:
Awesome! I'll have to do some more testing as well and implement that if things remain smooth.

But... but, why is sdcardfs already being used by default on some devices? Isn't it "supposedly" in beta, still?
[Magisk] Captain_Throwback:
No idea on that, lol.

Found a less destructive method to disable sdcardfs, after looking into the code a bit. Removed the post-fs-data.sh I added, and replaced with a system.prop with these contents:

# Disable sdcardfs feature for current user persist.sys.sdcardfs=force_off

Sdcardfs is easily toggleable, and setting just that prop seems to do the job (it's set to force_on by default on my device).

I assume Samsung devices are all using it since it's their code, so that makes sense, at least.
[Magisk] VR25:
Those who deal with the "binding issue," please run the following as root and report the result:

getprop | grep sdcardfs

That will help me determine whether different devices use different prop values/set different props to enable sdcardfs (hopefully the answer is no).

Edit: [MENTION=1162986]Captain_Throwback[/MENTION], this ship is going even further now! I guess now we're pirates who just found some treasures to put our hands on. :D
[Magisk] Captain_Throwback:
They *should* all use the same props. The code I looked at was from AOSP and those values worked fine on my device and the props are the same. But I guess we'll find out once you get some feedback.

While I doubt those props are getting set anywhere other than build.prop, you may want to get the output of "getprop | grep sdcardfs" rather than just build.prop to be sure. Just a suggestion. Also, the command I suggested doesn't require root (though obviously if you're using Magisk, you have root).
[Magisk] VR25:
Yeah, that's a much better approach. I just edited my post. Lets wait for some feedback. Meanwhile, I'll re-enable sdcardfs on my device and test that as well.
[Magisk] p50kombi:
This is the output on my device.

Bind isn't working.
[Magisk] VR25:
v2017.6.21 is up. Try it.
[Magisk] Captain_Throwback:
Seems to be working for me, though now on my device that doesn't use sdcardfs, I have an sdcardfs prop :eek:. You could use a post-fs-data.sh and add some checking for the existence of the prop so that it doesn't get set on devices that don't need it.
[Magisk] p50kombi:
Same here, working a treat ..

Yeassaa.. Finally mounting time again
[Magisk] VR25:
Yup, I'll do that. This was just a quick test. Besides, it wouldn't hurt any device. But... yeah, I have it on my device too and that foreign prop triggers some OCD behavior, so... I'm kinda excited to kill it! :laugh:
[Magisk] p50kombi:
Same here, working a treat ..

Yeassaa.. Finally mounting time again

:svetius:

Haha, my device even mounted this message twice;)
[Magisk] VR25:
[MENTION=1162986]Captain_Throwback[/MENTION], here's the "OCD safe" version. I can already feel better...

Anyway, the post-fs-data script will self-destruct on its first run, since the prop to disable sdcardfs persists across reboots. I would like it not to persist though, but... meh!

# Cleanup the mess
if getprop | grep sdcardfs; then
resetprop --delete persist.sys.sdcardfs
fi

# Disable sdcardfs
if getprop | grep sdcardfs; then
resetprop persist.sys.sdcardfs force_off
fi

# Commit suicide
rm -f /magisk/fbind/post-fs-data.sh
[Magisk] Captain_Throwback:
You only have to set the prop if the persist prop exists and is set to force_on. Otherwise, the prop doesn't need to be set at all. Setting it with system.prop in the module doesn't persist across reboots - I just tested and confirmed that.
[Magisk] Zer0x00:
Hello

I have a Galaxy S7 Edge with Android 8.0 (Stock ROM with Magisk 17.3).

I have the same problem like luboz (fbind not found).

I did just now a clean install (before I was on Android 8.0 with Magisk 16.4; fbind worked fine).

Under </data/media/fbind/logs/> there are 6 log files with 0 Bytes in size..

This also does not work :(
[Magisk] neromanello:
Hi, Try to execute in a terminal: "su"

And after that try to use FBIND in that terminal normally.

Give us feedback about this...