yashsingh1/xdaforums huggingface dataset:
[Magisk] nl3142:
I didn't know link2sd/apps2sd worked with Nougat/Oreo/Pie but that is good news. Though it would be nice to be able to move both apps and their data without needing a second partition or ext4/f2fs formatted sd card by using an ext4 image (something like "app2sdimg=.fbind/app2sd.img" and then "app2sd com.foo.bar") eventually.

As for moving app data I have found that permissive is pretty much required for it to work right most of the time.
[Magisk] urmitnick:
Thank you very much :)
[Magisk] AllesMeins:
App installs itself in fbinded directory

I've witnessed some strange behaviour.

from_to Android/data/org.leetzone.android.yatsewidgetfree/cache yatse/cache
from_to Android/data/org.leetzone.android.yatsewidgetfree/files/OfflineMedias yatse/OfflineMedias
from_to .galleryvault_DoNotDelete_1517955576/files galleryVault
from_to OLYMPUS OLYMPUS

For some reason the last line seems to screw with installing new Apps. I installed Titanium Backup from the playstore and it would immediately crash. After some digging I discovered something strange - Titanium Backup installed itself into OLYMPUS/data/com.somethingsomething.titaniumbackup/ instead of the usual data folders. :confused:

After removing the OLYMPUS-Line and a restart Titanium Backup installed and runs just fine. Any idea what is happening here?
[Magisk] urmitnick:
Hi

I've used fbind to move whatsapp folder to the sd card, but I'm facing some issues, I can't download media files (images, videos) , or record video/audio.

I've tried: fbind -f, adding permissive to :data/adb/fbind/config.txt, and tried both of them at once, without success.

How can I resolve this issue?
[Magisk] sieger007:
HI VR25

Thanks for your wonderful creation thats been a life saver for so many, I am a noobie to all this. I am trying to follow the concept here and need help with my situation.

Concept ( correct wherever I am squat )

-- you can use it via a config file that will be applied at mount time or post boot you can use terminal to invoke this

-- do you use either or both ? confused

Situation :

My micro sd's have periodically suffered from data corruption . I use app2sd - so have a hidden ext4 and exFat data. The latter suffers from this. AFAK this is not physical because fsck runs fine . chkdsk will give up .

So I created totally 4 ext4 partitions

1 for app2sd other 3 for data. ( High Moderate and Low RW activity )

