yashsingh1/xdaforums huggingface dataset:
[Magisk] wstephen:
Config Line Syntax and Access Permission on Media Files

[MENTION=4313092]kishd[/MENTION]

:good: Thanks so much for your kindness in sharing your knowledge.

The mounting went smooth without hicups. I have the mounted folders appeared in the IntSD as 0 bit. However, the photos and videos appear as blurred images. Pressing the download arrows on the images I am met by the feedback "Download failed, Try sometime later". On the ".fbind/WhatsApp" folder I can only see the ".Shared" and ".trash" (same as yesterday), and I can not see other folders through the PC's File Explorer as well (same as yesterday). But this time, nothing in the IntSD when viewed from PC which I could see these images in Windows File Explorer (after the folder appeared to have bound to the ExtSD) through my "try and error" yesterday.

Again I tried to fiddle with these mix of "Magisk Envronments", such as Namespace Mode and Single User Mod again, but no luck I can not reproduce the same "looked like working scenario" I incidentally experienced yesterday. When I look into the debug.log I noticed the command line "errors=remount-ro 0 0", I wonder if it has any reason to do with WhatsApp media appearing as blurred and not downloadable. Or, the WhatsApp has no permission to access the folder ".fbond/WhatApp". In fact, no apps such as Root Explorer including the ADB enabled PC's File Manager. Is this a symptom of "Access Denied" to media folders and files?

Further try and error to change these "Magisk Envronments" indicates that they have nothing to do with access permission to the media files for the PC's File Manager as well as for the device's apps (not WhatsApp specific, but I just referring to it for simplicity) and the PC's File Explorer. Does it has something to do access permission or something else? Almost all these folders and moved data inside the ExtSD under ".fbind/XXXX" directories are appearing as blank page on the Root Explorer. Only 2 exceptions, namely, the "backups" and "tencent" in which I can see them both on the Root Explorer and the PC's File Manager.

There is got to be a break through somehow.

Thanks again.
[Magisk] kishd:
Try this version of fbind that I modified as the original was preventing magisk from saving it's settings.

Your debug log looks fine now. All the folders are mounted.
[Magisk] wstephen:
Looks like a permission problem

Thank you for the fbind fix, installed and ran.

With the original module the obvious difference was that although certain sub-folders that not created by "fbind -b" on the ExtSD the module still made the parent folder invisible. With your fix, the parent folder with sub-folders not yet created on the ExtSD's directory tree remains visible on the IntSD. That's good for debugging. Having so reported, I am still on the same situation after "fbind -mb" with your fix. Blurred Images not allowed to be downloaded once on the ExtSD, and new images too. The media sub-folder has a tree of 10 or more subfolders, i.e., WhatsApp Images, WhatsApp Voice Mails, WhatsApp Videos, WhatsApp Wallpapers, etc. If I do a "fbind -u", then every time I execute "fbind -m" I get new empty sub-folders entering the media tree plus a small amount of media files (1 or 2) into the ExtSD, sometimes not one.

My Observation on the "obb" folder

I have reproduced the "looked like working" scenario by not binding the "obb" folder in the "data/media/obb". It was such that after "fbind -mb", the "data/media/WhatsApp" becomes not accessible by Root Explorer. But, I can still see all these images clearly on the WhatsApp app because they were still in the ram. And, if I reboot the device, images on the WhatsApp app become blurred and can not re-downloaded by pressing the arrow icon on the image. So, the "looked like working" was not real. I was tempted to believed it worked because the original module has made the WhatsApp folder invisible on the IntSD.

With your fbind fix, I can see the new images were on the IntSD. When I reboot the device, the WhatsApp folder disappeared from IntSD without being transferred into the ExtSD. Pressing the arrow icon on the image I am greet with "Download failed. Wait and try again". So, the "obb" folder did not play a role to allow or disallow WhatsApp to write images on the ExtSD. But, when the "obb" folder with others is bound by "fbind -mb" the WhatsApp immediately see (without rebooting the device) every images blurred.

Any suggestion please?
[Magisk] 0LDST4R:
I recommend to simple copy the folders manually BEFORE you bind them with fbind -mb. It's my way to get the module working without bugs. My working folder on extsd is ".mounz", never had problems with my own procedure, i early realized that the moving process during the module is a bit buggy. Once your data in intsd is lost - it's lost forever. In my case i'm lucky, every night my devices are syncing important data folders to my home cloud, so my backups are at least 24 hours old. The module itself is great, no question, but configure it is a bit tricky.
[Magisk] kishd:
Are the blurred images on WhatsApp? If so it's most likely that during the initial move your media was lost. Ask a friend to send you a new pic or vid on WhatsApp and if that's fine you most likely lost your initial data.
[Magisk] 0LDST4R:
That's what i'm talking about. 100% agree.
[Magisk] wstephen:
Blurred WhatsApp Images

