yashsingh1/xdaforums huggingface dataset:
[Magisk] diimaan:
Whenever I run the command

su -c fbind -s

I get the fbind usage with argument. So I am not sure whether the command got executed or not.

My config.txt was empty so I added the following

from_to DCIM .fbind/DCIM

from_to Pictures .fbind/Pictures

from_to WhatsApp .fbindWhatsApp

Then ran su -c fbind -M and su -c fbind m

The folders got created in my external but the files in both internal and external were empty. I lost the files from my internal storage. :(

And sorry for being blunt, could anyone share their config.txt :confused:

when I ran fbind -l it showed this

defaultRuntime=/mnt/runtime/default
extobb=/mnt/runtime/default/0000-0000/Android/obb
extsd=/mnt/runtime/default/0000-0000
interactiveMode=true
intsd=/mnt/runtime/default/emulated/0
modData=/data/media/fbind
modPath=/sbin/.core/img/fbind
obb=/mnt/runtime/default/emulated/obb
[Magisk] VR25:
Did you get any errors after running the commands?

Can you see your files again after running fbind -u?
[Magisk] diimaan:
It did not show any errors, it showed moving and end.

I did not run fbind -u. But I flashed the fbind from twrp to disable and then uninstalled it from magisk. Now I got all my files back.

Did I do anything wrong with the config?
[Magisk] The_Walking_Playground:
Hi,

Once I mount the folder using fbind, the gid isn't changing when I run those commands. I'm not exactly sure why, though :confused:. But I assume that's part of the problem too.

TWP
[Magisk] otyg:
I added that in the config and it seems to mount, however most apps still cannot detect/use the obb files (ie: app properties only show like 54m storage used), I checked /data/media/obb and it reflects my internal storage obb rather then the sdcard obb same with /storage/emulated/0/Android/obb/ .

looking at logcat I think apps are looking for obb(s) in /storage/emulated/0/Android/obb/ & /data/media/obb , even though fbind is mounting '/mnt/runtime/*/emulated/obb" , somehow its not populating /storage/emulated/0/Android/obb/ so I am not sure how to get this working, if I mount to /storage/emulated/0/Android/obb/ the phone reboots so very strange
[Magisk] wstephen:
Magisk 18 Support

Tried to install fbind 2018.11.2, fbind 2018.12.4, fbind 2018.12.7 using TWRP and Magisk Manager (Magisk v18.0), but the installations failed. :eek:
[Magisk] wynadii:
Hello sorry for interrupting

Im trying the new version of fbind module, but im getting this error

My file not moving to my .fbind folder, i cant bind my folder with fbind -b, error showed like picture im attached. Include log, and config.txt.

Tell me if i do something wrong. ThanksView attachment 4664239View attachment 4664241
[Magisk] czecx:
[MENTION=5228676]VR25[/MENTION]
[Magisk] VR25:
**2018.12.12 (201812120)**

- General fixes and optimizations

- Improved bind-mount algorithm, multi-user and SDcardFS support.

- Minimum Magisk version supported is now 17.0.

- $modData is now /data/media/0/fbind/ (formerly /data/media/fbind/).

- Updated documentation

[MENTION=5827441]wynadii[/MENTION], commands changed.

fbind --move (or -M) and fbind --mount (or -m) are what you want. The combination is fbind -Mm. Please, read the documentation.
[Magisk] The_Walking_Playground:
Hi [MENTION=5228676]VR25[/MENTION],

Thank you for the update; however this version seems to not be working properly. My internal storage bind mounts are showing up blank in Solid Explorer (though the files are showing up in the default file manager), and I'm unable to save files to a bind mounted folder (similar to the issue I already have for secondary users). I tried specifying an extsd_path to see if that would help, but seemed to make things worse - the log (attached) seems to have errors in it where it's calling to busybox binary. Is there any other log I can grab for you before rolling back to the previous version?

TWP

EDIT: I just looked at the "mount" output and now it seems that all of the mounts are getting mounted using the vold reference now. Is there a way to revert that and get the secondary users to use the previous setup (where it shows /mnt/media_rw/* instead)? That seems to be the key for having the correct permissions for accessing everything, at least on Pie.
[Magisk] czecx:
Have installed this update right now and nothing changes for me.

I have created a line on config.txt:

from_to xdiagpro .fbind/xdiagpro

Than have rebooted a phone. I have checked the xdiagpro folder on intsd and it was empty with access denied message.

Log file is attached.

What I do wrong? Please help me.
[Magisk] VR25:
December 12's build has been working fine for me.

My SDcard's filesystem is EXT4. It's mounted with journaling disabled and "noatime".

I'm on LOS 14.1 (harpia).

Either my system/SDcardFS or SDcard filesystem allow everything to work smoothly... or I'm missing something.

...Perhaps SDcarsFS version is to blame.

Anyway, I'll see what else can be done at this point.

Meanwhile, those who are reverting to the previous build, keep in mind that /data/media/0/fbind/ must be moved back to /data/media/ for compatibility.
[Magisk] MrMmmkay:
[MENTION=5228676]VR25[/MENTION]

Same problem with .12 Version, see logs under https://xdaforums.com/showpost.php?p=78343436&postcount=1299
[Magisk] otyg:
[MENTION=5228676]VR25[/MENTION]

I still can't get the obb folder working without crashing the device, but I did manage to bind other folders successfully with read/write access, with the latest version I can also install it through Magisk Manager without it hanging on extracting modules

//I think in the end it needs to use the /mnt/runtime/* folder for the ext sdcard so it gets mounted as sdcardfs which allows the remount option to work with the mask/gid option

mount --rebind /mnt/runtime/default/0000-0000/DCIM/ /mnt/runtime/default/emulated/0/DCIM/

//without remounting it it was getting permission denied for non root users

mount -o remount,gid=9997,mask=6 /mnt/runtime/read/emulated/0/DCIM

btw if I try to remount the write or default directory phone reboots, but just doing the read one seems to be enough for apps and file-managers to access it.

Update

Ohh update I got the obb folder to mount

mount --rebind /mnt/runtime/default/0000-0000/Android/obb /mnt/runtime/default/emulated/0/Android/obb && mount -o remount,gid=9997,mask=6 /mnt/runtime/read/emulated/0/Android/obb

however this just handles the /storage, /sdcard, /runtime folders, /data/media/obb does not reflect the update so perhaps this might need another mount, will see how apps react without this mounted / so far many games are working and can read the obbs!
[Magisk] xtam:
ok, it works for system builded in file manager.

In samsung, my files, i can access this .../emulated/0/rclone.

But fx file manager, user installed sees only /mnt/rclone

/emulated/0/rclone is empty for it, why ?
[Magisk] The_Walking_Playground:
Hi [MENTION=5228676]VR25[/MENTION],

I think the key may be the different versions of Android on which we're running the module. This, combined with the additional complexity of sdcardfs seems to be problematic. No worries though; the previous version works fine. I even added the "prefix" variable to the older core.sh so I didn't have to change my config.txt. I also added an additional "extsdmedia" variable which points to /mnt/media_rw/* for use in my secondary user bind mounts. This at least allows me to see the folder contents, even of I can't save to them on the secondary accounts. Thank you for all your hard work on this. It's really appreciated. I'm sure we'll figure it out eventually.

TWP

EDIT: Also my external SD card is formatted as exfat. I think that makes a big difference here if yours is formatted ext4. The FAT-based file systems have way more limitations than the Linux-based formats. I think most people would be using a FAT-based format with this module, though - is that something you can test, [MENTION=5228676]VR25[/MENTION]?
[Magisk] VR25:
We're on the same page and getting somewhere!

We'll talk more about this after the next build is up. I have new ideas.

So far, I believe group IDs, masks, which paths to mount and which to exclude are the things to play with.

___

The stock file manager (files) behaves differently. Bind-mounts which works for it don't necessarily work for other apps. However, some apps (i.e., FastHub) behave just like Files. Likewise, obb bind-mounts need extra salt and perhaps some vinegar too.

I'm working on the next build. We'll get this sorted out. Thanks for the awesome reports, guys!
[Magisk] The_Walking_Playground:
Hi,

The thing about the FAT-based systems is that the gid it mounts with isn't changing when doing a remount. Those are also the mounts that show up with the vold reference rather than the media_rw path. I think that is part of the issue. I thought it worked with FUSE though, and potentially on older Android versions. So maybe this is a recent change, or we just haven't figured out how to change the gid for a FAT-formatted device? Maybe if you can add some additional debugging to the next version, or at least a way to enable more verbose logging and other information you need, it'll help?

TWP

EDIT: One more thing - when I run "fbind -i" and it shows me my config.txt and the status of my mounts, the bind mounts I have set for my secondary users all show "UNMOUNTED". Could that also be a problem?
[Magisk] VR25:
[MENTION=8756890]The_Walking_Playground[/MENTION], I removed the gid mount option altogether. It's working. SDcardFS automatically sets the correct gid. I didn't take a look at the secondary user yet, though.

I'll will check the second issue.

Thanks

[MENTION=5207466]otyg[/MENTION], your system reboots when you attempt to remount the default or write paths... but does that apply to any folder pair or just obb?

Thanks

P.S., remounting only "read" doesn't work for me.
[Magisk] otyg:
yeah if I attempt to remount the default or write path on any mount it will lock/reboot.

also if I don't remount the read one then no apps can see the bind points (ie mixplorer will say not exits, or if i 'ls' the bind point it will say permission denied).
[Magisk] cLeAv0:
I'm having problems with the module. Trying to bind obb. I see some obb files in the $obb path and even on /data/media/obb but after a couple of seconds the files disappear and gets unmounted when i try fbind -i. Does this module need permissive selinux? Also using android 9
[Magisk] xtam:
ok but could you tell me while stock file manager can access this /mnt/runtime..../rcm

inside normal /emulated/0/rcm

but other apps cant?

Even, when i convert some app like es file explorer to be system app - still can not, why?
[Magisk] VR25:
**2018.12.14 (201812140)**

- [SDcardFS] Do not remount /mnt/runtime/write

- [SDcardFS] Do not set gid

- [SDcardFS] obb=$intsd/Android/obb

[MENTION=3940257]cLeAv0[/MENTION], [MENTION=3525574]xtam[/MENTION], I'll get back to you later.
[Magisk] xtam:
tested in this version with fuse (-f) after restart and also without (-f restart again)

also doesnt work.
[Magisk] VR25:
[MENTION=3940257]cLeAv0[/MENTION], permissive SELinux may not be necessary. Try today's build.

[MENTION=3525574]xtam[/MENTION], always run rclone as /sbin/su -Mc rclone <opts> <args>.

Try different paths:

In FUSE mode

- fbind may not be needed.

- Mount rclone directly to /data/media/0/rclone.

SDcardFS

- Mount rclone to /data/rclone. Make sure the mount point has 777 permissions.

- Run fbind -b /data/rclone /mnt/runtime/default/emulated/0/rclone.

- You may need permissive SELinux.
[Magisk] xtam:
yeah, it works great without fbind,

rclone mount drive: /data/media/0/rclone/

or even

rclone mount drive: /data/media/0/Download/rclone/

is working.

Now every app can see this mounted folder without even root.

Thank you.

edit:

sorry, i need fbind, i had it mounted previously.

so my working configuration is:

rclone mount drive: /data/media/0/rclone/

fbind -b /data/media/0/rclone/ /mnt/runtime/default/emulated/0/rcloneM/

and this rcloneM is available for all apps.
[Magisk] VR25:
[MENTION=2904647]Xtan[/MENTION], I'll add native support for rclone then.

By the way, you got it working on SDcardFS with the fbind -b command, right?
[Magisk] cLeAv0:
Tried new build. Mount sticks but i don't see any files on $obb path using amaze file manager but my one game loads just fine now having the obb on $extobb path. Will try out installing other games. Do i need to unmount then move/mount new obbs first or just leave it mounted as it is?

*edit*

I stand corrected, it unmounted automatically again after a couple of minutes. And doesn't detect the obb while unmounted. But while mounted everything works fine.

*another edit*

It seems accessing the files unmounts it. Will test not viewing $obb path anymore.
[Magisk] xtam:
i didnt received your "mention" because its xtaM not xtan.

WOuld reply faster, yes, fbind -b (force fuse is off)
[Magisk] The_Walking_Playground:
Hi [MENTION=5228676]VR25[/MENTION],

This version behaves similarly to the 12/12 version, where my bind-mounted folders show up blank for the primary user. For secondary users, however, the bind-mounted folders aren't even viewable in the default File Manager. I will be rolling back to my modified 12/7 build for now. I'm attaching the output of "fbind -i" and "/proc/mounts" along with the fbind log. Hopefully this will help with troubleshooting. Just let me know if you need me to flash back and test something specific for you.

TWP
[Magisk] czecx:
After last update I get the same issue, the app wouldn't start with mounted folder. The app crash after try to open it. What is wrong?

I use this line on config.txt

from_to xdiagpro .fbind/xdiagpro

Huawei P9 with 7.0 official rom.
[Magisk] Mase_sanchez:
below is the explanation on how can you achieve this, seems an issue with user right on android 9, im using lienage 16 on a Samsung j7 Prime and this work just fine for me,

note that you should respect the capitals on the folders i had issues with whatsapp because i was using the command whatsapp instead of the proper folder name "WhatsApp".

follow this:
[Magisk] xtam:
[MENTION=5228676]VR25[/MENTION]

there is some bug in current laest fbind,

on termux when i type fbind previously there was help text, now there is nothing, like only 2 black lines.

look:

screen recorded

and when this happens fbind doesnt work and doesnt mount anything.

It happens when my phone shows me notification that my externalsd card (sandisk, manually added) is corrupted.

Sometimes it happens and i have to remove it and insert again.

And after that fbind works fine.

But why fbind is dependent on external microsd card? i am not using it in fbind for any purpose.
[Magisk] VR25:
Hi xtam,

That's not a bug, actually.

fbind expects extsd to be set. After all, its original purpose has always been bind-mounting folders from $extsd to $intsd.

Adding extsd_path $intsd to your config will make fbind happy again.
[Magisk] VR25:
**2018.12.15 (201812150)**

- [SDcardFS] Additional variables for config.txt: extsd0=/mnt/media_rw/SDcardName, extobb0=$extsd0/Android/obb

- [SDcardFS] Do not remount /mnt/runtime/(read|write)/... if $extsd doesn't start with /mnt/runtime/.

- [SDcardFS] Remounting /mnt/runtime/write/... may cause a system reboot. If this happens, go to recovery terminal and run echo noWriteRemount >>/sdcard/fbind/config.txt.
[Magisk] The_Walking_Playground:
Hi [MENTION=5228676]VR25[/MENTION],

Thank you for the update. This version works as well as the 12/7 version for me. Thanks for adding the extsd0 variable as well. I'm using that for my secondary users folders. I still can't write to the bind mounted folders on my secondary user accounts and they still show up as "UNMOUNTED" in the "fbind -i" output. But for now, this is fine.

TWP
[Magisk] jbradshw:
So my config also broke with the latest updates. I'm currently on the latest version (2018.12.15) and based on the last few comments I edited my config.txt file and added the first two lines:

extsd0=/mnt/media_rw/0000-0000

extsd_path $intsd

from_to TitaniumBackup .fbind/TitaniumBackup

from_to Music .fbind/Music

from_to DCIM .fbind/DCIM

from_to Pictures .fbind/Pictures

from_to Download .fbind/Download

from_to Ringtones .fbind/Ringtones

But I see this in the log:

+ from_to TitaniumBackup .fbind/TitaniumBackup

+ bind_mount /data/media/0/.fbind/TitaniumBackup /data/media/0/TitaniumBackup

+ is_mounted /data/media/0/TitaniumBackup

It looks like it's mounting internal to internal. How should I change my config so it uses my external instead?
[Magisk] VR25:
[MENTION=8756890]The_Walking_Playground[/MENTION], did you try FUSE (fbind -f) with bind_mount $extsd/someFolder /data/media/11/someFolder, where 11 is a secondary user?

[MENTION=3286329]jbradshw[/MENTION], you got that wrong. Remove & forget the first two lines and you'll be good.
[Magisk] The_Walking_Playground:
Hi,

Fuse isn't supported on Pie (at least not on my device). I'm pretty sure it isn't natively supported on any devices in Pie, and would need to be backported. Unless you're saying there's a fuse driver included in fbind?

TWP
[Magisk] jbradshw:
Ok I guess your latest version fixed whatever broke. I removed the lines I added and all is good. Thanks!
[Magisk] VR25:
[MENTION=8756890]The_Walking_Playground[/MENTION], I guess only legacy kernels support FUSE, then.

fbind doesn't bring it back.

There's one more thing you can try atm...

Mount your SDcard with fbind instead of vold/SDcardFS:

part /dev/block/mmcblk1p1 /data/media/0/.sdcard

extsd_path /data/media/0/.sdcard

Use the following syntax for secondary users:

bind_mount $extsd/someFolder $intsd/someFolder

Notes

- mmcblk1p1 is an example. Change it if necessary.

- The mount point is a hidden folder to prevent duplicate media.

- You may see "corrupted SDcard" notification. That just means system couldn't mount it because fbind did that already. Obviously the regular SDcard mount points won't be available; /data/media/0/.sdcard will be the only one.
[Magisk] otyg:
just a quick update, so far so good with latest, working good on my system.
[Magisk] MrMmmkay:
Hi again.

Just tested the .15 version, same problem (see attachments), 11.2 is the last working version for me.
[Magisk] beelzebubbie:
Thanks for the great module, at first. But still have a question:

How can I provide mount options for the part subcommand? E.g. part [-o mount_opts_list] /dev/block/mmcblkXpY /some/path?
[Magisk] VR25:
[MENTION=403684]MrMmmkay[/MENTION], is your data encrypted?
[MENTION=5995827]beelzebubbie[/MENTION], you're welcome. What an interesting question! With that, I could mount tmpfs... ?

Current versions don't support extra mount options. The next version will.

I'm curious... which extra options would you use?
[Magisk] MrMmmkay:
Yes on the XZ1 Compact the data is decrypted by default.
[Magisk] beelzebubbie:
My ROM actually supports only vfat/exfat for an external sd, f2fs can't be mounted at all (though present in /proc/filesystems), so I've made additional hidden (otherwise sdcard is «need to fix») partition and made ext4 on it. The sane non-default opts at least are nosuid,nodev,nodiratime; maybe some jounaling tweaks too.

BTW, this part mount isn't persist after reboot (though it mounts when I manually run fbind -m). Is it indended behaviour?
[Magisk] ArcherTanu:
For me from last update mountinh isnot working any more..

Here is my Confi

obb

from_to Download .fbind/Download

from_to WhatsApp .fbind/WhatsApp

from_to Pictures .fbind/Pictures

from_to DCIM .fbind/DCIM

---------- Post added at 07:26 PM ---------- Previous post was at 07:09 PM ----------

Same problem yar broke everything.
[Magisk] gladalone:
I wrote in my config.txt file only one line:

from_to foldtest .fbind/foldtest

I created the folder foldtest in the internal memory and folder .fbind/foldtest on the SDcard. I restarted the phone.

I tried to add a file in the internal folder (foldtest) but this has not been mirrored in the folder .fbind/foldtest on the SD card.

Am I doing something wrong ? I have an android 7 and emui 5.0.

I know I'm not giving you lot of information but...I'm lost: if you need something I'll be more than happy to provide it to you.

PS I noticed that I now have a number of sub-folders in the proc folder named with a number from 1 to 7030

PPS and I cannot delete them nor with a file manager neither from TWRP !!!!!!
[Magisk] VR25:
**2018.12.24 (201812240)**

- [General] Fixes and optimizations

- [General] modData=/data/adb/fbind to bypass FBE (File Based Encryption). Config survives factory resets if internal storage (data/media/) is not wiped.

- [General] Updated documentation

- [part()] Automatic LUKS decryption (`blockDevice--L,PASSPHRASE`, optional)

- [part()] Support for extra mount options (part -o <mount opts> <block device> <mount point> <fsck command (e.g., "e2fsck -fy"), optional>

Most of the recently reported issues deal with FBE (File Based Encryption). While that's a security measure, on the flip side, it's also a pain to deal with. Fbind must wait until data is decrypted. That's counterproductive. I'll patch more stuff if the problem persists. Keep the reports coming.

[MENTION=9638320]gladalone[/MENTION], don't touch /proc/. Folders in there are not created by fbind and you don't want to mess with them! Google what /proc is if you're curious enough about it.
[Magisk] VR25:
Alright, I removed post-fs-data.sh, added back system.prop and set this up in the update-binary:

# Check for "sdcardfs force_on"
sdfs=`grep_prop persist.sys.sdcardfs`
if [ "$sdfs" = "force_on" ]; then
sdfs=true
fi

# prop files
if $PROPFILE && $sdfs; then
cp -af $INSTALLER/common/system.prop $MODPATH/system.prop
fi

Everything is fine now.
[Magisk] Captain_Throwback:
Just installed the 6/21-1 version, and that prop is still getting set :(.

This screenshot is from the device that isn't using sdcardfs.

I installed the module through TWRP.

EDIT: Here's the recovery log from the flash:

Installing zip file '/external_sd/.fbind/Download/Magic-Folder-Binder-v2017.6.21-1.zip'
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Update binary zip
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.
Archive: /external_sd/.fbind/Download/Magic-Folder-Binder-v2017.6.21-1.zip
inflating: config.sh
Archive: /external_sd/.fbind/Download/Magic-Folder-Binder-v2017.6.21-1.zip
creating: common/
inflating: common/file_contexts_image
inflating: common/service.sh
inflating: common/system.prop
inflating: module.prop
*******************
Magic Folder Binder
VR25 @xdadevelopers
*******************
******************************
Powered by Magisk (@topjohnwu)
******************************
- Mounting /system(ro), /vendor(ro), /data, /cache
- /data/magisk.img detected!
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/data/magisk.img: 534/8192 files (1.3% non-contiguous), 50046/65536 blocks
- Resizing /data/magisk.img to 256M...
resize2fs 1.42.9 (28-Dec-2013)
The filesystem is already 65536 blocks long. Nothing to do!

- Mounting /data/magisk.img to /magisk
- Copying files
Archive: /external_sd/.fbind/Download/Magic-Folder-Binder-v2017.6.21-1.zip
inflating: README.md
Archive: /external_sd/.fbind/Download/Magic-Folder-Binder-v2017.6.21-1.zip
inflating: fbind_move
unzip: can't change directory to '/data/app/Termux.apk': No such file or directory
chmod: /data/app/Termux.apk: No such file or directory
- Setting permissions
- Unmounting partitions
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/data/magisk.img: 533/8192 files (1.3% non-contiguous), 50045/65536 blocks
- Done
I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 1 second(s).
Updating partition details...