The hiddent ext4 is mounted via app2sd ( I haven't tried it but I wonder if I could just append the additional 3 ext4 mount commands to app2sd mount file )

I want to mount these 3 partitions but 2 as subdirectories

Part #1 /sdcard1/DCIM

Part # 2 /sdcard1/whatsapp

Part #3 /sdcard1

How do I go about doing this.

for all the accommodations you made with those exhaustive options. I feel you DEF deserve a lot ... I will refer your utility to the class I teach and ask them to contribute too. as well as other places.

Thanks for your help VR
[Magisk] sieger007:
Not sure if both nail to the same issue .. but if it worked before and then stopped working. Do a chkdsk on that card and see if there is corruption. I used mount binding to move whatsapp data to sd and right now images wont d/l but vids will when binding is on, When off all works well., chkdsk shows corruption.

See my below thread where I am considering ext4
[Magisk] ziki:
Fuse issue

Hi,

I experience this problem: enabling the module (even WITHOUT bind anything, config.txt empty) using -f option, my Samsung camera stucks during images acquisition in burst mode. In this mode the camera writes the image files into internal storage path (due to memory speed constrains). I had the same issue when, withou any mounting module enabled, I were able to force the camera to write burst shots to sd card.

If I remove fuse mode, camera works again but any mounted folder (ext to int, from_to command) is not writable.

In fuse mode, is the whole internal storage path mounted as FUSE fs? Could be the bad FUSE fs performance the cause of the camera stuck?

Is there a way to mount without -f option and have writable mounting points? I tried also 'permissive' option but it does not work (no write access).

I have a Samsung S7 with stock Oreo + Magisk 18.1

EDIT: I fixed the issue installing Moro kernel, the stock kernel does not have "SELinux Selectable Permissive". Now with Moro kernel and 'permissive' option in config.txt folders are mounted as SDcardFS and are writable and Camera burst mode works well.
[Magisk] Hzz17:
Hi, [MENTION=3525574]xtam[/MENTION],

Could you share your full command lines to mount remote drive? I have the same problem that I can't see files without termux. Even if use rclone mount drive: /data/media/0/rclone/ without fbind.
[Magisk] bnwg:
Hello [MENTION=5228676]VR25[/MENTION]

Thank you for the guidance. I can mount the EXT4 image to the app data that is selected. One thing I found out is that when EXT4 img is created I need to specific the partition name and path (i.e. /mnt/media_rw/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/appdata.img). If not EXT4 img can't be created.

In fact, I'm looking for an solution that is trying to leverage fbind. I'm using multi-user mode at the same time (ie. user 0 & user 10). Since Tbackup didn't support multi-user I rely on the primary profile (user 0) to backup all the necessary app (and its data). My idea is to have this EXT4 img to act as "centralize location" to store the selected app data and can be mounted to either user 0 or user 10 according to my favour. I can switch the app between user 0 and user 10 with the latest data (or if possible to have both user 0 & 10 share and use the same data?).

Now when I tried to mount EXT4 img to the app in user 10 it didn't read while I mount the same EXT4 img to user 0 it works.. I want to seek your help on how to do this if this is possible. Thanks.
[Magisk] Mickey03:
Can your module replaces the folder mount apk if it is please how to use it?
[Magisk] Hzz17:
What does it mean force fuse is off:confused:
[Magisk] xtam:
first in terminal like termux or other:

su -M

(-M to have mountpoint available for other apps)

now

rclone --config=rcfile.conf mount drive: /data/media/0/Download/rcm2 --alow-other && fbind -b /data/media/0/Download/rcm2 /mnt/runtime/default/emulated/0/Download/rcm
[Magisk] Hzz17:
Is your filesystem fuse or sdcardfs?
[Magisk] xtam:
I didnt use fuse, how to check it?
[Magisk] Hzz17:
Thank you so much.:good: It works, successfully mount remote drive. I check the filesystem with

su
df -t sdcardfs
[Magisk] enkidu70:
Hi,

I need some help in setting this tool up because I do not get it working.

My system: Resurrection Remix 7.0.2 (Android 9) on an Oneplus 3T (no real external sd), Magisk 19.

I am trying to mount /data/media/0/Test to /data/media/10/Test but I do not get it working.

Tried it with

bind_mount /data/media/0/Test /data/media/10/Test

and fbind --mount or --remount but nothing happens.

What's wrong?

Tnx for your help,

Enkidu
[Magisk] MrMmmkay:
[MENTION=5228676]VR25[/MENTION]

Looks like .img support is broken with magisk 19.1, after updating to 19.1 an App that I have moved to an .img file cant be started, when I typed "fbind -m" there was some error like "sbin/imgtool not found" or something like that, sorry, I totally forgot to make a screenshot or to save the log files, and it tooked me some time to revert back to magisk 18.1, so I can´t reproduce it now.

The device is a Xperia XZ1 Compact with latest Android 9.0 (and with the problem that WhatsApp Folder can´t be mounted to external SD because of the security or something, nor permissive or fuse are working).
[Magisk] jemail:
[MENTION=5228676]VR25[/MENTION]

fbind is no longer listed as a downloadable module in Magisk 19.1.

Is this intentional? Has fbind been removed from the repo?
[Magisk] iamMG:
I wish this module was easier to understand and use 'cuz it doesn't seem to be working for me. When I run the command

fbind

in Termux, it says:

No command 'fbind' found, did you mean:
Command 'find' from package 'busybox'
Command 'find' from package 'findutils'

There is a folder named 'fbind' in the folder "/data/adb/" but not in "/data/media". (telling this 'cuz you seem to be pointing out this folder quite a few times in this thread.)

I have also edited the "config.txt" file. I just want to connect WhatsApp data folder on the internal storage to the Dual Space WhatsApp folder in the root memory in my Redmi Note 3. I figured this is the code:

bind_mount /storage/emulated/0/GBWhatsApp /storage/emulated/999/WhatsApp

I stilll don't know how to make it work. Please someone help.
[Magisk] VR25:
SELinux is a double-edged sword, unfortunately.

By the way , I was busy and offline for a long time.

This module and all others are being updated.
[Magisk] VR25:
Hi,

I was busy and offline for a long time.

You can use the config file, terminal, or both. The difference is that the config file automates everything. Think of it as /etc/fstab (sort of) on Linux machines.

Note: for better experience, some operations have to be carried out as early on boot as possible (e.g., mounting partitions). For that, the config file is your friend.

Mounting Partitions

It's likely possible to modify apps2sd mount script to mount the 4 partitions. However that script may easily be overwritten by the app.

You can mount the partitions (plus fsck -fy them) with fbind as follows:

# partition 1 (assuming it's /dev/block/mmcblk1p1)

part /dev/block/mmcblk1p1 /mnt/sdcard1 "fsck -fy"

# partition 2 (assuming it's /dev/block/mmcblk1p2)

part /dev/block/mmcblk1p2 /mnt/sdcard1/DCIM "fsck -fy"

# partition 3 (assuming it's /dev/block/mmcblk1p3)

part /dev/block/mmcblk1p3 /mnt/sdcard1/WhatsApp "fsck -fy"

Notes:

- The order of partition mounting in this case matters. Just follow the logic.

- You can't (yet) mount to /sdcard1, since / is mounted read-only. This will change with the next release.

- Apps will not recognize /mnt/sdcard1 as a standard storage path. To go over that, you could mount to [/b]/data/media/0/sdcard1[/b] or /mnt/runtime/default/emulated/0/sdcard1 - whichever works.

- If you face issues, try running fbind -f and/or add "permissive" to the config.

- The config file's path is /data/adb/fbind/config.txt
[Magisk] VR25:
Some "bad" news...

Magisk ditched "imagetool" (used to create and manage ext4 images) and it's now image-less. Newer Android versions are coming without similar programs. I'll have to look for alternatives.

Now, regarding the centralized image...

Two issues:

- Ownership or permissions have to be changed before mounting the image to another user's path. This is manageable.

- By default, secondary users don't have access to external storage. This is not so manageble. I've been working on a replacement for FUSE/SDCARDFS to bypass such and other limitations. It's half baked at this point.

I like the idea and will definitely think about it further.

Thanks
[Magisk] VR25:
Yes, refer to sample_config.txt inside the zip. You don't have to use terminal at all.

It means "use SDCARDFS" (default on most systems). FUSE and SDCARDFS are emulated filesystem used for mounting internal and external user storages.
[Magisk] VR25:
The logic expects an SDcard. For devices that don't support/have one, you must append "extsd_path $intsd" to the config.
[Magisk] VR25:
I'm aware of the ".img" and other issues. Refer to the previous posts for details. Working on updates...
[Magisk] VR25:
It was moved to the modules grave because I didn't have time to update the installer. It'll be back. For now, find the latest zip in the threads archive (first page).

Did you run "su" first?

Alternatives

su -c fbind

su -c /sbin/.magisk/img/fbind/system/*bin/fbind

The config file is /data/adb/fbind/config.txt.

What do you mean by "Dual Space WhatsApp folder"?

That isn't found in external storage, is it?

If it's internal storage, you also need the line "extsd_path $intsd" in your config.
[Magisk] darknessmc:
If I need to use my exfat 64g sdcard as internal should I formate it?
[Magisk] zdoe:
what worked on nougat 7.0 doesn't work on 8.1 oreo

i'm a long time user of fbind, and have come to rely on it.

now i tried to upgrade the ROM on my moto G5 to oreo, and i ran into problems - allegedly due to additional "security"/crippling on oreo.

haven't read the entire thread, but there's a few users that complain about whatsapp not being able to write to the SDard. i believe my issue is the same, though i'm using the chinese WeChat app.

fbind moves the data folder in what seems successfully, but the app isn't able to write all things on it, just some. e.g. - large image files don't appear at all, and trying to save them results in an error message about the app not having write access.

the line pertaining to WeChat on my config.txt is simple enough:

target Tencent

this works on 7.0, not on 8.1.

what gives? would the another magisk module "exSDcard Access Enabler" fix this? currently, i'm reverted back to 7.0 until i get this working.
[Magisk] VR25:
This may be risky on Oreo+ (data loss). Adding "permissive" to config may prevent issues. You don't have to change the filesystem.

Did you try fbind -f and adding "permissive" to config?

The extra security is a bummer. I'll be working on updates soon.

Try "ExSDcard Access Enabler" if the aforementioned workarounds fail.
[Magisk] zdoe:
sorry if this is a stupid question, but read a lot of this thread and found no answers. how exactly to do this?

add

permissive_SELinux

as the first line of config.txt?
[Magisk] VR25:
Your first stop should always be the documentation. The thread is an extra.

Add "permissive" (not "permissive_SELinux") to your config, on its own line. The order doesn't matter.
[Magisk] zdoe:
move to intSD from data partition possible?

sorry, my bad. sample config containing same (or some user's) would have thought me this. things are not obvious if you don't know linux - like me. anyway, it's working on nougat, not yet tried on oreo.

next - i'd like to move bbc news app's data to extSD. it's storing a vast amount of unnecessary data that i'd like to occasionally remove. but the line in config:

from_to data/data/bbc.mobile.news.ww bbc

doesn't do it. further, it would need the move to happen very early on boot sequence as the app has a widget that fails if the app has started before the move. what, if any, line on config would do this?
[Magisk] VR25:
I understand. That's one of the reasons I'm constantly updating documentations.

Moving app data to the SDcard is not as friendly now that Magisk itself doesn't use an EXT4 image. It had a superb tool for image creation and management.

Such an image is required only if the SDcard doesn't have a Linux filesystem (e.g., EXT[234], F2FS).

I'll be working on major updates. The "move app data to SDcard" feature will be one of the main targets - improve compatibility and simplify setup.
[Magisk] zdoe:
i'll be eagerly waiting... :)
[Magisk] Paleskin:
Great, so in the future we could just tap move app into sdcard without editing any config file manually?

Like in the xinternalsd's gui?
[Magisk] Casserole:
Would it be possible to automatically mount LUKS encrypted partitions using keyfiles?
[Magisk] VR25:
Yes

Not yet, but you can do something like part /dev/block/mmcblk1p2--L,KEY /mnt/mmcblk1p2, so that the key is stored in /data/adb/fbind/config.txt - which is in device-encrypted (DE) storage.
[Magisk] the gladiator:
I'm on Oreo with Magisk 8.1, I have a line in config with "permissive" and the bind for the "camera" folders works well; but... if I try to copy a file in the "camera" folder in the internal memory with a file manager (i.e. ES File Explorer) a pop-up shows up asking to choose "the root directory internal storage(/storage/emulated/0) of ext-SDCard to grant ES permission to operate" . The sentence is a counter sense (please note the words in bold) and the only way to exit the loop is to click "cancel".

How could I avoid the pop-up ?
[Magisk] VR25:
That's likely a permission issue caused by excessive security.

...Or ES could be confused.

Have you tried fbind -f?
[Magisk] Walker Street:
I'm on pie on my galaxy tab S4, with magisk 19.1. Mounting loop back devices appears to be broken. I'm using the latest fbind. I get the message /sbin/imgtool is missing. Can we patch this or is this a magisk problem?

regards,

Dan
[Magisk] VR25:
It's an issue introduced by Magisk. I'll be implementing alternatives to /sbin/imgtool.
[Magisk] Walker Street:
Thanks for clarifying this. Would I be able to mount an ext4 loop device as /data/app since the permissions could be retained if I moved all my user apps on to the loop device?

Regards,

Dan
[Magisk] VR25:
Alright, that must be another Samsung exclusive issue. For now, don't worry about it.

Is obb binding working fine too?
[Magisk] koko115:
Yes. Obb is ok.
[Magisk] VR25:
[MENTION=4715235]koko115[/MENTION], do you see that "extra" sdcard when using a different file manager?
[Magisk] legionpr:
Hello a question as you use the module and I have it installed but I do not know how to pass the data the memory card is copy and paste into the memory card?
[Magisk] VR25:
If you already set up your bind list, run "fbind_move" as root in a terminal emulator to move your data with one click. The module automatically installs the app "Termux" for that. This should be much simpler than moving your data manually. I'm open to answer any questions regarding how things work, but you must read the entire OP before I can help you.
[Magisk] Captain_Throwback:
When I first installed the module I was confused by this, so you may want to clarify that the module has to be installed and initialized first, before you can use "fbind_move". I had installed it through Magisk Manager and then went to set up my fbind_list.txt, but fbind_move won't work until after you reboot, so I had to comment out all of the changes I made to the list until after rebooting.
[Magisk] VR25:
When I first introduced fbind_move, it had a terrible flaw that kept it from working as intended. The system had to be rebooted for it to work but then it wouldn't be able to move files because at that point, folders were already bound. I quickly solved that problem but forgot to include the fix notice in the changelog. The info on how to use has been on the "Quick Reference" section since the beginning though. Anyway, I should've paid more attention to that... my bad.

At a glance, here's how and when it's used:

1. Install the module

2. Set up your bind list

3. Run fbind_move

4. Reboot

Or... in case you've forgotten to move files before rebooting, run the following sequence of commands:

1. fbind_unbind

2. fbind_move

3. fbind_bind

Next job is merging these three scripts into a single, smarter one to make things even easier. :)
[Magisk] vikasb32:
So latest verison working fine ?
[Magisk] darkknight1812:
Destroys Magisk

Every time I install this module, my phone will boot up fine, and Magisk will work for a few minutes (root and app). After a few minutes the Magisk app says Magisk is not installed and I lose root access. The only way for me to fix it is to quickly delete the module in the Magisk app and reboot.

Info:

LG V20 H918

Android 7.0 (Stock rom and kernel)

Encrypted Data Partition

Magisk 13 beta (54e6a79)

Looking at the scripts, I notice that there is supposed to be a log at data/media/0/fbind.log but it does not make it that far as there is no log. The module installs fine in recovery, and I am able to view the contents of the magisk image confirming that the module has been installed. Let me know what information you need and I will try to get it.
[Magisk] Yeti47:
Thanks, works great on my Samsung Note4 N910C, just had to tweak your service.sh file to change the intsd directory and also allow directories with a space in to mount (e.g. 3Mint Downloads):

intsd=/storage/emulated/0

function from_to {

if [ ! -f "$extsd/$2" ]; then

echo "Checking/creating path $extsd/$2..."

mkdir -p "$extsd/$2"

fi

echo "Binding $intsd/$1 to $extsd/$2..."

$bind "$extsd/$2" "$intsd/$1"

}
[Magisk] American_Jesus:
Cant use that commands from adb

# fbind_move
/system/bin/sh: fbind_move: not found
[Magisk] VR25:
[MENTION=5284825]darkknight1812[/MENTION], this may be due to one of two things (or both) -- encryption and Magisk v13 Beta. I'm betting my two cents on the second, though. Not sure how the module could break Magisk. I would like to take a look at your Magisk log.

Nice, you actually reminded me of a forgotten issue, thanks!

I'm curious about the following, though -- why would you change your $intsd to /storage/emulated/0? Is that the primary path to internal storage on your device as opposed to the standard /data/media/0?

From version 2017.6.25, you use "fbind -m" instead.
[Magisk] Yeti47:
Yes it is, mounts to the other location are not seen. Has been that way on all the Marshmallow roms I've flashed.
[Magisk] VR25:
v2017.6.25-1 is up!

Changelog is on post #2

Also check post #3 for instructions on how to use the helper script on terminal emulator. You'll love it at best and like it at worst, as it'll make your life much easier. Guaranteed!
[Magisk] Yeti47:
Had a think about automating it and this is an easy way that should be fairly safe for most roms:

intsd=`realpath /sdcard`

Works for me ☺️
[Magisk] VR25:
Just a quick update -- I found a way to automatically recognize that and make the necessary changes to service.sh upon installation. I need more information from you though.

Do the paths /data/media/0 and /data/media/obb exist on your device? If so, are these actually linked to the internal storage or just placeholders?

Update: I just saw your recent post. The reason why I didn't pick that path by default is to avoid possible permission issues and potential bind errors, since that's usually not the primary path to the internal storage.

Update 2: your new approach has the potential to work universally. I'll test that. :)
[Magisk] Yeti47:
They both exist and are real paths and not symlinks that go to the expected dirs. But if used for -o mounts they are not seen by the system which expects the /storage/... location.

Note that realpath will search up the symlink chain till it finds the true physical mount point. In my case it sets intsd to /storage/emulated/0. So all mounts then work fine with no permission errors. Try it...

Looks like we are both replying to each other in our posts ?
[Magisk] VR25:
True, Lol

Yup, I just finished some basic testing -- that may work.

There's that other issue of duplicated sdcard on Samsung GS8. This approach might as well be the answer to it.

You nailed this sh*t! :highfive:

Update: on some devices (including mine) this doesn't work. I found another way & am currently implementing it.
[Magisk] VR25:
Massive update -- version 2017.6.26 is up!

Please, READ the changelog and fbind command tutorial before installing.
[Magisk] iroshan:
Non of the versions didn't work for me. I'm on Samsung mm 6.0.1. magicx 13.

The link folder becomes what look like a file and when I clicked it on solid explorer "requested file cannot be found”

Thanks for the great work.
[Magisk] the gladiator:
Just to add additional info hoping that could be useful for you to understand what is going on:

- ES and MX Explorer could be "confused", stock Huawei File Manager is not "confused" and works flawlessly

- the command fbind -f doesn't make any difference BUT I noticed that after giving the command in Termus I receive "setenforce: Couldn't set enforcing status to '0': Invalid argument"; after that sentence I have also "(i) Force FUSE: no" or "(i) Force FUSE: yes" as the command works as a toggle.

- in the ES home (image attached) the internal memory and the bound internal folder are shown; the SD card is missing
[Magisk] Walker Street:
Busybox NDK magisk module by osm0sis has nice support for mounting ext4 img files as loop devices:

su

busybox mount - o loop loopback.img loopmountpoint

busybox losetup -a

This doesn't set up anything permanent though.

I need fbind to mount and bind them at boot. Maybe even the /data/app folder could be the mount point and then I could keep its contents in an IMG file on my micro SD card. Do you think that's possible?