yashsingh1/xdaforums huggingface dataset:
[Magisk] VR25:
[MENTION=5993745]JudgeDread11[/MENTION], I removed int_extf & introduced a function which does its job even better.

If you took a look at config_sample.txt, you would see the following:

# FULLY REPLACE intsd WITH extsd

#altpart /dev/block/mmcblk1 $intsd f2fs

#obb

With that, instead of having intsd & extsd, you have extsd in place of intsd. That means intsd is disabled.

Note: you may see a misleading notification saying "SD card is corrupt, tap to fix" every time your device boots up. Simply dismiss it. That happens because the system doesn't mount the SD card as fast as fbind does. Currently, there's no script workaround I know of to hide that message automatically.

So, how do you set things up?

- You do it by simply running find /sys/fs -name *k1*

-- The output of that command will give you your SD card partition name & filesystem.

Take these & plug 'em into the function altpart -- then just add the line "obb", like so:

altpart /dev/block/PARTITION $intsd FILESYSTEM
obb

That's your config file right there.

If you're not happy with that, just let me know -- I'll add back int_extf. ;)
[Magisk] mcurotto:
[MENTION=5228676]VR25[/MENTION] I need to say this is one of the best utilities I have seen for Android. It solved years long annoyances for me. Now I can finally properly use my SD Card.

Congratulations for your hard, dedicated work!
[Magisk] JudgeDread11:
I actually liked to have the 2 mount points. Just to organize my files. A clean root of my SD card while all the files and folders apps create end up in the .fbind folder.

Also it's a lot more noob (me) friendly :)

If it's not too much trouble to add it back I would appreciate it very much. If it's not worth it don't worry. I'll just stick with this version.

In any case, thank you for your fast helpful reply and all the work out into this module.
[Magisk] chrissss91:
Hey, I have exactly the same need : move Hearthstone and Spotify from /data/data to somewhere in $intSD to avoid huge TWRP data backups (no extSD on OP5).

I'll have a look to run.txt

[Edit] : I've installed your module, put run.txt under /data and launched a Terminal with root right and typed "source /data/run.txt" but here is what Terminal displays :

sh: /data/run.txt[1]: can't open html: No such file or directory
sh: /data/run.txt[2]: syntax error: '<' unexpected

I wonder what I've done wrong :confused:
[Magisk] VR25:
[MENTION=7696487]Adomb[/MENTION], [MENTION=4420962]chrissss91[/MENTION], forget about run.txt. I just realized your usage scenario actually makes sense for devices with no extsd. I'll modify the app_data function to achieve what you guys want. Wait for the next build (that should be another big update).

[MENTION=5993745]JudgeDread11[/MENTION], actually -- there's a very simple solution. My bad... I forgot that a recently added function can do what you want! I must be aging too fast... :p

Here's the config:

bind_mnt $extsd/.fbind $intsd -mv

obb
[Magisk] JudgeDread11:
Thank you, I'll try it tomorrow :)
[Magisk] chrissss91:
Thx in advance :good:
[Magisk] nitrous²:
Well, proof that you shouldn't mess with something you don't fully understand. I just deleted my entire WhatsApp Media, Download and Android/data folders. Not sure what happened. FWIW I used these commands from the config_sample.txt file.

from_to Download .fbind/Download
from_to MagiskManager .fbind/MagiskManager
from_to TitaniumBackup .fbind/TitaniumBackup
from_to WhatsApp .fbind/WhatsApp
from_to Pictures .fbind/Pictures
cleanup Podcasts
cleanup Alarms
cleanup Documents
cleanup Notifications
cleanup Ringtones
obb

There was/is no error log file. The _fbind folder is empty. I ran the command "fbind -mb" and noticed that within WhatsApp none of the Media files were visible, as if WhatsApp's media folder was empty. Going through the _fbind folder in extsd, the folders were somehow empty. So I panicked and unmounted using "fbind -u". My plan was to backup the files but it didn't work out. The files seem to be gone.

Internal Storage used to have 7GB free before trying folder binder.

