yashsingh1/xdaforums huggingface dataset:
[Magisk] Brentana:
Hi, no problem,

thanks for your reply.

Internal and External content are the same, right, i can see every photo and video received IF they where already present at the time i added the internal folder to ts-bind.

But, from that time on, any message received will not show photo or video attachment.

To better explain, assuming now is 12.00 and right now i add whatsapp directory to ts-bind, everything received BEFORE 12.00 is ok, but for all the messages receiver AFTER 12.00, whatsapp tell me that the media is not present..... it seems like if whatsapp is not able to write.... even while receiving photo /video no errors are displayed, when i try to open the photo..... buuum, it's like if you delete a photo and then try to open....

Mmmm, hope my poor english can help.

regards, luciano
[Magisk] TechnoSparks:
Alright thank you for the clear explanation!

Okay after the media has been downloaded successfully, can you find them by exploring using a file manager? Please tell me your findings in both internal and external folders. This is quite crucial to pinpoint where may be wrong.

After I gather enough information, I will provide you a customised version of ts-binds for you to test.

Also, can you tell me what Magisk version are you using? Thanks!

And no, your english is not poor ;)
[Magisk] Brentana:
Again thanks for your help.

Magisk version is 15.3, magisk manager 5.6.1

Did some tests, with some strange results.... First i moved all in whatsapp/media to the external counterpart, to be sure the internal path was empty.

Then i sent me photo and video, first with whatsapp configured to automatically retrieve media, and after with manual media retrieving, to see if some different behaviour was present, but no difference at all.....

The error message was always "the multimedia file is not present on the internal card" for any media i sent to myself using a different phone.... all older media was perfectly accessible.

Photo:

no able to see at all.

Video:

if you try to see the video when the popup message appears on the phone desktop screen (launcher), or any other application screen if the popup appears when you are using some app, you can see the video. BUT, if close the popup, and then launch whatsapp to look at the received media.....error!.

If you do not look at the media from the popup, but launch whatsapp application, and from there try to open the video received, again error...

So as for you suggestion, i looked for the received video and photo using a file manager (set to show hidden file, if this can change something....), and nothing was found in the real external path, nor in the mapped internal folder. Since the internal was substituted with the external, i disabled the ts-bind module and restarted the phone, to be able to check the "real" internal media folder... nothing was present

Hope this can help, if you need more test i'm here... may i'll not be able to answer immediately, due to some problem with my job and internet access, but surely i can answer in a couple of days...

Regards, Luciano
[Magisk] TechnoSparks:
First i would like to say sorry for not being able to respond in a quick manner. I am sure you were waiting for my response… This semester is a little bit different for me

This is dangerous (as in data loss). I hope that you have disabled ts-binds, or have unbinded the WhatsApp folder before you did this!

“Nothing was present” - I assume this refers to the new media. Okay, I am going to assume that the problem is because a conflicting “knowledge” of internal folders between the application and the ROM itself. I don't know how to put it into words unfortunately.

May I have a copy of your ts-binds-folderlist.txt please?

I need help for you to try and do this for me, and report back your findings. Alternatively, a screen recording would also do the job. Let's try to emulate what WhatsApp is doing by using a file manager. You will also need a terminal emulators to run a few commands.

First, let us create a folder “TempTS” in both internal and external storages. This can be anywhere you want. Let us assume you created them at the root of both storages, add a new folder couple in “ts-binds-folderlist.txt” that concerns this TempTS folder.

folderbind test $sd/TempTS $int/TempTS

