yashsingh1/xdaforums huggingface dataset:
[Magisk] VR25:
**2018.11.2 (201811020)**

- Advanced <modPath> detection (more future-proof; trashed hard-coding)

- Always run under <umask 000> to prevent permission issues.

- Fixed <patch_config.sh not working>.

- Universal SDcardFS support (experimental, new algorithms), must be enabled manually with <su -c fbind -s> (toggles SDcardFS mode).

Notes

- "Universal" actually means - for the two distinct SDcardFS behaviors I've noted so far. These are precisely what f-up bind-mounts.

- Unmounting these bind-mounts with <fbind -u> is not supported yet. I'll implement that only when user reports on SDcardFS handing are mostly positive.

- Unless you've uninstalled the module, <fbind -s> command is needed only once. In other words, its effect is persistent across updates. This command lets you switch between FUSE and SDcardFS modes. A reboot is necessary to apply changes.

[MENTION=8756890]The_Walking_Playground[/MENTION], this is working for me. You may want to try it!

[MENTION=5765352]TechnoSparks[/MENTION], in addition to bind-mounting folders under the read and write runtimes, I had to remount these afterwards. Now I have read and write access to the folders and files, as a regular user. Below is part of the code responsible for this achievement.

alias mount="/sbin/su -Mc mount -o rw,gid=9997,noatime"

if $SDcardFSMode && echo "$1 $2" | grep -q $defaultRuntime; then
mount -o rbind \""$1"\" \""$2"\"
mount -o remount,mask=6 \""${2/default/read}"\" 2>/dev/null \
|| mount -o rbind,mask=6 \""${1/default/read}"\" \""${2/default/read}"\" \
&& mount -o remount,mask=6 \""${2/default/read}"\"
mount -o remount,mask=6 \""${2/default/write}"\" 2>/dev/null \
|| mount -o rbind,mask=6 \""${1/default/write}"\" \""${2/default/write}"\" \
&& mount -o remount,mask=6 \""${2/default/write}"\"
else
mount -o rbind \""$1"\" \""$2"\"
fi

With this rogue strategy, stubborn mask values finally change to 6!
[Magisk] The_Walking_Playground:
Hi [MENTION=5228676]VR25[/MENTION],

Great job on the new release. Sdcardfs finally seems to be working with bind mounts! I have one problem, though - I use a multiple user setup on my device, and with the bind_mnt command, updated to use 'mnt/runtime/default/emulated/{user}' as the bind mount paths for the secondary user, the folders show up as mounted, but appear empty. Could this be an access and/or SELinux limitation? I know the external storage is not typically accessible for secondary users, so maybe that's the issue here. Is there anything I can do UK help you troubleshoot this issue?

TWP
[Magisk] VR25:
Are you using bind_mnt $defaultRuntime/<SDcardSN>/<folder> $defaultRuntime/emulated/<user>/<folder> syntax?

Could you upload /proc/mounts after bind-mounting? Thanks.
[Magisk] The_Walking_Playground:
Hi,

In config.txt, I'm using the standard bind_mnt $extsd/folder $defaultruntime/emulated/<user>/folder syntax, which according to the log, is mounting at the correct locations. I just checked again, and it turns out there's some issue with Root Explorer where it doesn't want to open the bind mounted folders in /storage/emulated/<user> unless I first navigate to the folder through $defaultruntime/emulated/<user>. Then it seems to work fine. Sorry for the false alarm - it does appear to be working correctly now for all users. Fantastic work!

TWP

EDIT: Actually, if I use the stock "Files" app to try to navigate the storage, I get the attached screen. So maybe it is an access or SELinux issue after all.

EDIT 2: And with Pictures folder being bind mounted, Screenshots won't save, so definitely still an issue. Will attach proc/mounts output shortly.

EDIT 3: Added proc/mounts output and screenshot I tried to add from first edit, but had to remove that bind mount and reboot first for it to save.
[Magisk] TechnoSparks:
Dropping in to say awesome release!! hopefully this won't haunt us in the future! :D
[Magisk] Dark_Phoenix004:
I'm using

bind_mnt $extsd/My_downloads /data/media/0/MC/sdcard

This command to mount the external sd inside my internal sd.

But when I do that,I can't access it from normal internal storage.

The sd card is being mounted.But only inside /data/media/0/Mc....

If I access the internal storage from normal file manager,the mounted files aren't being shown.

Also when I try to unbind the directory using fbind -u it's still mounted and I can only unmount it via reboot.

Any solutions pls?

I'm using MIUI 10.0.2 stock global stable version in Redmi note 5 pro whyred.