External Storage used to have 71GB free before trying folder binder.

Now, external storage space is the same and internal gained an additional 6GB of space.

Samsung Galaxy S7 Edge (G935F)

Magisk 14.0

Magisk Manager 5.3.0

Magic Folder Binder (fbind) v2017.9.18.1

Android 7.0 SuperMan-Rom (July Security Patch)

TGP-Kernel v5.5.0

SELinux Enforcing

I wish I could provide more info. Flashing a stock ROM with ODIN right now. Gonna stop this for good and buy a device with more internal storage next time.

FOUND 'EM! Somehow neither FX nor Solid Explorer wanted to show me hidden files. In TWRP however I was able to see the .fbind folders.
[Magisk] pat357:
Go in settings in Solid Explorer and tick "show hidden......".

Do the same for FX .
[Magisk] nitrous²:
As I said, none of the apps would show me hidden files even though I changed the settings to show hidden files and folders.
[Magisk] brauca:
got Error

hi, i am trying to make some bindings but i get an error in return:

/magisk/fbind/service.sh[19]: /system/xbin/grep: not executable: 64-bit ELF file

i have a sm g532m samsung

can you tell if i am doing something wrong or if it is just that there is no suport for my phone. because i already had help from a friend that has everything working ok, but he culd not help with my device :-\
[Magisk] VR25:
[MENTION=2626840]nitrous²[/MENTION], did you get the issue solved? If not, the README's debugging section might shed some light into it, step by step. For instance, [some] Samsung users usually need to include the following lines in their config files:

intsd_path /storage/emulated/0

intobb_path /storage/emulated/obb

What these do is changing the paths to the internal media folders for fbind to work with.

[MENTION=8571390]brauca[/MENTION], do you happen to have a 64bit busybox binary installed on a 32bit system...? Do you see lib64 after running "ls /system"?

Could you upload your config.txt file and debug.log (if you have it)?
[Magisk] Yom:
Your busybox might be 64 bit. Remove the busybox module, reboot, and reinstall busybox from the repository. That should do the trick.
[Magisk] brauca:
Solved!

worked by uninstalling and reinstalling the busybox... :p big misstake. thanks alot!!!
[Magisk] samrafanoe:
Extended from_to (from_to -e)

Hey I just wanna know, is extended from_to (from_to -e) still exist in the latest build?
[Magisk] VR25:
It's now named "bind_mnt". Carefully read the OP to know how to use it.
[Magisk] fhLan:
so if I want to bind whatsapp folder to specified folder in sdcard should I type

bind_mnt [/whatsapp /something] ?
[Magisk] nitrous²:
I will, thank you. Once I backed up everything I will try again. Though, I'm not sure if there is something to fix. Like, I know there is nothing broken, it's just too complicated for me right now. I have to study it and once I understand everything I will try again.
[Magisk] VR25:
from_to WhatsApp .fbind/Whatsapp

or

bind_mnt $extsd/WhatsApp $intsd/.fbind/Whatsapp

Either one works.
[Magisk] VR25:
[MENTION=2626840]nitrous²[/MENTION], ok, let me try to ease the confusion...

Your should set up your config file like so:

from_to Download .fbind/Download

from_to MagiskManager .fbind/MagiskManager

from_to TitaniumBackup .fbind/TitaniumBackup

from_to WhatsApp .fbind/WhatsApp

from_to Pictures .fbind/Pictures

cleanup Podcasts

cleanup Alarms

cleanup Documents

cleanup Notifications

cleanup Ringtones

obb

intsd_path /storage/emulated/0

intobb_path /storage/emulated/obb

The order of functions doesn't matter.

A new build is under evaluation & will be uploaded soon. Some of its greatest changes were made in the reference (especially config_samples.txt). Hopefully things will be much easier to understand & set up. A lot of good stuff is coming.
[Magisk] nitrous²:
[MENTION=5228676]VR25[/MENTION] hey, that's exactly how i just set up my config file!

EDIT: Sorry for uppercase. I got excited.

