yashsingh1/xdaforums huggingface dataset:
[Magisk] Termi93:
Hey TechnoSparks,

thx for your answer again, i'll give it a try with your advice to use the alias' for the path.

I'll report the result here in a few minutes.

What a unappreciated behaviour from android regarding the file system, makes a good basis for some confusion.

---------- Post added at 09:57 PM ---------- Previous post was at 09:40 PM ----------

Okey, i reinstalled ts-binds with Magisk & restarted.

I wrote into the folderlist:

folderbind whatsapp "$sd/Foldermount/WhatsApp" $int/WhatsApp

Terminal:

su -mm

tsbinds reinit

Then i rebooted the phone.

Now i am having empty folders again in the internal storage.

I am less annoyed but just exhausted from the back and forth the whole time, please dont get me wrong, i appreciate you giving your best to handle my issues.
[Magisk] TechnoSparks:
Okay everything looks very well now. However there seems to be an incompatibility issue. I am currently busy and couldn't finish the debugging methods for the script (slated for the next stable release), so I will need to get some files from you manually to precisely check what is going on and if there is anything I could do to squash the issue. Be noted that if the issue is out of my control, i.e. ROM forcefully enforcing sdcardfs/esdfs, unknown anomaly like Luciano's - I will not be able to assist you further. If that is the case, i would like to say sorry beforehand.

Can I know

ROM name and Android version

Build date

Device name and model

Magisk version

Please restart your phone with tsbinds enabled, and package me these files and attach it here:

[INTERNAL]/ts-binds.log

[INTERNAL]/ts-binds-folderlist

/proc/mounts

Then disable tsbinds via Magisk Manager, restart the phone again and pull the file "/proc/mounts" again. Rename it to "mounts-disabled" so I could differentiate between the two different "mounts" file.

Run this line in your terminal emulator and give me the output:

getprop | grep -E "sdcardfs|esdfs"

There may be more tests if you wish to participate in experimental hunt to make your ROM compatible. However, you may need to wait for me - for currently unknown length of time, as I need to code the script to automate most part of the experiment(s).

Thank you and sorry for the problems caused
[Magisk] Termi93:
No problem man, you are just trying your best so am I.

I just wanted you to know that i wont do this today because i was busy and will be for the rest of the day.

My device is a Galaxy S5 SM-G900F klte

Running latest ResurrectionRemix6 RR-O-v6.0.0-20180512-klte-Official.zip

Build Date 12th May 2018

Magisk v16 and MagiskManager 5.7.0

You might expect my reply on your request in approximately 15hours or so.
[Magisk] Termi93:
Everything done now.

I attached the files and packed mounts & mounts-disabled into a rar because they are invalid file types for attachments

And the output of the terminal

getprop | grep -E "sdcardfs|esdfs"

[persist.esdfs_sdcard]: [false]

[persist.sys.sdcardfs]: [force_off]​
[Magisk] Termi93:
I just figured out that App2SD's foldermount option works for me... so i might stick with that one. If you need further info's regarding your magisk module ts-binds dont hesitate to ask, i'll try it out even i have an working alternative now.

Regard it as a thank you for the answers and guessing you already put into my case :)
[Magisk] manos78:
Hi,

I share some personal experience with this module:

- In my rooted Moto G5+ I'm using it without troubles.

- In my new Moto G6+ (rooted with Magisk Beta), when I install this module... the SDCARD will be lost... forever! Even if you disable/uninstall the module, the sdcard access doesn't work. The only solution is format the device and reconfigure all.

Please, be advised! If your device is Oreo, or it uses sdcardfs, then DON'T INSTALL IT!

Regards.
[Magisk] TechnoSparks:
After preliminary inspection it seems nothing is wrong. I am starting to wonder if this is about the vold problem I mentioned a few posts back. I have an assumption that this could be very well related to the fact that the folders are binded but yet again the ROM do not sync up with the kernel. I am thinking of maybe providing a way to make the module work by `post-fs-data` rather than a late start service (magisk module run-mode), and see if it could fix this. Admittedly this is an ugly fix of an issue, especially how it is blocking to the boot process. Obviously, this would be optional, but also at the same time it doesnt hurt to be honest to use post-fs-data.