[MENTION=4313092]kishd[/MENTION]

Thanks again, I have done a TWRP recovery and they are all there now. :p

[MENTION=9129635]0LDST4R[/MENTION]

Thanks for sharing your experience and knowledge. This is a motivation to me.

Use ".mount" instead of the default ".fbind" in ExtSD

So, I wiped and restored data and changed the ExtSD mount tree to ".mount" from fresh . The blurred WhatsApp Images were still blurred, but the download arrow behaved differently. It did not greet me with "Unable to download. Wait and retry later". But, it was basically the same - can not receive videos and images properly. A bit strange was that in the IntSD only the "media" in WhatsApp Folder showed "0" and the parent folder was still visible. Other bound folders such as tencent, KakaoTalk, etc were hidden.

This was not the case if the bindings in ExtSD were under the ".fbind" tree.

Copy Folders to ExtSD prior to Binding

Though the images still remained blurred, but I must mention that the suggestion of [MENTION=9129635]0LDST4R[/MENTION] by copying folders from IntSD to the ExtSD before "fbind -mb" has noticeably improved the app's behavior. I deleted all media files after copying those folders to the ExtSD. Right after "find -mb", all media files were successfully moved into the ExtSD.

Other Android Messengers - A Real Puzzle

For Wechat and KakaoTalk, after initial binding by "fbind -mb", images right after the binding are not blurred, and videos can also be played back before losing them after rebooting. Thereafter, newly received images survived further rebooting without being blurred, but these new images do not appear on both the ExtSD and the IntSD when viewed by Root Explorer. These media can not be saved by the app's saving tool to its storage folder (apps's response: "SDCard Insufficient Space") in the ExtSD too.

Without deselecting the Activation checkbox, I simply uninstalled the fbind module. But, after rebooting, the newly received images re-appear in the IntSD again. This is strange - I mean, where exactly were those newly received images stowed? The tencent folder, where Wechat resides, was 0 bytes in the IntSD (when viewed with the built-in file manager)! These newly received images survivied even after unbinding and rebooting while hided their presence from Root Explorer!

Impression

These Android Messengers do not appeared to have the permission to write to the ExtSD. Not sure it is device specific or elsewhere there is a hurdle yet to overcome. I will try again if any one has a suggestion.
[Magisk] VR25:
### No, I'm Not Dead! ###

I know, I know... it's been quite a while. Well, yeah, maybe longer than that...

Not gonna write a book on this. Lets just say it's HARD to access the internet on a regular basis from my current location. Plus, I've been busy with general life matters.

That said, my online presence will still remain limited for a while. It won't be that much limited anymore, though. So... yay!

### Latest Changes ###

F2FS Loopback Bug Workaround

Magic GApps

Magisk Manager for Recovery Mode

Moto Z Play Dual SIM Mode Enabler

Sysconfig Patcher

Systemless Camera NX Mod

- Fixed modPath detection & bad PATH variable issues (Magisk V16.6).

- Updated documentation

Magic Charging Switch (mcs)

- Enhanced debugging function.

- Fixed "automation config still calling `cs` instead of `mcs`."

- Fixed modPath detection & bad PATH variable issues (Magisk V16.6).

- Updated charging switches database (more devices supported)

- Reliability improvements

- Updated documentation

Magic Folder Binder (fbind)

- Ability to unmount loop devices and partitions on demand (i.e., fbind -u 'pattern1|pattern2|pattern...').

- Better loop device mounting logic ("ugly bugs" fixed)

- Bind-mount folders automatically regardless of --L (LUKS) flag's usage.

- Dedicated logs dir -- /data/media/fbind/logs (easier & advanced debugging)

- Deprecated `fbind -l` in favor of `fbind -i` (outputs much more information)

- Fixed "misleading [N/A] mount status".

- Fixed modPath detection & bad PATH variable issues (Magisk V16.6).

- Fixed "rm -rf not affecting hidden files/folders" in data moving functions.

- Ignore `app_data` line whose target apk is missing (to avoid app data loss).

- Option to mount app_data in ext4 .img file (loop device)

- Shipping with a comprehensive, noob-friendly tutorial (tutorial.txt, /data/media/fbind/info/tutorial.txt)

- Reliability improvements (better data loss protection algorithms)

- Updated documentation