Edit2: Hmm. Still the same. WhatsApp has no longer access to the "new" storage location.
[Magisk] 白い熊:
[MENTION=5228676]VR25[/MENTION], I have ascertained that it's a no-go, through post-fs or service. I've tested all combinations, and it's the same—the symlink always gets renamed, if bindmounted the system gets messed up—I've gone through many phone resets now and there was no combination that I got to work—even tried running by hand and software rebooting, no go…

It's a big disappointment—like this the access issues are here to stay without Xposed…

---------- Post added at 04:22 PM ---------- Previous post was at 04:21 PM ----------

[/COLOR [MENTION=5228676]VR25[/MENTION], I have ascertained that it's a no-go, through post-fs or service. I've tested all combinations, and it's the same—the symlink always gets renamed, if bindmounted the system gets messed up—I've gone through many phone resets now and there was no combination that I got to work—even tried running by hand and software rebooting, no go…

It's a big disappointment—like this the access issues are here to stay without Xposed…
[Magisk] VR25:
@[白い熊, that's what I was thinking. I didn't make any more changes to that part, except moving it to service.sh. Now that you've confirmed it, I can clean that up.

You must've been through quite a few data backups/restores lately...

I would say, "Nice job," but... sorry about that, man!

Um, I guess I can say it anyway, so... nice job!

Anyway, I've been working on alternate ways to get the job done without messing around with so many things. A new build is around the corner.
[Magisk] VR25:
Deleted
[Magisk] pat357:
There is always ADB to give the apps write access to ext. SD card :

adb -d shell pm grant com.whatsapp android.permission.WRITE_EXTERNAL_STORAGE

adb -d shell pm grant com.xda.labs android.permission.READ_EXTERNAL_STORAGE

adb -d shell pm grant com.xda.labs android.permission.WRITE_EXTERNAL_STORAGE

The moment I did this for WhatsApp, WhatsApp can write to the ext. SD..

Not sure how to make it work without ADB ...
[Magisk] fhLan:
i got

sh: bind_mnt: not found
[Magisk] pat357:
It seems to me that something is wrong.

How about :

bind_mnt $extsd/.fbind/WhatsApp $intsd/WhatsApp or

bind_mnt $intsd/WhatsApp $extsd/.fbind/WhatsApp :confused:
[Magisk] 白い熊:
Is there a local shell equivalent—to run adb commands in the terminal?
[Magisk] chrissss91:
Hi,

Simply remove 'adb -d shell' so command in terminal will be 'pm grant com.whatsapp android.permission.WRITE_EXTERNAL_STORAGE'.

It is how I give permissions to Wakelock Detector thru Tasker Terminal.
[Magisk] 白い熊:
Ugh — palm-in-face :@) I thought I saw something like this before… [MENTION=5228676]VR25[/MENTION], I'll test this, also with WRITE_MEDIA_STORAGE and report—this will be super-easy implementable in the main mounting section, if working… I'll report later.
[Magisk] VR25:
Yup, that's it.

But, [MENTION=4237286]白い熊[/MENTION] -- what about granting it to all apps at once by systemlessly adding specific lines to /system/etc/permissions/platform.xml?

<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >

<group gid="sdcard_rw" />

<group gid="media_rw" />

I didn't test it yet, but that might be the one shot solution you were waiting for.

Update: as for WRITE_MEDIA_STORAGE

<permission name="android.permission.WRITE_MEDIA_STORAGE" >

<group gid="sdcard_rw" />

<group gid="media_rw" />

I just realized I can't test that on my ROM. It's been working just fine since day one without these lines added below WRITE_EXTERNAL_STORAGE . It does have the lines below WRITE_MEDIA_STORAGE, though.
[Magisk] 白い熊:
I'll test it…

---------- Post added at 12:08 PM ---------- Previous post was at 11:23 AM ----------

I'll test it…
[Magisk] kishd:
If you test it. I found that on Nougat that mod causes installed apps to randomly dissapear after a reboot. Especially apps that have been updated. Could not find any reason for this behaviour. Just something to keep an eye on.
[Magisk] 白い熊:
I'll see what goes on—it'll take a couple of days…
[Magisk] kishd:
Attached is a Magisk module I found that you could use to modify platform. XML easily.
[Magisk] VR25:
Thanks.

But...

That file is different across devices/ROMs. So, fbind will take the one found on each system and patch it instead. That'll be done during instalation & redone automatically across ROM updates (necessary for avoiding possible incompatibility issues).

The "pm grant" method is included as an alternate way of getting the job done.

Either method will grant WRITE_MEDIA_STORAGE & WRITE_EXTERNAL_STORAGE permissions to ALL apps at once.

I delayed the next release a bit to add that. It's almost finished, though. Stay tuned.
[Magisk] 白い熊:
Are you waiting for me? To put in test results—I could do it today overnight…

Or should I wait for you, for a new version and then test?
[Magisk] VR25:
Perfect timing!

In all aspects, this is one of the greatest updates so far.

# v2017.9.26 (20179260)

- Those facing bind issues, please double check your config file for errors...

-- there's a small chance config_updater.sh might have messed with it a bit during 20179160 build update.

- Added critical flag -- bind_mnt, mv only if $3 = "-mv".

- Added ability to unmount (fbind -u) /data/data/app -- flag -u -- i.e., app_data com.spotify.music -u).