Android 8.1

Magsik 17.1
[Magisk] VR25:
Interesting... ?

According to /proc/mounts, everything was mounted as expected, with desired masks and group IDs.

Does this happen with <user 0> too?

Does <su -c setenforce 0> fix the problem?

If it wasn't for yet more "inconvenient" security measures introduced with SDcardFS, everyone would've been happy since day one! We wouldn't have any trouble with bind-mounts. :highfive:

First, don't use hardcoded paths. In place of /data/media/0 use $intsd (for FUSE mode) or $defaultRuntime/emulated/0 (for SDcardFS mode).

But before changing anything, please upload your </proc/mounts>. Note that you have to do so after the mount above is up, so that I can see what went wrong.

After uploading the file, proceed as follows:

1) Run <su -c fbind -s>

2) Replace </data/media/0> with <$defaultRuntime/emulated/0>.

3) Reboot.

4) Upload the new </proc/mounts>.

Thanks
[Magisk] Dark_Phoenix004:
Thanks.

Changing into sdcardfs mode and using $defaultRuntime solved my problem easily. Although I think it needs setenforce 0

No I was thinking can I do automount during boot because I bound my WhatsApp folder with external storage. So if it doesn't auto mount,it might cause trouble.

Also can I mount a usb otg the same way into my internal storage or in /storage directory?

One more thing. Is there any terminal commands available? I mean all the commands I saw were to configure the config file. But if I want to execute a single command or 2 particular commands for bind or mounting,a direct terminal command could be helpful. Thank you.
[Magisk] The_Walking_Playground:
Hi,

It seems user 0 isn't working right either, so I think this is because of Pie's additionally restrictive SELinux. The ROM I'm on is already in permissive mode, so that isn't the issue. Anything else I can provide to help troubleshoot?

TWP

EDIT: Correction - I rebooted, and user 0 seems okay. It's not consistently working every boot, possibly due to timing issues. But for the secondary users, I definitely need root to see the folders initially, and then the user programs are unable to write to the folders (maybe because they're owned by the wrong user?). At any rate, let me know how I can help.
[Magisk] aryaherro:
any step by step?

or some example?video tutorial or something else..

confused after install then config.txt
[Magisk] VR25:
Why do you think it needs permissive SELinux? Have you came across any permission issues?

Folders are automatically bound on boot.

You can bind mount virtually any folder to almost anywhere. If you use /storage/<folder> as mount point, though, the path has to be created manually. This is because /storage is not writable, unless you run <su -c mount -o remount,rw /> first. Current fbind versions don't do that. Next versions will.

As for the commands, not sure if I understood what you meant. You can use <fbind -b pattern|pattern> to bind-mount configured folders on demand (i.e., fbind -b whats|DCIM|Downl, fbind -b docs). The same goes for fbind -u and similar options.

Yes, a timing issue may be to blame. I'll increase the SDcard wait timeout from 3 to 5 minutes. Your system may be taking longer than usual to mount it.

As for multi-user, I haven't tested this... did you say earlier that only <user 0> has access to the SDcard, even without fbind installed?

Thanks

Start by reading /data/media/fbind/info/tutorial.txt.
[Magisk] Dark_Phoenix004:
So, you're saying folders automatically bound during boot.

That means it binds the "config.txt" right?

So during boot all the folders will be automount.

Now if I don't want a folder to automount during boot but want to mount on demand,how can I do so?

Is there any path for usb? Like internal storage path is $intsd or $defaultRuntime and external is $extsd, similar for otg?

And 1 more problem. Unmount not working.

I tried the command fbind -u

But still all the folders I've mounted stays the same.

Only after reboot they restore.
[Magisk] VR25:
Yes, fbind auto-mounts folders listed in config.txt. You have two choices here: disable auto-mount for all folders or enable it. There's no "per folder" setting. This is a nice feature suggestion, though.

Use $defaultRuntime/<name> to refer to your USB storage.

Each storage device has a different <name>. You can see that in /storage/.

I've stated that <fbind -u> doesn't unmount folders in SDcardFS mode yet. Bind-mounting on SDcardFS is still new and experimental. The next release will support that, though.

Thanks
[Magisk] The_Walking_Playground:
Hi,

Yes, user 0 has access to SD Card in all cases. Secondary users cannot see the external SD card natively without root access. This may be the key to the issue I'm seeing with the secondary users unable to write to the bind mounted folders. I'm not sure what you can do to fix that. Hopefully that's something you can try and test/confirm locally.

TWP
[Magisk] VR25:
That's another Android quirk. It's a perfect example of "security" getting in the way. :rolleyes:

Unfortunately, if secondary users can't access the sdcard natively, more digging is necessary to make this work.

I'll prepare a shovel and a secondary user for the job.

Thanks
[Magisk] Dark_Phoenix004:
Thanks. This is what I was asking. Like make different config files for mount/bind or demand else make a shell command (like normal mount command) to bind/mount a directory.

Another thing. it's silly,but still can't do it. In android 6, I was using <mount -o umask=000 -t vfat /dev/block/sda1 /storage/usb> to mount my otg drive in /storage directory for all 3rd party apps to use. The command doesn't seem to work in oreo though...:( So what's the similar command for this config in fbind?:)
[Magisk] neromanello:
I think SManager Brick my device

Hi all, Just a disconnected post. I've using Galaxy S7 Flat + Magisk 17.1 + FBind from Magisk Download + SManager root boot script. When I use the MAX battery saving config, and then rebooted the cellphone on that mode, next the phone tried to boot and when it gets to Android, after 2 or 3 seconds asking for SIM password, it rebooted itself in an indefinitely ugy bootloop.

Trying to access the Recovery made it rebooting after showing the recovery screen, so it loops in an indefinitely bootloop. So, I tried to put ODIN mode (which entered OK but with Power LED always ON) and to re-flash Home-CSC partition, as I was on a hurry at 8 AM needing to leave. And after doing this, the cellphone was able to get into recovery mode normally (with key combo), but after powering it off, IT NEVER POWERED ON AGAIN. So it was a definitively BRICKED.

Thanks to I was blessed, the shop where I've bought the brand-new refurbished cell phone, its guarantee have taken it as a laboratory fail... bringing me another phone.

So, as my experiences, I'm far from this kind of practices for new Samsung phones...

I'm wishing you to have good luck with this!.

NOTE: FBIND has saved my internal storage files to my SD. I've saved my WhatsApp from being broken... NICE & Thanks!

And my Databases & KEY file (that BackupForWhatss saved) WAS SAVED TOO!!

So, if you are going to use SManager, PLEASE PAY ATTENTION TO THIS!!! Don't put a boot script, just put an icon with the script and take care. IF YOU ARE GOING TO USE SAMSUNG BATTERY SAVING MODE!!!!
[Magisk] aryaherro:
like this option?

can i move directly to sdcard not to .fbind folder?
[Magisk] VR25:
[MENTION=9538039]Dark_Phoenix004[/MENTION]

Syntax for mounting partitions: part <partition> <mount point>

Example: part /dev/block/mmcblk1p2 /storage/sd2

[MENTION=5440263]neromanello[/MENTION], that's very strange! I wonder what exactly triggered it. :rolleyes:

Do not specify <intsd_path> nor <extsd_path> unless you actually need these. Your config won't work. Remove those twos lines.

Omitting the .fbind folder works. However, since the data will be visible from both internal and external storages, that's not a good idea. If you have media on these folders, the files will duplicate. This behavior is entirely due to the nature of a bind mount -- which is essentially an alternate view of a directory tree elsewhere. In other words, <source> is a mirror view of <destination>. The dot preceding the fbind folder hides it, preventing media duplication.
[Magisk] aryaherro:
ok..

then

how if i want to automove ex : whatsapp folder..

like Xinternalsd in exposed..

sorry my bad english
[Magisk] VR25:
Run su -c fbind -mb
[Magisk] mashiro2296:
May i ask about having a problem with security ? I've successfully bind int and ext sd with this module but im having a problem in the access to my extsd. Ive tried doing a screenshot and show unable to screenshot and it says prevented by security policy. Help will be appreciated. Thanks.

I'm using samsung note 3 with custom rom and custom kernel. Running in 6.0.1
[Magisk] paranoid3aether:
Unable to use camera with this module enabled

When i enabled this module my camera stopped working. I tried many different things and realized that fbind was creating some problem. Plz help me how can i get the camera working.

Sdcard format : f2fs

Android pie on Motorola 3rd generation (osprey)

Custom rom : pyxis os

I get following error whenever i try to start the camera, with fbind module enabled

E/CameraService_proxy(2066): Calling UID: 1013 doesn't match expected camera service UID!
CameraService(11518): CameraService::connect X (PID 16080) rejected (cannot connect from device user 0, currently allowed device users: )
[Magisk] VR25:
Add intsd_path /storage/emulated/0 to your config, reboot and see whether it works.

Thanks

Run su -c fbind -s and reboot.

Thanks
[Magisk] MrMmmkay:
Hi there,

First thanks for you excellent work!