- Using `rsync -a` for advanced copy operations, instead of `cp -a`.

### Last, but Far from Least ###

Will update each project's thread and repository & answer queries at my earliest (uh... maybe a little late) convenience.

Meanwhile, everything you need is in the attached zip. Yes, all modules are there, along with a md5sum.

P.S., To everyone who donated and/or contributed in other ways,

-- Thank you very much!
[Magisk] Didgeridoohan:
[MENTION=5228676]VR25[/MENTION] Great to see you! You've been sorely missed... :highfive:
[Magisk] shyvanna:
I used Link2SD. I linked an app's data(ext.), then it prompted me that it will change sdcardfs to fuse. Viola! Accidental discovery.

Prior to the fix, mcs didnt prompt me that sdcardfs is still used. No logs even.
[Magisk] Nickson TDR:
I just wanna say thanks to VR25 for creating this wonderful module as I hate installing xposed to my latest MIUI 9.5.2.0 phone as it slow down the whole system. XinternalSD in the only reason I need to install xposed and the FolderMount app is not working (on nougat) and Link2SD requires sd partitioning which is risky as you can destroy your sd if done incorrectly. I tested that this is working for GTA SA and Dead Effect 2..

NOTE: I've spent hours trying to make this module work as there's no GUI to make the process easier and there are only 2 video tutorials on Youtube on this module (both non-English btw).

Followed the videos, but I FORGOT TO CHANGE THE NAMESPACE (TO GLOBAL) IN THE MAGISK SETTINGS (as stated in page 1 of the thread), making the process of making this work more difficult haha. so check it first if you're having some problems. I suggest just manually editing the config.txt file (use root explorer, storage/emulated/fbind location) instead of "fbind -a" as it is easier and lesser chance to f*** up the settings.

For simple obb of games:

obbf com.rockstargames.gtasa

is an example to put in config.txt file, make sure that the obb file itself is in the sd card (Android/obb), and create an empty com.rockstargames.gtasa folder in the internal (Android/obb).

Then input in terminal:

su

fbind -b

close the terminal, check if games work.

Hope in your next update you make a simple gui like in the xinternalsd to make things easier. :)

And again, thanks to VR25 and also topjohnwu for Magisk :)
[Magisk] Hemphiz:
More of these quick guides :) and great work Dev
[Magisk] seijuro572:
just use obb on sd + xinternal in xposed way easier than this. and works everytime. :)
[Magisk] 0LDST4R:
Xposed breaks Safetynet check, fbind module ist working, (when well configured) so, in my oppinion there's no reason to switch to Xposed. I recommend to try this module with a device which is not your daily driver, to learn, try, understand how the module is working.
[Magisk] seijuro572:
naah i don't have time for that and besides its more user friendly than fbind with just a few taps here and there and voila! Done! :D
[Magisk] Abomb:
I installed fbind on my phone (Moto X4, Android 8.0, stock rom with Magisk). When I ran fbind I got

/system/bin/fbind[24]: can't create /data/media/fbind/logs/post-fs-data.sh_verbose_log.txt: Permission denied