Something else at the back of my brain is wondering why this is happening. My implementation is exactly similar to FolderMount (minus the sdcard patch thing) yet it is not working to some. The module is really straightforward, there are no bells and whistles. I think I need to use App2SD to learn their magic and maybe implement some in this module. What I am particularly interested is if the app could tell the ROM that a folder pair has been unmounted. That, would be a jackpot.

OK, rant aside, I am glad you found an alternative. I am not offended in any way. This module is just a piece of work that I would like to share, and I dont really want recognition of it. Since you are ready to help, I will hand a pretty simple script file to soak test the binded directories. As of now, I am having a bad fever, so progress have been slow. Expect the script file later

Hello, thank you for sharing your experiences. Unfortunately this situation is too weird that I am doubting the authenticity. Disabling or uninstalling the module should resume normal usage for your device because the mounting logic only occurs on boot. Even so the module do not even touch the mounted mountpoints /data/media/0 and /mnt/<SD-serial>. I don't think you are lying though, maybe there are some other magical events that may have caused this. Tech is a strange thing.

To add on sdcardfs, the module disables it using the build.prop command. If the ROM is not hardcoded to use sdcardfs, tsbinds should work. Actually, even if you have sdcardfs turned on, the device could still boot and you could still use it. Just that binded folder pairs would turn into an inaccessible "file" in file manager (possibly because the ROM do not expect a cross device link). I know this because I tried with sdcardfs turned on.

Anyway before I put up the warning on the first post, I need to know exactly your ROM. Can you tell me what ROM are you using? Thanks!
[Magisk] Termi93:
You must be right in the point that tsbinds works like foldermount because i couldnt get that running too, that was the reason for me trying out magisk modules and in the end to give App2SD a try which luckily worked out.
[Magisk] TechnoSparks:
I have tried App2SD and the unmounting works. Unfortunately there's nothing different with ts-binds' logic. This is because if i inspect /proc/mounts, the same mountpoint is being used, not different at all.

Hence this app has the way to "refresh" the Android storage and therefore reflect any changes made. I need to know how it does this. It seems like a silver bullet for me lul

Triggering media scanner doesn't help, in case you or anyone watching this conversation wondering. So i really think the app have something else. Clever developer i must say.

I will use SuperSU in Androidx86 to see the su logs.
[Magisk] manos78:
Hi [MENTION=5765352]TechnoSparks[/MENTION],

First of all, I'm installed this module in a Moto G5+ witn Adnroid 7.0 without troubles. So, it works and I really like it!

However, when starting to use it in my new Moto G6+ with Android 8.0 I found this problem. Belive me: all works until I install this module. Then the access to the SD card is "stalled". In the System it show as "ejecting..." even when booting. And all Apps that has storage access are in a loop until sometime. And uninstall the module doesn't resolve the problem. It persists! The only solution is remove the SDCARD and reboot. But, after you insert it (even when power off, until several reboots) the problem returns.

I'm sure something is changed in the SD Card access with sdcardfs (that's used in Android 8.0). Please, review it... I really like to use your module with my new Moto G6+.

Thank you!
[Magisk] Brentana:
Hi TechnoSparks,

did again some tests with whatsapp bindings, after a suggestion i've red in another thread (fbind), that is also not working for me..... Before, i was trying to bind whatsapp/media folder only..... now i have connected the entire whatsapp internal directory to external...... bingo!

I just copied the entire internal whatsapp folder to the external sd, deleted anything in the internal directory, but left the directory structure in place, and now it seems ok.

I'll use it for some day and report you if this is a real solution for whatsapp or not, may be we cannot bind sub-folders.... Hope this can help....

regards, Luciano
[Magisk] TechnoSparks:
Very weird. I wish to review it but the fact that the issue persists even after module being disabled or uninstalled is kind of extremely out-of-place or unexpected. I couldn't think of any possible cause at all, although I think the ROM may have been the actual culprit here. I could spend time looking into it, but since I don't have the exact setup like yours, I will need you to help as well. However, given that the problem is causing some storage problems and a hard time for you, I don't think that would be an option.

Out of pure interest, would you reply me the output of "mount" aftrer running this:

su -M -c mount

Again on the sdcardfs, it should not cause the issue like you have told in your posts. The real issue with sdcardfs is, the binded folder turns into a special kind directory, where the terminal would say that it is a cross-device link. This works well in the shell (I can `cd` into it) but not for the ROM: as viewed from a file manager, the target path becomes a single file! :eek:

Hence sdcardfs would never be supported until forerver it seemed. I don't know how long FUSE-based internal storage would persist since a lot of devices still have low internal storage. Maybe it all comes down to the day an Android version deprecating FUSE or Android finally treats SD card the proper way it should be treated for years!

I see, I will try later quickly after some errands. Personally I think, it should always work.

----------

After a sleepless night I think I stumble on something completely random but turns out to be the cause of the problems. Introducing: Mount namespace mode! :silly:

The issue was that, any changes made to the "mount" is only reflected to a new inherited mount from a parent namespace. An example, when you launch Termux terminal, and do an "su", it inherits the global mount namespace. tsbinds do some changes to the inherited namespace, maybe binding a new folderpair. However this only affect the inherited namespace, not the parent namespace (global namespace). Since other apps like WhatsApp is inheriting the global namespace, it did not acknowledge that a folder has been paired, because the global namespace has been no different! So, in order to fix this, there are 4 methods:

User needs to use global namespace settings in Magisk Manager Settings

User needs to invoke `su -M` instead of just `su` before interacting with tsbinds

User needs to set SELinux to permissive before interacting with tsbinds

/system/bin/tsbinds need to call on `su` and pass on the commands instead of explicitly calling the commands

I really wish not to mess with SELinux, so I will not go that route until someone in the future have problems again with ts-binds and I try to use it later. Until then, I wish to use the 4th method since it poses compatibility without the user needing to change anything. Of course this affects the logic ts-binds is using but I can change that to work.

To end this nag, I feel so relieved that I have finally found the cause!!
[Magisk] TechnoSparks:
Version 1.0.9 is now released!

**Additions**

- New `mount` parameter to output the system's mount entries. Command `tsbinds mount` is to execute in shell

- New `pairs` parameter to output the pair names in the `folderlist`. Great to do quick revision. Command `tsbinds pairs` is to execute in shell

**Fixes**

- Fix the mount namespace issue - now binds and unbinds take effect the way it should be!

- All the commands are now passed through `su -M -c` to take effect on the global namespace.

**Modifications**

- Change to use busybox

- Uses hardcoded PATH towards the busybox folder `/sbin/.core/busybox`

- Uses hardcoded path towards module directory `/sbin/.core/img/ts-binds`

- Was `/magisk/ts-binds` but /magisk is a symbolic link towards above path

- I know, hardcoding paths is not recommended by the Magisk documentation, but the module goes forward by Magisk's new version. The reason I had to do this is because there is no other easy alternative to find module's dir other than extreme measures of loopdevice mounting or looping through countless number of directories from root. So instead of taxing the shell during boot, I prefer not to do that instead.
[Magisk] TechnoSparks:
Thank you. It seemed very clear that the problem was with sdcardfs. Seems like your ROM may have sdcardfs enforced strictly. It could also be plausible that it also doesn't play nice with the buildprop entries that disable sdcardfs.

Since your info given in previous post doesn't point to any type of ROM, i am going to assume it is a stock ROM.

Thank you for reporting the issue. Unfortunately i cannot assist in situations where sdcardfs is enforced. Apologies
[Magisk] manos78:
Hi,

Yes, it's pure Stock 8.0 (from Motorola).

I'm glad to help you. I hope in the future you can fix the problem with sdcardfs, as more and more devices will use it. Or almost, solve the problem when uninstalling your module.

Regards.
[Magisk] samrattt:
I want to bind download folder.but it's not working?where is the problem can anyone tell me??
[Magisk] shaiya87:
Hello! Absolutely did not understand what file to edit and where it is. Put the file with an example of the folder Downlod please. And you can find out the differences from the fbind module.
[Magisk] sumit yadav:
Not working on Pie.
[Magisk] TechnoSparks:
I do not have a suitable platform to test out ts-binds on Pie. Consider the module unsupported for Android Pie at the moment until I could test the module on it.

If Android Pie uses sdcardfs solely and deprecated FUSE-based mounting in the code, then I guess that's where ts-binds' EOL is...

Thank you for reporting
[Magisk] seijuro572:
any updates on android pie?
[Magisk] TechnoSparks:
Nothing — I cannot test Android Pie because none of my devices support it.