I still have the problem that I have to mount fbind manualy after every reboot (su fbind -b), what logs could I provide to help developing?

Phone is a Xperia XZ1 Compact with Android 8.0 Stock Rom.

Also Android 9.0 arrived these days for the XZ1 Compact, the only reason I didn´t update is that fbind will not work on 9.0, or am I wrong? Any plans to make it 9.0 compatible?
[Magisk] VR25:
Hi,

Hmm... that's odd. Are you using the latest version? I added something to go over that issue.

I need Magisk and fbind logs.

To grab Magisk logs, open Magisk Manager, go to the log tab, swipe left and press the "save" icon.

Get fbind logs from /data/media/fbind/logs/.

The latest version has experimental SDcardFS support and it has been reported working on Pie. After installing, you have to run su -c fbind -s to switch to SDcardFS mode.

Thanks, and you're welcome!
[Magisk] MrMmmkay:
Hi.

See logs attached, I am using the latest version.

Okay, than I will try to use Pie the next days, phone ist in daylie use, so it could take some time.
[Magisk] paranoid3aether:
I already enabled sdcardfsmode

Actually on android pie, fbind service scripts on magisk 17 messes with service uids and hence camera doesn't work because on 9.0 unallowed uids cannot access camera and even background services cant access camera.I had to remove 'wait' and 'wait_until_true' lines from the script and add the script to init.rc after on boot complete so that it runs after everything is mounted and not as service. And it worked like charm. Great work guys..
[Magisk] VR25:
Interesting...

The following could be a better solution then:

# wait until system has fully booted
until getprop sys.boot_completed | grep -Eq '1|true' \
&& grep -q /storage/emulated /proc/mounts
do
sleep 10
done

See if it works on Oreo after running su -c fbind -s and rebooting.

Thanks
[Magisk] MrMmmkay:
Hi,

Sorry, same problem, I need to run the command manually to get it working, see new logs attached.
[Magisk] VR25:
Install the attached zip from Magisk Manager, reboot and see how it goes.

Thanks
[Magisk] MrMmmkay:
Done (installed and rebooted), without effort, still need to load manually.
[Magisk] reckfield:
Same problem
[Magisk] 白い熊:
[MENTION=5228676]VR25[/MENTION] I'm running 2018.10.30.1 on Magisk 17.3 no problem. The latest 2018.11.2 demonstrates the same issue — messing up busybox, showing it as nonexistent. What's the difference there?
[Magisk] VR25:
Instead of running fbind -b to manually mount, see whether this works:

su
PATH=/sbin/.core/busybox:$PATH
sh /sbin/.core/img/fbind/service.sh

Have you tried mv /sbin/.core/img/fbind/system/xbin /sbin/.core/img/fbind/system/bin or vice-versa?

I'm curious to see whether this solves the issue.
[Magisk] 白い熊:
Actually, my bad — my memory failed me, there's a different problem: when trying to flash 11.2 it fails on the “Unmounting partitions” step. So I can't flash it. 10.30.1 flashes fine and then works.
[Magisk] McFlypants:
Hi,

I tried using it on Oreo 8.0 with Magisk 17.3 on my Moto Z Play:

Added the line "from_to TS3 .fbind/Teamspeak3" to the config.txt to test it with a folder that i don't really need first.

Now i used "fbind -mb" as SU in terminal: It says "moving data", then i get:

"rsync: mkdir "/mnt/media_rw/A1CD-1DF9/.fbind/Teamspeak3 failed: No such file or directory"

and

"rsync error: error in file I0 (code 11) at main.c(685) [Receiver=3.1.4dev]"

and

"(!) Source and destination data sizes don't match. Source data left intact".