Okay at this point you can see where this is going. Simply reenable ts-binds then reboot or execute `ts-binds reinit` (if you didn't disable the module).

Let us make sure that the TempTS folder is binded by running `ts-binds check test`

We need a file to put in the external TempTS. The file needs to be outside of any TempTS directory! You can use any file you have, or just create a text file and put a random word in it.

Now copy such file into the internal TempTS. Is there any error? If no, proceed to navigate to the external TempTS. Is the same file exists? If yes, open the file and check if the content is similar. Is it similar? If yes, then delete the file from external TempTS. Go back to internal TempTS. Is the file exist in internal TempTS?

Looking forward for your reply.

---

I have also subscribed this thread to email so that I am notified on your reply. It is mind boggling for me that I haven't done this since ages for this specific thread!
[Magisk] Brentana:
Thanks TechnoSparks,

please, do not worry about immediate reply, i completely understand that this is not our first priority in life, so take your time, i can survive (better, my wife can survive).....

This is dangerous (as in data loss). I hope that you have disabled ts-binds, or have unbinded the WhatsApp folder before you did this!

yes, of course i did that BEFORE enabling the module...

“Nothing was present” - I assume this refers to the new media.

Absolutely YES

May I have a copy of your ts-binds-folderlist.txt please?

Ok, just attached the .txt and .log files, they seems correct to me.

And now, these are the findings about the tests you asked me to do....

First, let us create a folder “TempTS” in both internal and external storages.

Done, binding checked, working fine... to simplify, let me call them INT and EXT....

Created a file named "TEST.TXT", containg just "Hello", and placed outside our directories.

Now, placed the file into INT.

- I can see the file in both INT and EXT.

- Renaming INT reflect the situation in EXT.

- Renaming EXT reflect the situation in INT.

- Deleting INT reflect the situation int EXT

- Deleting EXT reflect the situation in INT

- Modify INT reflect the situation in EXT

- Modify EXT reflect the situation in INT

- Copy the file istself from INT to EXT (overwrite itself) issued no errors, but result in blank file (0 byte), checked in INT and EXT.

- Copy the file istself from EXT to INT (overwrite itself) issued no errors, but result in blank file (0 byte), checked in INT and EXT.

After, thinking the situation could be wrong in one way only, i did the same tests, with the same very results, but placing the file in EXT, not in INT.

Not counting the overwrite, that could be a problem for a lot of reasons, any other situation is correct... tryed a virtual machine in DOS with the SUBST command, that

do (i think) the same things of ts-bind, with the same results....

Is it possible that the problem is really whatsapp related.....

Regards, Luciano
[Magisk] TechnoSparks:
Okay, thank you! It somewhat proves that ts-binds is working absolutely fine and it may be WhatsApp or Android is at fault here. May I know what build (nightly, snapshot, stable) is your LOS 14.1? And also what is the build date?

I am considering to try replicating this issue with WhatsApp later when I am prepared on my test device.
[Magisk] Brentana:
Hi,

LOS 14.1-20180216-NIGHTLY-serranoltexx

Whatsapp 2.17.427

And yes, done some other test moving, copying, creating files using FileManager app, whit no errors at all, so probably it is really a problem related to whatsapp.....

Thanks again, Luciano
[Magisk] TechnoSparks:
Greetings. At first I would like to genuinely apologise for my disappearance. Things have been really hectic for the past month, and I still have a few weeks to go through. I find a short amount of time to breathe here to report back to you my findings.

I did two tests basically. One with my old Xperia SP huashan running the same LOS 14.1 with Magisk v15. Unfortunately I am unable to replicate the bug you are facing. That was weeks ago (I forgot to report back to you here). Before I write this, I did another test again with my newly unlocked Nokia 6. It is running stock ROM however, version 8.1 with May security patch. Using Magisk v16, WhatsApp 2.18.142. Still cannot replicate the issue.

It has been a month, I don't know if a new nightly or new whatsapp version may have indirectly fixed it for you. But I am interested to know since I am unable to replicate the issue myself.

I have also updated the module to version 1.0.8. This time I changed the script's shebang (the interpreter it wants to run it) to /system/bin/sh instead of the old /system/xbin/bash. If the problem still exists, you might want to try it out
[Magisk] Termi93:
Sorry for my sutpid question, but reading this on the first page:

For example, if you mirror the “Download” folder on Internal with the “Stuff from Internet” folder on your SD Card, the same list of cat pictures will be shown on both directories when navigated via a file manager, and any changes will take effect on both paths.​

I understood when downloading something, lets say XYZ and the Browser only downloads into the internal storage folder "Download" it would end showing up in both folders?

So if i unbind the folders, where would be XYZ located then?

The trick with FolderMount was, despite the "Download" folder being named in the browser settings, the file would end up being stored in "Stuff from Internet" but showing up in the browsers download history.

FolderMount giving the ability to hide, which i understood could be done with a dot in front of the foldername or with a .nomedia file here.
[Magisk] TechnoSparks:
yeah, the module works similar as to FolderMount. In fact, I discovered FolderMount's ability to bind folders is by inspecting the SuperSU logs back then. It kind of open my eyes a lot more on the capabilities of the Linux kernel. Now allow me to answer by paragraph

I understood when downloading something, lets say XYZ and the Browser only downloads into the internal storage folder "Download" it would end showing up in both folders?

So if i unbind the folders, where would be XYZ located then?​

Okay based on the page I set up here, the command for that to be useful is:

folderbind $sd/Downloads $int/Download

It works based on "source --> destination". Hence the "$sd/Downloads" is the folder of which XYZ will be located. "$int/Download" will mirror the files based on the source. The module works by supplying two different paths, which is for ease of understanding, first parameter being the folder on SD Card and another the internal storage. EDIT: It is also in the "Adding a folder couple" section

Yes about the duplicates, it is also explained in the link above.

Your question is not stupid. In fact it is exciting for me to receive it because it shows that at least there are people who are interested in my modules. :D
[Magisk] Termi93:
Thx 4 your answer.

My english isnt that good, so i sometimes dont get the meaning of a text.

That clarified a lot, because every time when u wrote "mirror" i didnt understand where the file itself would end up being located in. Sounded like a clone of a folder or synced, like the local OneDrive folder on several devices mirros the other ones.

Now the next step...

Having used FolderMount before going to Android 8.1 i have the old external folders containing their files lying around on my SD card.

Can i just go ahead, use your module and start for every pair from back then like:

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

Or will then the at the moment empty internal sotrage folders be mirrored to my SD card overwriting the existing files because the internal folder is empty and it mirrors that state?

Additionally, reading through your webpage i found the section "Risk of Data loss?"

Which folders are meant with "binded folders" the sources, the targets, both?

If i use it for eg. WhatsApp, the App will write to the target path, i think this should work, but reading the warning i am unsure.

Or is it only meaning not to copy/move in between one source & target pair?

I am sorry for asking that much but i dont wanna risk my data or having to back it up and fiddle around several times.
[Magisk] Brentana:
Thanks TechnoSparks,

did some test with the new version, but for me the bug is still present..... same as before.

- Bind the folder WhatsApp/Media to external sd.

- Deleted internal folder

- All is ok for OLD pictures and videos

- Receiving a new messages with Photo

- Unable to see the photo, it appeared as unfocused, like when you delete a photo, it appears in the conversation list but cannot be show

- WhatsApp tell me that the image cannot be found on the INTERNAL memory.

Now, the word *internal* in the message can be a standard message, or can be a direction into look, i cannnot tell this, but anyway, for me is again a whatsapp related problem, because in any other situation, it works perfectly.....
[Magisk] TechnoSparks:
I had to use the word "mirror" because the binded folders are not synced, combined, faked etc. The target folder in the "folderbind" line I gave earlier is showing the contents of the source folder. This gives a mirror-like effect. Anything you do to the source folder will happen to be the same for the destination folder, and vice versa. It is also like a little lie, where the files are always located physically on the source folder eventhough it appears to have the same contents for both folders (hence why not a "synced" folder). So, the word mirror is the only word that is accurate enough to show what does ts-binds do…

Yes you can do that without any issues at all.

If I understand your question correctly, no. The "folder couple" line you gave earlier is correct, and the contents on Internal Storage will correctly show the contents of the folder on the SD card. If you swapped the parameters, eg `folderbind whatsapp $int/WhatsApp $sd/FolderMount/WhatsApp` then the result would be as what you asked: the external folders will be empty, because the internal one is too (remember the mirror effect).

Yes both.

Unfortunately I don't understand this question. can you elaborate?

Yes, exactly.

Yeah I need to again rephrase the warning so that it would be extra clear for everyone. Thank you for pointing the flaw in the sentence, really.

Your data is always fine.

The bind operations is just a way to tell the Linux kernel that a folder is, well, binded to another. This starts to get technical: so the kernel will then acknowledge that the target path (folder) is now a mountpoint, not an ordinary directory. It will then shows the contents of the mounted source (the source folder) instead of the original contents. The physical files that originally resides in the target path is still there and will always be accessible again once the mountpoint has been unmounted.
[Magisk] TechnoSparks:
This is really strange. You know, it seemed that I am helpless in actually addressing the issue of yours. However, this is a fascinating bug. You said it works in any other situation, which is weird. If whatsapp doesn't work, anything else should not too. WhatsApp doesn't hardcode the path to internal storage. They use what the Android API has to offer. This can be proven by a user if the user uses the Xposed XInternalSD module.

I am unable to reproduce this at all. Maybe it has something to do with your Custom ROM. Huge "maybe". I am sorry that I am unable to address this issue :(
[Magisk] Termi93:
Thank you again TechnoSparks for your answers.

You answered my 2. Question with your 3. Answer.

I didnt get the meaning of:

I didnt understand that this is only regarding copy/move in between the binded folders.

If i did get you right, copying/moving from any other location than the folder pair into one of the paired folders will just result in the data showing up on both, while being stored in the source folder.

I really appreciate your extensive answering to my question caused by a lack of understanding.
[Magisk] TechnoSparks:
Yes you got that correct!

No problem, glad I could help! :D
[Magisk] Termi93:
Sadly i'm here again with the next issue...

Installed your module from MagiskManager now and... made a typo by putting in a space. Thought it wouldnt be that bad cause i backed up my data before.

Looked like this:

folderbind WhatsApp "$sd/Folder Mount/WhatsApp" $int/WhatsApp

Instead of: folderbind WhatApp "$sd/Foldermount/WhatsApp" $int/WhatsApp

But now comes the problem... i thought i'd just go into the file, edit it to be correct, save it and here ya go...

Sadly ts-binds isn't reacting to any changes done to the ts-binds-folderlist.txt anymore. I already uninstalled the module, deleted txt & log, installed it again. On new install the folderlist.txt wasnt created so i placed it manually. It only recognizes, when i delete the file, than an error message shows file missing:

chwon: data/media/0/ts-binds-folderlist.txt: No such file or directory

cmod: data/media/0/ts-binds-folderlist.txt: No such file or directory​

Running rebind in the terminal just bound the faulty couple again without recognizing the new content of the txt File. :confused:

Just to be able to distinguish between the entrys i cleared the .txt of any foldercouple and added a new one and linked that to a copy of my WhatsApp folder..

folderbind wtf "$sd/WhatsApp" $int/WhatsApp

I ran "unmount all" and "reinit" in the terminal with the output: bind successful: WhatsApp

Confusing me because i dont have the foldercouple named WhatsApp in the folderlist.txt anymore

---------- Post added at 07:43 AM ---------- Previous post was at 07:01 AM ----------

Got rid of that issue.

I changed the line in folderlist.txt back to: folderbind WhatsApp "$sd/Folder Mount/WhatsApp" $int/WhatsApp

Then unmounted in the terminal and changed it to the correct path:

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

---------- Post added at 08:19 AM ---------- Previous post was at 07:43 AM ----------

But i still couldnt get it to work properly sadly...

Despite the output in the console that it is mounted properly, i cant find the contents with a file explorer.

I tried it with a path written like this:

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

and i tried putting the complete path in too like storage/emulated/0/WhatsApp...

And now i crashed something seriously because my device is doing a bootloop... :eek:

Luckily reflashing is done quickly.
[Magisk] Termi93:
After setting up my phone again i'll give it another try again now ... lets hope the best

Strange thing...

I wrote the following in the folderlist file and rebooted:

folderbind whatsapp /storage/452B-1DFB/Foldermount/WhatsApp /storage/emulated/0/WhatsApp

The result was the whole microSD card was mounted into the WhatsApp folder...

su -c tsbinds unbind all

Now i changed it to:

folderbind whatsapp "$sd/Foldermount/WhatsApp" /storage/emulated/0/WhatsApp

su -c tsbinds reinit

The result was that the WhatsApp foldertree from the microSD card was mirrored but the files were missing | Whatsapp could put in its foldertree there on its own.

So i tried a reboot at this point, which resulted in the bootloop again.

If i understood it correctly, $sd just replaces "/storage/452B-1DFB/" and $int "/storage/emulated/0/" so i thought it couldnt harm to give them the specific path. Which kinda worked in the first try but idk why the second try totally screwed things up again.

At least restoring boot, system and data from my TWRP backup made my device running again :)

But sadly i think i'm out of this one... not interested in any more loops & restoring backups.

Or u read this,think goddamn how stupid is this guy and then tell me, what i'm doing that wrong...
[Magisk] Brentana:
Hi TechnoSparks

i can assure you that this surely is not you fault, and you are not helpless.

No one can address you for something that a stupid application *do not want* to implement....

The other situation i mentioned, is because tests done with a couple of file managers, and my browser, are working pretty well.

On the other end, i perfectly understand that your module and whatsapp may not work on *my s4 mini los 14.1*, so i'm not going to blame you, but, as opposite side, i can only THANKS for your trying.....

Regards, Luciano
[Magisk] TechnoSparks:
Okay we need to relax a little bit. To clarify your issue for the first post, allow me to explain. I just notice this problem recently. If you try to unbind the folder couple, the ts-binds will report that it succeed but the file manager contents will remain the same. This is again, an issue out of my power. The ROM seems to be remembering the binded paths for some reason, while the Linux kernel already knows that the folder couple is no longer mounted.

This can be proven by ts-binds itself. Running `tsbinds check whatsapp` for instance will return that "whatsapp" is unbinded. ts-binds doesn't lie here, as the output relies completely on what the kernel reports back. Here is the snippet from the script:

# Check --------------------------------------------------
elif [ "$1" == "check" ]; then
function folderbind {
grep -q "$3" /proc/mounts && tslog "$1 is BINDED" || tslog "$1 is NOT binded"
}
if [ ! "$2" ]; then
echo 'E: Bind name is not provided!';
elif [ "$2" == "all" ]; then
source $folderlist
tslog "All entries were checked"
elif line="$(grep "$2" $folderlist)"; then
eval $line
else
tslog "Unable to check $2, entry not found in list!"
fi

Printing out the contents of the target folder in terminal `ls -a /data/media/0/WhatsApp` will show that the mountpoint have already been unmounted.

So your issue is acknowledged by me already and I am already working on deprecating the "unbind" feature and drafted a "troubleshoot" section for alledged "fake" unbind for my website.

After some considerable research I managed to understand that Android has another some sort of a file system service that checks for changes and stuff. This might be the true cause — Android's vold. This discovery is kind of surprising for me, it just shows how too complex and messy Android is when it comes to storage. The reason why I did the research is I was trying to see if it really is impossible to use the "mount --bind" under SDCardFS (which by the way completely impossible)

A source on the internet recommends stimulating vold to check for changes by simply calling the binary from the PATH. I did not tried that yet as of now.

To conclude all of this, what you did was not wrong at all! Just that we unfortunately need to restart the device for the changes to take effect.

I strongly advise not to use the absolute path to "/storage". The true mountpoints for internal and external is "/data/media/0" and "/mnt/media_rw/SERIAL" respectively. These true mountpoints are assigned to the variables $int and $sd for the user's ease. That is why the WhatsApp example and my website revolves on those two variables.

Okay, now to clear this mess, you need to go back to square one. If you realise you did something wrong, you have to restart the device for the changes to take effect on the ROM after modifying the "folderlist".

Hopefully I clarified the situation to you as clear as possible
[Magisk] TechnoSparks:
Thank you for the kind words. I really appreciate it. :) Sincere regards!