- app_data() works with internal storage too -- reduce the size of TWRP backups by saving huge app data to $intsd/.app_data.

-- The line "extsd_path $intsd" must be present in your config file.

- fbind -u affects bind_mnt() as well.

- Rearranged $PATH elements to avoid/fix busybox issues.

- int_extf() is back.

- MASSIVE optimizations

- Auto-grant storage permissions to ALL apps by default (platform.xml patch & auto-re-patch across ROM updates).

-- Alternate method uses "pm grant" -- add the line "perms" to your config file if the above method doesn't work.

--- This one might take a while to complete (first time only)

I can't update the repo right now. So, I'm attaching the zip here.

Message to All Users

The reference is now much more user friendly. Please, READ/RE-READ it, especially config_samples.txt.

Edit

- Repo & thread updated.
[Magisk] koko115:
After today update i have. Only obb is bind.

mkdir: can't create directory 'extsd/': Read-only file system

mkdir: can't create directory 'intsd/': Read-only file system

[intsd/Download] [extsd/Download]

mount: mounting extsd/Download on intsd/Download failed: No such file or directory

mkdir: can't create directory 'extsd/': Read-only file system

mkdir: can't create directory 'intsd/': Read-only file system

[intsd/Android] [extsd/Android]

mount: mounting extsd/Android on intsd/Android failed: No such file or directory

mkdir: can't create directory 'extsd/': Read-only file system

mkdir: can't create directory 'intsd/': Read-only file system

[intsd/BlackVueCInternal] [extsd/DCIM/.BlackVueCInternal]

mount: mounting extsd/DCIM/.BlackVueCInternal on intsd/BlackVueCInternal failed: No such file or directory

[intobb] [extobb]

- Done.

Galaxy s8
[Magisk] paed808:
Same issue as above except nothing binds in the latest version, not even obb. Moto G 2014 running Lineage OS 14.1
[Magisk] VR25:
[MENTION=4715235]koko115[/MENTION], [MENTION=4549135]paed808[/MENTION], fixed!
[Magisk] chrissss91:
Hi,

I have a OP5 (no extSD) and want to move appdata for some apps from /data/data to internalSD.

As a first try, I try to move a lambda app.

So my config.txt file is :

extsd_path $intsd
app_data com.allocine.androidapp

I ran a terminal with :

su
fbind -mb

and nothing happens (I mean i'm stuck in Terminal )

Here is debug.log :

<Config Update>
- Done.

<SD Card Information>

Nothing else.

What do you thing is wrong ?
[Magisk] bnwg:
Bro

Should be fbind -mb instead of find :)
[Magisk] chrissss91:
Yes, of course, it's a typo in my msg, I've modifyed it.

In fact my terminal seems stuck
[Magisk] JudgeDread11:
Terminal send stuck means it's probably doing something. It might just be copying the data in the background.