Now both folders are empty (i understand that: the folder isn't copied but mounted). When i uninstall the module, everything is back to normal of course. But what is the problem? Wrong path of the SDcard? The name (A1CD-1DF9) and the path are right as i see it.
[Magisk] reckfield:
I got the same message , when you get this message. First dont change anything once you added into config.txt and after get the error message. I suggest that you should reboot the devices and then execute fbind -mb again

I think is due to the inestability of this version, so every modifications done to phone system, you should reboot before executing terminal commands

Please let me know if the problem persists
[Magisk] reckfield:
Finally I have solved the manual loading issue everytime when I have to reboot

But it's strange. I solved with a strange "maneuver", it is a kamikaze move on my xz1 compact lineageos 15.1

First. I run su -c and then fbind -s. This step brick my phone, I reboot the phone, every app barely works. So with difficultie I want to reverse the settings

After a several attempts to access Android terminal I managed to rerun su -c and then fbind -s. I turned to Fuse mode again

Reboot phone

My phone works again and then I run again

fbind -mb

Since then, everytime I reboot the phone it loads automatically

A fault on the right Side!
[Magisk] VR25:
[MENTION=5185421]McFlypants[/MENTION], this is a problem with rsync some users are experiencing. I'm removing this binary in favor of the good old cp. The upcoming version will be a major update.

Thanks

[MENTION=7466157]reckfield[/MENTION], how this got solved makes no sense at all! :p

Did you install/update anything between the trials?

The logs from earlier reports show no errors on either side (Magisk and fbind).

If this happens again, write set -x on the 5th or 6th line of /sbin/.core/fbind/service.sh, reboot and upload /data/media/fbind/logs/service.sh.log.

Thanks
[Magisk] McFlypants:
That is working for me, thank you!! But I'm still too scared to use it with an important folder like my whatsapp media. :D
[Magisk] reckfield:
Use google drive to backup whatsapp messages, afterwards proceed to move and bind. The handicap is every time you reboot the phone，probably you need to load manually again
[Magisk] LNQ:
First thank you for your work. Would be alot nicer if it worked for me, too.

So here is what I did:

Installed latest from Magisk manager, rebooted.

Then I added from_to Musik .fbind/Musik and did the fbind -mb. Here is a pastebin of what happened (the .fbind folder was created by me beforehand. Not as root though).

Both folders contain the files now and when I fbind -u, they still do. I don't think this is expected behaviour.

fbind log crashes silently, and the logfiles in /data/media/fbind are pretty much unaware of any of these doings.

I own a Galaxy S8, SM-G950F. Oreo 8.0, Magisk 17.3. near-stock ROM, just heavily debloated.

If I can provide further information, please feel free to request them.

And before you ask, no non-unixoid operating systems were involved in any of these steps. ;)

Best regards, Lino.
[Magisk] VR25:
This is the rsync issue reported earlier.

fbind -m/mb won't work for you. You have to move data with a file manager then run fbind -b to bind the folders.

I recommend replacing all data on the destination, since it may be incomplete.

The upcoming version will have this fixed.

Thanks
[Magisk] handers1234:
This module doesn't work for me,like a good people I read OP thoroughly and test it first,this what I do

1.Download the zip file

2.Make folder named fbind in internal storage and copy one video in it

3.Make folder named Target in external storage

4.Flash module zip

5.Open termux and typed su -c fbind -s to activate sdcardfs

6.Mandatory reboot,then modify the the config.txt with from_to fbind Target

7.Open termux and typed su,then fbind -mb.It shows some progress with -end

8.Reboot

9.Checked and nothing happened.There're no video file in Target folder

Where is my mistake?

Edit:It works if I move the file manually and just do fbind -b,move video file to Target,su fbind -b,then voila it appears in fbind folder too.Is it device specific problem?

Ah but when I fbind -u,it says unmounting.. -end but the file still appear on both folder
[Magisk] duromx:
Hi, I know it's been reported several times, but just to confirm "fbind - u" doesn't do anything. After that even when reboot, the folders are still paired!
[Magisk] handers1234:
I got same problem with [MENTION=7971827]duromx[/MENTION] and I noticed I can't delete fbind folder in Internal,the arg is from_to fbind Target
[Magisk] VR25:
Because SDcardFS support was experimental, I didn't bother making fbind -u work with it. Currently, only the bare bones are operational.

You can't easily delete a mount point.

___

Quick Announcement

I see the enthusiasm on SDcardFS support growing fast. That's great.

The next version is about 80% ready.

- Bug fixes (inc. fbind -u), major optimizations, new features and more...
[Magisk] duromx:
I forgot to thank you first of all for your work and your patience. .
[Magisk] Azocke5531:
Sorry if this question have been asked before, don't have much time to read all.

Is this to copying/moving something to externalsd path (also vice versa) that i set in config.txt ? I accidentally moving something to it

I just worried I will messed up something...
[Magisk] ss.toedjoeh:
[MENTION=5228676]VR25[/MENTION] I want to ask, is there anyway I could make my external sd card formatted vfat to be threaded as default sdcard (just like android lollypop and lower) to store apps data just like image, obb etc without creating every apps in config.txt? Need this since I'm using oreo in my phone and it doesn't support adoptable storage (using native fbe).
[Magisk] rainman74:
Excuse my beginner's question, but is it possible to mount an external sdcard as /sdcard1 with fbind?

Example: /storage/301D-A4EA -> /sdcard1

It would be ideal if you didn't have to specify the unique name of the sdcard.