I then tried with su (which I guess was stupid :/) and that worked. But after a reboot the external SD card no longer mounts (unter settings -> storage it shows as ejected). I attached a logcat from a boot. I also tried with disabled/(uninstalled fbind module in magisk but the problem persists. I also tried "fbind uninstall", but when I try to answer the question with "y" I get

/system/bin/fbind[608]: y: not found

I would appreciate any help!
[Magisk] czecx:
What is wrong?

Huawei P9
[Magisk] VR25:
[MENTION=2919557]czecx[/MENTION], A new version will be up in a few hours. Thanks.

[MENTION=402959]Abomb[/MENTION], Keep fbind uninstalled for now.

Go to /data/property and remove the following files:

persist.esdfs_sdcard

persist.sys.sdcardfs

persist.fuse_sdcard

Reboot and see whether your sdcard works.

P.S., If you could post the logs located at /data/media/fbind/logs,that'd be great. Thanks.
[Magisk] czecx:
Just updated now and get the same error.
[Magisk] VR25:
My bad... I forgot what was right in front of me. It's fixed now.
[Magisk] czecx:
Now it's works like a charm.

Just one more question.

I have one game, Modern Combat 5, and I need move the files from the game to ExtSDCard. The original place is Android/Data/com.gameloft.android.ANMP.GloftM5HM

What the command I need to use to fbind it correctly?
[Magisk] VR25:
1. fbind -a "obbf com.gameloft.android.ANMP.GloftM5HM" (meaning: add (append) this line to /data/media/fbind/config.txt)

2. fbind -mb (meaning: move and bind-mount)
[Magisk] czecx:
But the game files is stored in Android/data and not in Android/obb or the command is the same for this two situations?
[Magisk] Abomb:
I deleted those files and everything works again, so thank you very much!

I installed fbind again and got the log file
[Magisk] VR25:
Oh, sorry. In that case, use the config line target Android/data/com.gameloft.android.ANMP.GloftM5HM.

You're welcome. Now I would like you to do the following:

1. Run su, then paste the following code directly on terminal and run it:

{ grep -E '/mnt|/storage|/data/media' /proc/mounts && echo && getprop; } >/sdcard/fbind_debug.txt

2. Upload the generated file (/sdcard/fbind_debug.txt).

This will also help me find out what went wrong between fbind and your device. Thanks.
[Magisk] Abomb:
Here you go
[Magisk] arunsai123:
Doesn't work on android 9.

It doesn't mount folders and folders are shown as files.

attached debug.txt

[IMG="Screenshot"]https://preview.ibb.co/ijOVwU/Screenshot_20180811_213207.png[/IMG]
[Magisk] VR25:
For both of you, does it work after running (as root) echo ro.sys.sdcardfs=0 >>/sbin/.core/img/fbind/system.prop and rebooting? What about ro.sys.sdcardfs=false?
[Magisk] arunsai123:
Doesn't disable sdcardfs

Tried both parameters one by one, each after a reboot. still it doesn't work.
[Magisk] VR25:
That's the issue right there -- sdcardfs refuses to go to sleep.

What's the output of getprop | grep -Ei 'sdcardfs|esdfs|fuse'?
[Magisk] Abomb:
With ro.sys.sdcardfs=0 system works normally again, I can access the sd card. but running "fbind" still gives

/system/bin/fbind[24]: can't create /data/media/fbind/logs/post-fs-data.sh_verbose_log.txt: Permission denied

Not sure if this is relevant in my case, but here is the output of getprop | grep -Ei 'sdcardfs|esdfs|fuse'

[persist.esdfs_sdcard]: [false]
[persist.fuse_sdcard]: [true]
[persist.sys.sdcardfs]: [force_off]
[ro.sys.sdcardfs]: [0]
[Magisk] VR25:
Thanks. Did you run fbind as root? :rolleyes:
[Magisk] Abomb:
Nope, am I supposed to run it as root?

Edit: Yes, as it states in your first post. Sorry! Will try that now.

Edit2: Now everything works! Thank you very much for the support!
[Magisk] arunsai123:
getprop | grep -Ei 'sdcardfs|esdfs|fuse'

[persist.sys.sdcardfs]: [force_off]

:/ #
[Magisk] atiprusma:
i have a large apk file (1.5gigs) called com.tencent.tmgp.pubgmhd at /data/app/

i wonder if this module able to move this app completely to my loop.
[Magisk] Kellicros:
I have a Samsung Note 4 running on Marshmallow rom, these are what i have in the config.txt:

from_to WhatsApp .fbind/WhatsApp

from_to Download Download

extsd_path /storage/0C28-AE1E

intsd_path /storage/emulated/0

Things seems to be fine when i do fbind -mb, files are moved to destination folders and i did not ran into any error,

However, only my pre-installed apps are able to see the mounts on these folders, eg samsung's internet and file browser sees the folder mounted to its destination,

This is not the case with downloaded chrome browser, solid explorer and whatsapp, these app will still see the source folder as empty folder and write files in them.

Is there an extra step i need to do to "convert" these apps so they see the mounts properly?

P.S: I have tried converting these apps into system app but it doesn't work.
[Magisk] VR25:
I see... props aren't being set. I have to bring back the aggressive mode. Wait for the next build. Thanks.

Only app data is moved. APK's should remain in /data/app or else these wouldn't work -- because the sdcard is not mounted early enough. There's a potential solution though. If you have a separate partition, you can use the part and bind_mnt functions to achieve that. Unfortunately, I don't have time to explain how to do it right now. Study the README.md and tutorial.txt.

[MENTION=2136576]Kellicros[/MENTION], does the issue persist after adding the line setenforce 0 to your config and rebooting?
[Magisk] atiprusma:
that's too far for me.

one other question tho, i was using your module on miui and mostly i can't use obb feature, i tried on 4 gigs ext4 img device but it's still the same result as i tried on my sdcardfs.
[Magisk] arunsai123:
Sorry. I had disabled f-bind module accidentally. after enabling it, I got:

getprop | grep -Ei 'sdcardfs|esdfs|fuse'
[persist.esdfs_sdcard]: [false]
[persist.fuse_sdcard]: [true]
[persist.sys.sdcardfs]: [force_off]
[ro.sys.sdcardfs]: [false]

still it sdcardfs is active.

[IMG="SS"]https://s26.postimg.cc/qdoo1h4pl/screen.png[/IMG]
[Magisk] wynadii:
Hello, im been using fbind module for a while before. Then i need to flash to android 8.1.

Every mount command i getting this kind of error while the process, but the file and folder successfully moving and mounted.

What should i do?
[Magisk] Kellicros:
Thanks for the reply, tried adding setenforce 0 and reboot, the issue is still there.
[Magisk] bttcp12:
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?
[Magisk] VR25:
Preferably all in /data/media/fbind/logs. Thanks.

Next version will be up within a few days.
[Magisk] sdz2:
config.txt

part /dev/block/sda1--L /data/media/0/ext vfat

Running "fbind" correctly prompts for a password and mounts the LUKS partition.

Running "fbind -u" neither unmounts the partition nor closes the LUKS partition.

It should run:

umount /data/media/0/ext

cryptsetup luksClose sda1

In fact, without running these commands manually, I have to reboot the phone to mount the partition again.
[Magisk] xMotoDA:
fbind -mb fails to move files with special characters

I added a from_to line in my config file, and ran fbind -mb, but it's failing to move files that contain special characters such as á, é, í, ó, ú, ü, ñ

[IMG="screenshot"]https://user-images.githubusercontent.com/24363938/44624461-028ad500-a8b5-11e8-905c-74bf831f19a0.png[/IMG]

https://github.com/Magisk-Modules-Repo/Magic-Folder-Binder/issues/4
[Magisk] VR25:
I didn't implement LUKS unmounting since I wasn't that concerned about it, and nobody has brought that up until now. Next version will include it. Thanks.

A limitation of the "mv" command? Will check that out. Thanks.
[Magisk] WDLawrence:
Mounting the file system

I'm a newbie and I'm try to mount a partition so that I can carry over files from the phone to the sd card. Can someone guide me through it.
[Magisk] Abomb:
I recently tried disabling / uninstalling the module, but after a reboot my sd-card no longer gets mounted.

Last time the solution was to remove persist.*sdcard* files, but those no longer exist. I attached the module logs and the logcat of a boot after disabling the module.

Edit: I spoke too soon, now it works :)
[Magisk] 白い熊:
@VR25 the LUKS mounted volumes need to be addressed more carefully, currently the fsck option is improperly implemented for LUKS, if I'm not missing something. Currently the line:

part /dev/block/mmcblk0p1--L /mnt/mmcblk0p1 ext4 "e2fsck -fy /dev/mapper/mmcblk0p1"

tries to run

e2fsck -fy /dev/mapper/mmcblk0p1 /dev/block/mmcblk0p1

which is obviously wrong and fails...

Also, I'd appreciate if you'd make the fsck output non-silent for the terminal, so I could see right away when mounting if any errors were present on the disk.
[Magisk] VR25:
[MENTION=9371408]WDLawrence[/MENTION], did you read tutorial.txt. It comes with the module and is extracted to /data/media/fbind/info. The info you need is there in details.

[MENTION=402959]Abomb[/MENTION], in addition to removing those files, remove /sbin/.core/img/.core/post-fs-data.d/fbind.sh as well and reboot. That file self-removes when fbind is uninstalled and deletes the other files when the module is disabled/removed. Perhaps Magisk didn't execute it. Try that and let me know the result. Thanks.

part /dev/block/mmcblk0p1--L /mnt/mmcblk0p1 ext4 "e2fsck -fy"

That's the correct syntax. I'm curious as to where the additional "/dev/block/mmcblk0p1" came from, though. o.O

I'll do that. Thanks for the suggestions.

By the way, it's been a while since the last time you posted something here. Where have you been, dude?
[Magisk] 白い熊:
Let me quickly try it - I think I had it like that and that's when it's trying to check /dev/block/mmcblk0p1 not /dev/mapper/mmcblk0p1 - let me see.

:eek:) Yeah, indeed! Long time - I've been swamped at work. Let's see if I can go back to adding some value here... :eek:)

Good to see, you're still going man!

BTW - do you have a definite idea on perms or what needs to be set for Oreo for the mounts to be readable? I can search through the thread, don't know if there has been definitive findings here about Android 8.1...

EDIT: Re the fsck, dou are right—it works as it's supposed to, must've gotten mistaken originally somehow… :@)