How long did you wait?
[Magisk] chrissss91:
about 5min.

Data to move is only 7MB.

Is there a log file where I can find more information about what the script has already done or is trying to do ?
[Magisk] VR25:
# v2017.9.27.2 (20179272)

- Default SD card search path is no longer limited to "/mnt/media_rw/XXXX-XXXX". So, setting "extsd_path PATH" is no longer necessary if the path to the storage device starts with "/mnt/media_rw".

- Updated reference

# v2017.9.27.1 (20179271)

- Fixed bind-mount app_data to intsd.

- Now, if extsd path is null/unspecified ("extsd_path" with nothing in front), fbind will auto detect it.

# v2017.9.27 (20179270)

- Fixed bind errors.

- You can now add `fsck -OPTION(s) /path/to/partition` to your config file (i.e., `fsck.f2fs -f /dev/block/mmcblk1`). This will check for/fix SD card errors before system gets a chance to mount it.

- Updated reference.
[Magisk] Captain_Throwback:
The v2017.9.27.2 version is not working for me. The folders to be bind mounted on internal storage show as zero-byte files. There are no errors in the debug log.

EDIT: Added log. Was going to add screenshot, but the device won't save it because it can't access the "Pictures" folder on internal storage due to the broken bind mount.
[Magisk] VR25:
[MENTION=1162986]Captain_Throwback[/MENTION], what happens after removing /magisk/fbind/system/etc & rebooting?

The latest version works for me just fine. I suspect platform.xml storage permissions patch may be behind your issue. If that's the case, then the alternate method (pm grant) is the way to go for a universal storage permissions fix.
[Magisk] Captain_Throwback:
I don't need any storage permissions fix. That shouldn't be default, imo. I've never had any issues accessing storage on my device.

EDIT: [MENTION=5228676]VR25[/MENTION] deleted that folder and rebooted, and the issue persists. Any other ideas?

I haven't changed anything in my config file so all that changed between it working and it not working is the module itself.
[Magisk] dr.ketan:
Tested older version on Note 8 and worked like charm. Magisk download area still showing version 1 of today. Meanwhile testing small UI for this module for newbies. Attached SS
[Magisk] osm0sis:
Are we talking device specific ROMs? Some stock ROMs don't allow it in their SELinux contexts.
[Magisk] VR25:
Yes. Is there any easy fix/alternative for this situation?

Edit: can "setenforce 0" do the trick?

Edit2: No luck with that.
[Magisk] cantenna:
will give it a try :)

im using renovate rom, selinux permissive kernel
[Magisk] VR25:
Try the attached one instead. See if it works for you this time.

Edit: I missed the "I'm using renovate rom, selinux permissive kernel" part. Then you don't need this. :p
[Magisk] cantenna:
thanks VR25 for trying, i tried that ver of busybox but same result; /data/media/obb links to extsd/Android/obb but /emulated/0/Android/obb dir is missing and launching a game results in a crash. it looks like it is seeing something but may be failing due to invalid permissions.
[Magisk] VR25:
Can you gather ALL your paths to obb and post them here? That may help solve the problem. You say the dir is missing. That's a huge clue for me on what's going on. I just need to confirm something about those paths.
[Magisk] cantenna:
intsd;

/data/media/0/Android/obb

/data/media/0/obb

/mnt/sdcard/Android/obb

/mnt/user/0/primary/Android/obb

/mnt/runtime/default/emulated/0/Android/obb

/mnt/runtime/read/emulated/0/Android/obb

/mnt/runtime/write/emulated/0/Android/obb

/storage/self/primary/Android/obb

/storage/emulated/obb

/storage/emulated/0/Android/obb

/mnt/obb

extSdCard;

/mnt/media_rw/2F56-17AF/Android/obb

/mnt/runtime/default/2F56-17AF/Android/obb

/mnt/runtime/read/2F56-17AF/Android/obb

/mnt/runtime/write/2F56-17AF/Android/obb

/storage/2F56-17AF/Android/obb