Although I did dive deeper in the old Magisk discussion and figured the power of "resetprop". If you are willing, could you test version 1.1-bleeding on your Pie and report back your findings?
[Magisk] seijuro572:
Ok thanks i will.
[Magisk] TechnoSparks:
[MENTION=4782114]sumit yadav[/MENTION] I would like to also invite you to test
[Magisk] sumit yadav:
Hi TechnoSparks,

I installed a pie custom rom, but after facing stability issues i reverted back to oreo.

Thanks for asking, i would still like to be a part of testing group. Will install new pie build and test.
[Magisk] TechnoSparks:
Hmm, the only changes I made to the new version is that it now has a post-fs-data mode that reset some important props. The difference between the old and new implementation is that the former simply uses a system.prop file provided by Magisk template. This propfile is not that effective in setting and altering props, thus what led to the resetprop implementation in this "bleeding" version.

Or in simple terms, it is quite of a simple change. If you are not on Pie, for your convenience, you can also not test the new release because I personally think the amount work I have changed in the module is not the same as the amount of work and hassle of changing between ROMs.

But if you insisted and already tested, I am very curious on the outcome. If it failed, I also have one last thing in line for you try.
[Magisk] TechnoSparks:
Calling Pie Users!!!

A passer by and not a ts-binds user?

I would like to humbly request for a file copied from this address: "/proc/mounts" and also the system's build.prop from "/system/build.prop". This is essential for me to know if FUSE is still there in Android Pie. For your ease, I have written a shell one-liner for you to copy and paste into your favourite terminal app. Then upload the files from the internal storage. Your help will be greatly appreciated!

echo "THANKS!"; cd /storage/emulated/0; cp /proc/mounts ./ts-mounts; cp /system/build.prop ./ts-build.prop; chown 1023:1023 ts-mounts ts-build.prop; chmod 0644 ts-mounts ts-build.prop

User of ts-binds?

Maybe you used ts-binds but since you find it incompatible with Android Pie, you decided to disable it. Hmm, that is fine, but I would like to request for your help. In light of the new Magisk 17.2 beta update this may point to a final fix for Android Pie because of the new resetprop. Please update your Magisk version to 17.2 (if you will) and install this bleeding version of ts-binds and report back if ts-binds finally work for you.

-----

Your help is greatly appreciated. Thank you
[Magisk] Kigung:
Hi [MENTION=5765352]TechnoSparks[/MENTION] I'm currently using Redmi 4 Prime and Pie ROM, I'm reporting that bleeding version of tsbinds still doesn't work for my phone

I'm attached my mounts and build.prop

Hope this will help you
[Magisk] TechnoSparks:
Thank you. Based on your mounts, it is verifiable that sdcardfs is being used by the ROM. This is expected, since the props from post-data-fs script was not executed on boot.

May I know if your Magisk version is beta 17.2?
[Magisk] Kigung:
Yes, I'm using Magisk 17.2
[Magisk] TechnoSparks:
This is quite concerning. Can you run this line in a terminal emulator? Make sure to "su" first. Then I would like to see the output:

resetprop persist.fuse_sdcard true; resetprop persist.fuse_sdcard
[Magisk] Kigung:
Here is what I get
[Magisk] TechnoSparks:
This is baffling. Resetprop works. Hmm, now I am not feeling optimistic about compatibility on Pie. I have one last test for you, if you are fine with it. I have updated the bleeding version on Google Drive. Could you install it and see if it works now?

I would like to also express my sincere gratitude for volunteering in testing! :)
[Magisk] Kigung:
So sad to say this, but the updated version still not working :(

I hope you can find solution in future :)
[Magisk] TechnoSparks:
Hm. As a final request, could you run this in your terminal, and then upload the file created in Internal storage? Make sure the latest bleeding is installed and active

getptop > /storage/emulated/0/ts-prop.txt

I want to be optimistic, but unfortunately, if Android Pie really does remove any traces of FUSE-based mounting for SD Cards in it, then no one could do anything because it is just isn't there in the code. Worry not though, I will try to find any possible solution when Pie finally arrive on my device. :) As for now, the future remain uncertain. :(
[Magisk] Kigung:
I think u misstyped from getprop to getptop