/storage/2F56-17AF/Android/obb

and then i'm using your default template for entire obb directory. I did have a folder obb that I manually created as well at /mnt/media_rw/2F56-17AF/obb but I remove it for this report.

Think that's all of them, ludicrous right?:silly:
[Magisk] vikasb32:
Still not working all mounted folder look like file.
[Magisk] VR25:
LOL, WTF! Thanks!

Edit: v2017.6.19 is built and up for download already. See if obb binds properly now. I'm not giving up!

fbind_list.txt will be kept untouched this time
[Magisk] VR25:
Ok, your situation seems weirder and weirder, but I'm not resting on this one either. Can you provide me more info about your ROM (i.e., name, version)? Meanwhile, try v2017.6.19. I added something that may help you.
[Magisk] cantenna:
thanks m8, same result as before, bugger! im optimistic :)
[Magisk] vikasb32:
Tried v2017.6.19 but still not working same problem.

Phone name and model:-yureka AO5510

Android version:-7.1.2

Rom name:- aosp extented

In my other phone(redmi note 4)running same rom aosp extented no problem with folder binder everything works fine.
[Magisk] p50kombi:
I can't get it to bind anything either on my HTC 10.

When I bind the WhatsApp folder and move the files, WhatsApp works, yet every picture I click on gives me the message that the picture is nor on my internal sd card, and its all blurred out.

I also tried to mount the on of gta vc, results are attached.

Any clue what I'm doing wrong?
[Magisk] TopperBG:
Could you check if exist: /mnt/media_rw/1A0B-2E6A/Android/obb/com.rockstargames.gtavc
[Magisk] p50kombi:
Yeah, it's there and has my .obb file in it (as I copied it there manually)
[Magisk] p50kombi:
I did notice that the /data/media/0/Android/obb/ folder is empty

Instead I have an obb folder directly in media which contains the gta vc folder
[Magisk] aseferfan:
Hello I am using the Beta v13 of Magisk and your module is tripping of safetynet

Though I can't help but think that the termux app that you included in the module to be installed as system app might be tripping safetynet :/

it seems as of now anything that even tries to put app as system be any means seem to trip safety net

So could you please remove Termux?(it's crashing in my device anyways so...)

The bind function seems to work okay but it seems i need to move my data prior to binding and rebooting as after reboot the data in the old folder(internel) location is not detected by any app :)
[Magisk] miadevice:
Hello. I'm new here. Folder linking or changing the int-SD <-> ext-SD was always extremely important to me (photos, documents, maps). That's why I signed up here.

But it would be great for ALL android users, if magic folder binder becomes a stable and easy to use app. Great that you work on it! With 16GB or 32GB, no one really gets ahead!!

My fbind_lists.txt (for testing) is simple:

From_to Download Download

From_to DCIM .fbind/DCIM

Log:

#####################

Searching for SD card...

SD card found! Proceeding...

SD card name is 6D34-1CF4.

Searching for configuration updates...

mkdir: can't create directory '/magisk/fbind/.config': File exists

Configuration updated.

Starting Folder Binder Engine...

Checking current status...

>>> Binding folders...

Creating path /mnt/media_rw/6D34-1CF4/Download...

Binding /data/media/0/Download to /mnt/media_rw/6D34-1CF4/Download...

Creating path /mnt/media_rw/6D34-1CF4/.fbind/DCIM...

Binding /data/media/0/DCIM to /mnt/media_rw/6D34-1CF4/.fbind/DCIM...

All done!

#####################

Folders have been created. But unfortunately no downloaded file and no photos. Download Manager (Firefox) does not appear. Footej-Cam crashes.

I am on Magisk 12 and have tried 2017.6.19. "Sd write access enabler nougat" was on, nothing else. This module is now off, but magicFolder still takes media_rw.

Unfortunately, I do not have much time (independent craftsman) and not much idea. But maybe I can contribute, I would be delighted.

Moto X Play

64GB Sandisk (vfat)

7.1.2 AospExtended ROM V4.3 (Kernel 3.10)

SElinux=enforced

Google translated me