Heres the file from getprop

And I got weird behavior from my phone sometimes after enabling the module, the android.process.media is constantly crashing for few second
[Magisk] TechnoSparks:
Yep, I did made a typo and didn't even notice it. ? I'm sorry. In addition to such a typo, I also made another mistake. I forgot to ask for the /proc/mounts file to check if any of the prop values are respected by the ROM. I suppose they don't respect them because the core features didn't work, so no biggie.

On the crashing issue, well, it could just again be with the prop entries. For more info: I basically use all of the prop entries I have found wild on the internet and forcefully set them all. This could introduce inconsistencies on different ROMs. Bad implementation? True, no argument with that. Any beautiful solution? Nope. ? But is there any solution? Up to the user, as he/she needs to check one by one and remove a bad-inducing prop value.

I will wait for the release of Android P on any of my device. Android x86, Nokia 6, Xperia SP, whichever comes first. Afterwards, I will dig deeper into this mysterious obsolescence of FUSE-based sdcard mounting.

I would also like to thank you very much for helping me debug the issue. ?
[Magisk] wtang:
Thanks a lot [MENTION=5765352]TechnoSparks[/MENTION]! I just installed your ts-binds module and it's working great on my LG V30 H932 running stock Oreo rooted with Magisk v17. My motivation for finding a way to mount bind an internal storage folder to an external SD card folder is I started using Google Camera ported from the Pixel phones instead of the stock camera app. The problem is GCam can only save photos to internal storage (because Pixel phones don't have an SD card slot). With your ts-binds module, GCam is now saving photos to the /DCIM/Camera folder on my SD card! I hope it's OK I posted about your Magisk module on the ported GCam thread here:

https://xdaforums.com/showpost.php?p=77820701&postcount=1563
[Magisk] mohand06:
Hello [MENTION=5765352]TechnoSparks[/MENTION] can I use this on exynos los oreo? Thanks
[Magisk] TechnoSparks:
Yes you can. It is still meant to use on any devices, whether your ROM is sporting sdcardfs or FUSE, it should work.

But the point of the bleeding version is to make sure that the module works on sdcardfs. If you wish to install this specific bleeding version, please look at Magisk and see if the module do not say "- Is FUSE. ts-binds will work on legacy mode" in the log, then please please please report back if it worked for you.
[Magisk] mohand06:
Thanks for your prompt reply, I only forgot to add that I'm still on supersu and don't intend to revert to magisk. Thanks for your time.
[Magisk] TechnoSparks:
Unfortunately i do not provide support to system(-full?) solutions. This is because init.d was an issue back then that it sparked the motivation to create this magisk module.

With shell skills though, you can still use the script in /system/xbin/tsbinds in your system. But of course you will need to remove any references to the Magisk path.

The thing that is dependant on Magisk is the service.sh. create an equivalent in init.d and then properly edit system/xbin/tsbinds to point to it instead of services.sh

NEW EDIT: also copy over the "/data/ts-binds" folder from the zip to /data/ts-binds on your device

I'm sorry that i am unable to provide the same behaviour outside of Magisk root
[Magisk] mohand06:
No problem, thanks all the same. I'll try your suggestion.:good:
[Magisk] benlm72:
Test with OptLineage15.1

Hi,

I'm on Optimized LineageOS 15.1 from JDCTeam, with MagiSK 17.2. FolderMount app no more works (due to FolderMount and Android Oreo incompatibilities).

I've tried ts-binds module in release 1.0 and 1.1 to bind WhatsApp directories (I want to make WhatsApp store pictures on my SD DE98-9DC0 and not in internal memory /storage/emulated/0) but it doesn't work for me.

I've tried :

- the example in the script : I get an error " Folder /mnt/media_rw/DE98-9DC0/Applciation Data/WhatsApp as source doesn't exist"

- the command "folderbind whatsapp "/storage/DE98-9DC0/WhatsApp" "/storage/emulated/0/WhatsApp" : log says sdcard is mounted and bind is successful but pictures are always stored in internal memory and WhatsApp folder in my SD card remains empty

- I've tried to invert source and target folders, always success in log but pictures always stored in internal memory.

So I request for your help if I badly understand howthis module should work, or let me know if I can make some additionals tests and logs to help understanding the problem.

Many thanks for your help !